locationtech / proj4j

Java port of the Proj.4 library for coordinate reprojection
Other
184 stars 73 forks source link

No support for vertical keywords such as geoidgrids and vunits #20

Open pomadchin opened 5 years ago

pomadchin commented 5 years ago

Issue created by @jfbourgon text is ported from here: https://github.com/locationtech/geotrellis/issues/2146

Trying to parse a proj4 string such as the following:

+proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +geoidgrids=CGG2013n83a.gtx +vunits=m +no_defs"

will raise org.osgeo.proj4j.UnsupportedParameterException

org.osgeo.proj4j.UnsupportedParameterException: vunits parameter is not supported
  at org.osgeo.proj4j.parser.Proj4Keyword.checkUnsupported(Proj4Keyword.java:131)
  at org.osgeo.proj4j.parser.Proj4Keyword.checkUnsupported(Proj4Keyword.java:138)
  at org.osgeo.proj4j.parser.Proj4Parser.parse(Proj4Parser.java:49)
  at org.osgeo.proj4j.CRSFactory.createFromParameters(CRSFactory.java:136)
  at org.osgeo.proj4j.CRSFactory.createFromParameters(CRSFactory.java:114)
  at geotrellis.proj4.CRS$$anon$1.<init>(CRS.scala:43)
  at geotrellis.proj4.CRS$.fromString(CRS.scala:42)

or

org.osgeo.proj4j.UnsupportedParameterException: geoidgrids parameter is not supported
  at org.osgeo.proj4j.parser.Proj4Keyword.checkUnsupported(Proj4Keyword.java:131)
  at org.osgeo.proj4j.parser.Proj4Keyword.checkUnsupported(Proj4Keyword.java:138)
  at org.osgeo.proj4j.parser.Proj4Parser.parse(Proj4Parser.java:49)
  at org.osgeo.proj4j.CRSFactory.createFromParameters(CRSFactory.java:136)
  at org.osgeo.proj4j.CRSFactory.createFromParameters(CRSFactory.java:114)
  at geotrellis.proj4.CRS$$anon$1.<init>(CRS.scala:43)
  at geotrellis.proj4.CRS$.fromString(CRS.scala:42)

Indeed such parameters are not listed in SupportedParameter TreeSet in Proj4Keyword.java