1
Vote

Transform 2868 <-> 4326 SRIDs

description

I'm having some trouble transforming 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

comments

Odegaard wrote Apr 17, 2007 at 6:30 PM

Here's my take on it (but untested).See the following function in MapProjection.cs:protected MapProjection(Collection<ProjectionParameter> parameters)The two projection parameters 'semimajor' and 'semiminor' should be multiplied by the linear unit of the projection. Unfortunately this is not accessible here, so the MapProjection should have an override that takes an extra parameter LinearUnit, and multiplies it to the semiminor and semimajor which is always specified in meters;The reason that only one of the values fit if you multiply by 0.3048 is that False_Northing is 0.0 which is the same value in feet and meters. If you change the False_Easting to a meter unit, both X and Y should give you a meter-unit you can multiply by 0.3048. Or in other words:(786844-700000)/0.3048+700000 = 984921 feetOf course this is just a workaround, and not a solution to the real problem.

SharpGIS wrote Aug 26, 2007 at 7:53 PM

This has been fixed in the Proj.NET library, so when the newest release has been included in MsSqlSpatial, this issue can be closed.

wrote Feb 14, 2013 at 6:56 PM