Details
-
Type:
Task
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.2.M1
-
Fix Version/s: 2.2-RC0
-
Component/s: referencing
-
Labels:None
Description
While the axis order for EPSG:4326 is "officially" (NORTH,EAST), some code expect (EAST,NORTH) axis order. We need a mechanism for allowing people to force (EAST,NORTH) axis order if they wish. This applies primarily to the EPSG authority factory, but similar issue may happen for any kind of authority factory (not just EPSG).
A proposed approach is to create an AuthorityFactory wrapper (exact name to be determined), which wraps an other AuthorityFactory and reorder the axis according some user-supplied axis order, or according a default (EAST,NORTH,UP,FUTURE) axis order. If a user wants to be sure that that all CRS use this axis order, he could write something like (simplified):
AuthorityFactory factory = new RearangedAuthorityFactory(FactoryFinder.getAuthorityFactory(theAuthority));
Suggestions (other approachs, other issue to take in account, etc.) welcome.
Issue Links
- is depended upon by
-
GEOT-364
port plugin/epsg crs authority factories to geoapi
-
Secondly, the example code given implies that one is explicitly creating a RearangedAuthorityFactory, but it does not address how the RearangedAuthorityFactory can be configured to wrap the "real" AuthorityFactory when that AuthorityFactory is retrieved internally by GeoTools code. To be clear, I am thinking of when a CRS of a FeatureSource is resolved. For example, if I have a PostGIS-based FeatureSource with an SRID declared on the database table, then the PostgisAuthorityFactory will call CRS.decode() to translate a String like "EPSG:4326" into a CoordinateReferenceSystem. CRS.decode() then looks up the appropriate authority factory via FactoryFinder.getCRSAuthorityFactories(). The question is how one would intervene here to ensure that the RearangedAuthorityFactory is used by CRS.decode()?
My suggestion is that the priority of any RearrangedAuthorityFactory must be greater than any "real" AuthorityFactory (Access, HSQL). If that were the case, one could (I think) just do this:
AuthorityFactory factory = new RearangedAuthorityFactory(FactoryFinder.getAuthorityFactory(theAuthority));
FactoryFinder.addAuthorityFactory(factory);
Apologies if all this was implicit in the original description!