Greetings,

I'm not sure if this belongs in the User Mailing list or the Dev mailing list, 
so apologies in advance if this doesn't belong here.

Currently, I'm experiencing an interesting issue that I'm not sure whether it's 
a bug or working as intended - I get the following error from Apache SIS when I 
try to call WKTFormat.parseObject(String WKT) on EPSG::22197 
(http://www.epsg-registry.org/export.htm?wkt=urn:ogc:def:crs:EPSG::22197 for 
the WKT being fed to the function)

java.text.ParseException: Value 'Latitude of natural origin' = -90 is invalid. 
Expected a value in the [-90 ... 90] range.
                at 
org.apache.sis.io.wkt.MathTransformParser.parseParameters(MathTransformParser.java:317)
                at 
org.apache.sis.io.wkt.GeodeticObjectParser.parseDerivingConversion(GeodeticObjectParser.java:1362)
                at 
org.apache.sis.io.wkt.GeodeticObjectParser.parseProjectedCRS(GeodeticObjectParser.java:2129)
                at 
org.apache.sis.io.wkt.GeodeticObjectParser.parseCoordinateReferenceSystem(GeodeticObjectParser.java:368)
                at 
org.apache.sis.io.wkt.GeodeticObjectParser.parseObject(GeodeticObjectParser.java:329)
                at 
org.apache.sis.io.wkt.AbstractParser.parseObject(AbstractParser.java:283)
                at 
org.apache.sis.io.wkt.GeodeticObjectParser.parseObject(GeodeticObjectParser.java:286)
                at org.apache.sis.io.wkt.WKTFormat.parse(WKTFormat.java:724)
                at 
org.apache.sis.io.CompoundFormat.parseObject(CompoundFormat.java:317)
                ...
Caused by: org.opengis.parameter.InvalidParameterValueException: Value 
'Latitude of natural origin' = -90 is invalid. Expected a value in the [-90 ... 
90] range.
                at 
org.apache.sis.parameter.Verifier.ensureValidValue(Verifier.java:219)
                at 
org.apache.sis.parameter.DefaultParameterValue.setValue(DefaultParameterValue.java:734)
                at 
org.apache.sis.parameter.DefaultParameterValue.setValue(DefaultParameterValue.java:688)
                at 
org.apache.sis.io.wkt.MathTransformParser.parseParameters(MathTransformParser.java:299)
                ... 46 more

Should that check not be -90 .. 90 inclusive instead of exclusive? The fact 
that the EPSG Data includes that figure would imply that the -90 is valid, but 
I'm not a Geodesist. I'm not sure if this is a software bug or whether its' a 
data problem, but there are more instances of CRS's that have that value in 
that parameter (EPSG::21500 as another example: 
http://www.epsg-registry.org/export.htm?wkt=urn:ogc:def:crs:EPSG::21500 ). This 
issue also extends to longitudes (perhaps all parameters, I'm not sure) for 
example EPSG::2636 
http://www.epsg-registry.org/export.htm?exp=WKT_1&entity=urn:ogc:def:crs:EPSG::2636&r=42
 also throws an error regarding the Longitude of Natural Origin. Again, I'm not 
sure what's correct here, but the data and the software seem to be in conflict, 
so I thought I would bring it to your attention.

Regards,

Marc

Reply via email to