sql-servergeospatialsqlgeometry

Convert coordinate systems using SQLGeometery


One of my shape files looks like this:

POLYGON (
  -91.513078999999991 36.970298, 
  -87.01993499999999 36.970298, 
  -87.01993499999999 42.508337999999995, 
  -91.513078999999991 42.508337999999995, 
  -91.513078999999991 36.970298)

Another file is using SRID 3857:

POLYGON (
  -10033572.109485552 4727287.954831399, 
  -10033571.708142675 4727287.954831399, 
  -10033571.708142675 4727288.1439229213, 
  -10033572.109485552 4727288.1439229213, 
  -10033572.109485552 4727287.954831399)

Assuming I can figure out which coordinate systems are being used, how do I convert from one format to the other?


Solution

  • Use the GeometryToGeometry function from Pro Spatial, chapter 8.

    Source code and data tables: http://www.apress.com/9781430234913