Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 2.3.0, 2.4-M0
-
Component/s: referencing
-
Labels:None
-
Environment:epsg-hsql plugin
Description
CoordinateOperationAuthorityFactory.createFromCoordinateReferenceSystemCodes(source, target) produces a StackOverflowError when the following conditions are meet:
- (longitude, latitude) axis order is forced on a system-wide basis using the "org.geotools.referencing.forceXY" system property.
- A SQL-backed EPSG factory (like the epsg-hsql plugin) is in the classpath.
Initial investigation suggests that Geotools get trapped in infinite recursivity with method calls bouncing between AuthorityBackedFactory and OrderedAxisAuthorityFactory (indirectly, since there is many level of indirection). The following code reproduces the problem:
public static void main(String[] args) throws Exception { System.setProperty("org.geotools.referencing.forceXY", "true"); CoordinateReferenceSystem crs1 = CRS.decode("EPSG:32632"); CoordinateReferenceSystem crs2 = CRS.decode("EPSG:4326"); System.out.println(CRS.findMathTransform(crs1, crs2)); }