GeoTools
  1. GeoTools
  2. GEOT-1704

FORCE_AXIS_ORDER_HONORING does not work if longitude first is provided as an hint instead as a system variable

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.4.6
    • Component/s: referencing
    • Labels:
      None

      Description

      The following program:

      import org.geotools.factory.Hints;
      import org.geotools.referencing.CRS;
      
      public class ForceAxisOrderHonoring {
          public static void main(String[] args) throws Exception {
              Hints.putSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);
      //        System.setProperty("org.geotools.referencing.forceXY", "true");
              Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "http, urn");
              System.out.println(CRS.decode("EPSG:4326"));
              System.out.println(CRS.decode("http://www.opengis.net/gml/srs/epsg.xml#4326"));
              System.out.println(CRS.decode("urn:x-ogc:def:crs:EPSG:6.11.2:4326"));
          }
      }
      

      shows that Hints.FORCE_AXIS_ORDER_HONORING is ignored when the FORCE_LONGITUDE_FIRST_AXIS_ORDER=true is provided as an hint, and it's honored instead when the latter is provided as a system variable. In GeoServer I can keep the old system variable approach, yet it would be nicer on the web containers to avoid setting system variables within a web application

        Issue Links

          Activity

          Hide
          Jody Garnett added a comment -
          I have found a related problem in udig when switching to epsg-hsql; when I set global hints it prevents the epsg authority factory from being discovered at all!

          The relationship between Hints and referencing seems to be troubled.
          Show
          Jody Garnett added a comment - I have found a related problem in udig when switching to epsg-hsql; when I set global hints it prevents the epsg authority factory from being discovered at all! The relationship between Hints and referencing seems to be troubled.
          Hide
          Jody Garnett added a comment -
          With no hints...
          DefaultAuthorityFactory["All"] (crs, buffered)
          ????ManyAuthoritiesFactory["All"] (crs, cs, datum, operation, optional)
              ????ThreadedHsqlEpsgFactory["EPSG"] (crs, cs, datum, operation, buffered, optional, registered)
              ?   ????FactoryUsingHSQL["EPSG"] (crs, cs, datum, operation)
              ?       ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
              ?       ????DatumAliases[direct] (datum, registered)
              ????WebCRSFactory["CRS"] (crs, registered)
              ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
              ?   ????DatumAliases[direct] (datum, registered)
              ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)
              ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
              ?   ????DatumAliases[direct] (datum, registered)
              ????URN_AuthorityFactory["urn:ogc:def", "urn:x-ogc:def"] (crs, cs, datum, operation, optional, registered)
              ?   ????AllAuthoritiesFactory["All"] (crs, cs, datum, operation, optional)
              ?       ????ThreadedHsqlEpsgFactory["EPSG"] (crs, cs, datum, operation, buffered, optional, registered)
              ?       ?   ????FactoryUsingHSQL["EPSG"] (crs, cs, datum, operation)
              ?       ?       ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
              ?       ?       ????DatumAliases[direct] (datum, registered)
              ?       ????WebCRSFactory["CRS"] (crs, registered)
              ?       ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
              ?       ?   ????DatumAliases[direct] (datum, registered)
              ?       ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)
              ?       ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
              ?       ?   ????DatumAliases[direct] (datum, registered)
              ?       ????HTTP_AuthorityFactory["http://www.opengis.net"] (crs, cs, datum, operation, optional, registered)
              ????HTTP_AuthorityFactory["http://www.opengis.net"] (crs, cs, datum, operation, optional, registered)
                  ????AllAuthoritiesFactory["All"] (crs, cs, datum, operation, optional)
                      ????ThreadedHsqlEpsgFactory["EPSG"] (crs, cs, datum, operation, buffered, optional, registered)
                      ?   ????FactoryUsingHSQL["EPSG"] (crs, cs, datum, operation)
                      ?       ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
                      ?       ????DatumAliases[direct] (datum, registered)
                      ????WebCRSFactory["CRS"] (crs, registered)
                      ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
                      ?   ????DatumAliases[direct] (datum, registered)
                      ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)
                      ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
                      ?   ????DatumAliases[direct] (datum, registered)
                      ????URN_AuthorityFactory["urn:ogc:def", "urn:x-ogc:def"] (crs, cs, datum, operation, optional, registered)

          With hints:
          DefaultAuthorityFactory["All"] (crs, buffered)
          ????ManyAuthoritiesFactory["All"] (crs, cs, datum, operation, optional)
              ????WebCRSFactory["CRS"] (crs, registered)
              ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
              ?   ????DatumAliases[direct] (datum, registered)
              ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)
              ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
              ?   ????DatumAliases[direct] (datum, registered)
              ????URN_AuthorityFactory["urn:ogc:def", "urn:x-ogc:def"] (crs, cs, datum, operation, optional, registered)
              ?   ????AllAuthoritiesFactory["All"] (crs, cs, datum, operation, optional)
              ?       ????ThreadedHsqlEpsgFactory["EPSG"] (crs, cs, datum, operation, buffered, optional, registered)
              ?       ?   ????FactoryUsingHSQL["EPSG"] (crs, cs, datum, operation)
              ?       ?       ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
              ?       ?       ????DatumAliases[direct] (datum, registered)
              ?       ????WebCRSFactory["CRS"] (crs, registered)
              ?       ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
              ?       ?   ????DatumAliases[direct] (datum, registered)
              ?       ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)
              ?       ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
              ?       ?   ????DatumAliases[direct] (datum, registered)
              ?       ????HTTP_AuthorityFactory["http://www.opengis.net"] (crs, cs, datum, operation, optional, registered)
              ????HTTP_AuthorityFactory["http://www.opengis.net"] (crs, cs, datum, operation, optional, registered)
                  ????AllAuthoritiesFactory["All"] (crs, cs, datum, operation, optional)
                      ????ThreadedHsqlEpsgFactory["EPSG"] (crs, cs, datum, operation, buffered, optional, registered)
                      ?   ????FactoryUsingHSQL["EPSG"] (crs, cs, datum, operation)
                      ?       ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
                      ?       ????DatumAliases[direct] (datum, registered)
                      ????WebCRSFactory["CRS"] (crs, registered)
                      ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
                      ?   ????DatumAliases[direct] (datum, registered)
                      ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)
                      ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
                      ?   ????DatumAliases[direct] (datum, registered)
                      ????URN_AuthorityFactory["urn:ogc:def", "urn:x-ogc:def"] (crs, cs, datum, operation, optional, registered)
          Show
          Jody Garnett added a comment - With no hints... DefaultAuthorityFactory["All"] (crs, buffered) ????ManyAuthoritiesFactory["All"] (crs, cs, datum, operation, optional)     ????ThreadedHsqlEpsgFactory["EPSG"] (crs, cs, datum, operation, buffered, optional, registered)     ?   ????FactoryUsingHSQL["EPSG"] (crs, cs, datum, operation)     ?       ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)     ?       ????DatumAliases[direct] (datum, registered)     ????WebCRSFactory["CRS"] (crs, registered)     ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)     ?   ????DatumAliases[direct] (datum, registered)     ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)     ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)     ?   ????DatumAliases[direct] (datum, registered)     ????URN_AuthorityFactory["urn:ogc:def", "urn:x-ogc:def"] (crs, cs, datum, operation, optional, registered)     ?   ????AllAuthoritiesFactory["All"] (crs, cs, datum, operation, optional)     ?       ????ThreadedHsqlEpsgFactory["EPSG"] (crs, cs, datum, operation, buffered, optional, registered)     ?       ?   ????FactoryUsingHSQL["EPSG"] (crs, cs, datum, operation)     ?       ?       ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)     ?       ?       ????DatumAliases[direct] (datum, registered)     ?       ????WebCRSFactory["CRS"] (crs, registered)     ?       ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)     ?       ?   ????DatumAliases[direct] (datum, registered)     ?       ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)     ?       ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)     ?       ?   ????DatumAliases[direct] (datum, registered)     ?       ????HTTP_AuthorityFactory[" http://www.opengis.net "] (crs, cs, datum, operation, optional, registered)     ????HTTP_AuthorityFactory[" http://www.opengis.net "] (crs, cs, datum, operation, optional, registered)         ????AllAuthoritiesFactory["All"] (crs, cs, datum, operation, optional)             ????ThreadedHsqlEpsgFactory["EPSG"] (crs, cs, datum, operation, buffered, optional, registered)             ?   ????FactoryUsingHSQL["EPSG"] (crs, cs, datum, operation)             ?       ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)             ?       ????DatumAliases[direct] (datum, registered)             ????WebCRSFactory["CRS"] (crs, registered)             ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)             ?   ????DatumAliases[direct] (datum, registered)             ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)             ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)             ?   ????DatumAliases[direct] (datum, registered)             ????URN_AuthorityFactory["urn:ogc:def", "urn:x-ogc:def"] (crs, cs, datum, operation, optional, registered) With hints: DefaultAuthorityFactory["All"] (crs, buffered) ????ManyAuthoritiesFactory["All"] (crs, cs, datum, operation, optional)     ????WebCRSFactory["CRS"] (crs, registered)     ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)     ?   ????DatumAliases[direct] (datum, registered)     ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)     ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)     ?   ????DatumAliases[direct] (datum, registered)     ????URN_AuthorityFactory["urn:ogc:def", "urn:x-ogc:def"] (crs, cs, datum, operation, optional, registered)     ?   ????AllAuthoritiesFactory["All"] (crs, cs, datum, operation, optional)     ?       ????ThreadedHsqlEpsgFactory["EPSG"] (crs, cs, datum, operation, buffered, optional, registered)     ?       ?   ????FactoryUsingHSQL["EPSG"] (crs, cs, datum, operation)     ?       ?       ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)     ?       ?       ????DatumAliases[direct] (datum, registered)     ?       ????WebCRSFactory["CRS"] (crs, registered)     ?       ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)     ?       ?   ????DatumAliases[direct] (datum, registered)     ?       ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)     ?       ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)     ?       ?   ????DatumAliases[direct] (datum, registered)     ?       ????HTTP_AuthorityFactory[" http://www.opengis.net "] (crs, cs, datum, operation, optional, registered)     ????HTTP_AuthorityFactory[" http://www.opengis.net "] (crs, cs, datum, operation, optional, registered)         ????AllAuthoritiesFactory["All"] (crs, cs, datum, operation, optional)             ????ThreadedHsqlEpsgFactory["EPSG"] (crs, cs, datum, operation, buffered, optional, registered)             ?   ????FactoryUsingHSQL["EPSG"] (crs, cs, datum, operation)             ?       ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)             ?       ????DatumAliases[direct] (datum, registered)             ????WebCRSFactory["CRS"] (crs, registered)             ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)             ?   ????DatumAliases[direct] (datum, registered)             ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)             ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)             ?   ????DatumAliases[direct] (datum, registered)             ????URN_AuthorityFactory["urn:ogc:def", "urn:x-ogc:def"] (crs, cs, datum, operation, optional, registered)
          Hide
          Martin Desruisseaux added a comment -
          The management of hints has been slightly simplified in Geotidy. The system property setting has been removed as part of this simplification process. It may sound scary for this issue, but I think that the new handling of default hints is simple enough that this issue will be solved (basically everything we write "new Hints()", the new Hints object is immediately filled with the default hints. User can override them if he wants. No more merging process to be applied later).

          We need to test against the EPSG factories when they will be ported to geotidy, and to port geotidy back to Java 5 so it can be used in Geotools, before to close this issue.
          Show
          Martin Desruisseaux added a comment - The management of hints has been slightly simplified in Geotidy. The system property setting has been removed as part of this simplification process. It may sound scary for this issue, but I think that the new handling of default hints is simple enough that this issue will be solved (basically everything we write "new Hints()", the new Hints object is immediately filled with the default hints. User can override them if he wants. No more merging process to be applied later). We need to test against the EPSG factories when they will be ported to geotidy, and to port geotidy back to Java 5 so it can be used in Geotools, before to close this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              Andrea Aime
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: