DotSpatial.Projections

Nov 19, 2010 at 7:15 PM
Edited Nov 19, 2010 at 7:31 PM

I noticed this issue with the DotSpatial.Projections:

When I used the NorthAmericanDatum1983.ToEsriString, I get:

GEOGCS["NorthAmericanDatum1983",DATUM["",SPHEROID["WGS_1984",6378137,298.257223562997]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]]

In ArcMap is shows as:

Geographic Coordinate System: NorthAmericanDatum1983
Datum:
Prime Meridian: Greenwich
Angular Unit: Degree

However, a NAD1983 layer in ArcMap generates:

GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]

For:

Geographic Coordinate System: GCS_North_American_1983
Datum: D_North_American_1983
Prime Meridian: Greenwich
Angular Unit: Degree

This difference causes a projection mismatch when the shapefile is added . Am I doing something wrong or is this a bug?

Terry

Developer
Nov 19, 2010 at 7:57 PM

What you did should work for most things, but I don't know if it runs the fixemup that we added in order to make sure the ESRI names match.

The WGS84 string would probably be correct enough to work though.  It probably is using the name of the class as a default for some reason.

Anyway, try creating your projection from:

ProjectionInfo myProjection = KnownCoordinateSystems.Geographic...;

The KnownCoordinteSystems class should handle the proper ESRI string creation, but if it doesn't then enter it as an issue and we can fix it.

Ted

Nov 19, 2010 at 8:43 PM

Thanks. I will add as an issue because I was using the ProjectionInfo myProjection = KnownCoordinateSystems.Geographic method.

Feb 1, 2011 at 4:29 PM
Edited Feb 1, 2011 at 5:25 PM

Was this issue fixed or added?

When using KnownCoordinateSystems.Geographic.NorthAmerica.NorthAmericanDatum1983 my .prj file contains (this is the same value as calling ToEsriString() ):

GEOGCS["",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101004]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]]

I believe the proper ESRI string should be:

GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101004]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]]

 

Note that I can get around this (and get the expected result) by setting Projection.GeographicInfo.Name = "GCS_North_American_1983" for the time being.

 

-Raj

Developer
Feb 1, 2011 at 8:31 PM

I have been able to create a test case that reproduces this issue.

Developer
Feb 1, 2011 at 8:41 PM

I have fixed the error in the definition of

NorthAmericanDatum1983
Feb 1, 2011 at 10:02 PM

Awesome. Fantastic turnaround on this issue.  I will update, rebuild, test and then remove temporary fix from my application.

-Raj