This project is read-only.

Transform

Topics: Developer Forum, User Forum
Apr 14, 2007 at 5:18 PM
Nice job on MsSqlSpatial. It's great.

I'm having some trouble transform'ing coordinates. I've tracked down the SRID's and searched and looked at this for hours. Using one coordinate pair I've converted back and forth in ArcGIS and MsSqlSpatial to compare the results.. My initial test was over 400,000 pairs but soon realized that I missed something so I pulled one pair....

-- ESRI Transform for my input test
--> NAD1983HARNStatePlaneArizonaCentralFIPS0202Feet_Intl

dd: -110.99537 32.21563 = ft: 984923.1 443399.1

select st.x(geom),st.y(geom) from ( select geom =
ST.Transform( ST.GeomFromText('POINT( 984923.1 443399.1 )', 2868) , 4326) ) t
--> MsSqlSpatial Returns: -108.797329180134 34.9583360237288

select st.x(geom),st.y(geom) from (select geom=
ST.Transform( ST.GeomFromText('POINT(-110.99537 32.21563 )', 4326) ,2868) ) t
--> MsSqlSpatial Returns: 786844.803188649 135147.80629036

oddly ... 135147.80629036 looks real close to 443399.1 *.3048

--=====================================================
SRID: 2868
select srtext from st.spatialrefsys where srid=2868
PROJCS["NAD83(HARN) / Arizona Central (ft)"
,GEOGCS["NAD83(HARN)"
,DATUM["NAD83_High_Accuracy_Regional_Network"
,SPHEROID"GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"],AUTHORITY"EPSG","6152"]
,PRIMEM"Greenwich",0,AUTHORITY["EPSG","8901"]
,UNIT"degree",0.01745329251994328,AUTHORITY["EPSG","9122"],AUTHORITY"EPSG","4152"]
,PROJECTION"Transverse_Mercator"
,PARAMETER"latitude_of_origin",31
,PARAMETER"central_meridian",-111.9166666666667
,PARAMETER"scale_factor",0.9999
,PARAMETER"false_easting",700000
,PARAMETER"false_northing",0
,UNIT["foot",0.3048
,AUTHORITY"EPSG","9002"]
,AUTHORITY"EPSG","2868"]

-- ESRI Projection File .prj
PROJCS["NAD_1983_HARN_StatePlane_Arizona_Central_FIPS_0202_Feet_Intl"
,GEOGCS["GCS_North_American_1983_HARN"
,DATUM["D_North_American_1983_HARN"
,SPHEROID"GRS_1980",6378137.0,298.257222101]
,PRIMEM"Greenwich",0.0
,UNIT"Degree",0.0174532925199433]
,PROJECTION"Transverse_Mercator"
,PARAMETER"False_Easting",700000.0
,PARAMETER"False_Northing",0.0
,PARAMETER"Central_Meridian",-111.9166666666667
,PARAMETER"Scale_Factor",0.9999
,PARAMETER"Latitude_Of_Origin",31.0
,UNIT"Foot",0.3048]

Thanks in advance...
-Andy
Apr 16, 2007 at 3:28 PM
This discussion has been copied to Work Item 9665. You may wish to continue further discussion there.