> On Sat, Oct 27, 2012 at 11:42 PM, Tom Kunicki <[email protected]> wrote:
>> 
>> Hello,
>> 
>> We've found a regression between GeoTools 2.6.3 as compared with 2.7.5 and
>> 8.2 with regard to datum equality.
>> 
>> In GeoTools 2.6.3 (the version used for prj2epsg.org) we can successfully
>> resolve the following WKT provided with an ESRI sourced shapefile as
>> EPSG:3071:
>> 
>> PROJCS["NAD_1983_HARN_Transverse_Mercator",
>>    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",520000.0],
>>    PARAMETER["False_Northing",-4480000.0],
>>    PARAMETER["Central_Meridian",-90.0],
>>    PARAMETER["Scale_Factor",0.9996],
>>    PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
>> 
>> In GeoTools 2.7.5 and 8.2 the conversion of the above WKT to and EPSG code
>> fails and I've isolated this the the fact the datum name doesn't match the
>> expected EPSG datum name of "NAD83 (High Accuracy Regional Network)".  The
>> WKT below with the datum name replaced does resolve to EPSG:3071 in GeoTools
>> 2.75 and 8.2
>> 
>> PROJCS["NAD_1983_HARN_Transverse_Mercator",
>>    GEOGCS["GCS_North_American_1983_HARN",
>>        DATUM["NAD83 (High Accuracy Regional Network)",
>>            SPHEROID["GRS_1980",6378137.0,298.257222101]],
>>            PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],
>>    PROJECTION["Transverse_Mercator"],
>>    PARAMETER["False_Easting",520000.0],
>>    PARAMETER["False_Northing",-4480000.0],
>>    PARAMETER["Central_Meridian",-90.0],
>>    PARAMETER["Scale_Factor",0.9996],
>>    PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
>> 
>> From my investigation, it appears that datum name is important in
>> comparisons and I came across the GeoTools DatumAlias factory and the
>> associated DatumAliasesTable.txt.  This factory does have an entry mapping
>> the EPSG datum name to the ESRI datum name, and the aliases are added to the
>> Datum instance but this relationship doesn't appear to be used when doing
>> datum comparisons.   I would think that if a datum name doesn't match the
>> datum aliases should then be consulted. Is this current behavior intended or
>> a regression?
> 
> It indeed looks like a regression. Patches welcomed :-)
> 
> Cheers
> Andrea

A little bit of Occam's razor here...  Spent hours digging through source but 
it appears to simply be a mismatch between the name listed in the 
DomainAliasesTable.txt used to drive DomainAlias DatumFactory and the name of 
the datum in the EPSG database.  It appears that with EPSG ChangeRequest 
EPSG::2010.061 the name for the datum EPSG:6152 was modified from "NAD83 (High 
Accuracy Regional Network)" to "NAD83 (High Accuracy Reference Network)",  With 
EPSG ChangeRequest EPSG::2011.009 the former name of "NAD83 (High Accuracy 
Regional Network)" was added an alias for EPSG:6152.

I am going to guess that the regression from 2.6 to 2.7 and beyond was the 
inclusion of a new EPSG database in the GeoTools HSQL factory we are using 
(tied to the GeoTools version) without an update to the DomainAliasTable.txt

Resolution options for discussion...

1) Update the DomainAliasTable.txt with the new datum name for EPSG:6152
2) Consider using keys in DatumAlias factory appropriate to authorities (i.e. 
"6152" instead or maybe in addition to EPSG datum name)
  2.1) what about other authorities?.
3) Add unit test to check that keys exist for given authority,
  3.1) Would catch mismatches with GeoTools bundled authority DBs
  3.2) Would not catch user provided authority DBs (add runtime check with 
logged warning?)
4) Others?


Tom Kunicki
Center for Integrated Data Analytics
U.S. Geological Survey
8505 Research Way
Middleton, WI  53562


------------------------------------------------------------------------------
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to