4

A kind of branching of this question.

Soon I will need to handle GML Coordinate Reference Sysyem definitions in a Java servlet. Links:

I know that GeoTools library can parse GML, and I can see in http://docs.geotools.org/latest/userguide/library/xml/geometry.html some good documentation regarding Geometry features.

I'd like to know whether I will be able to parse such definitions, and maybe translate them to WKT.

  • can you clarify? what do you want to do with the CRS, if you just need to identify the projection of the data then GT should be able to handle it fine. – Ian Turton Apr 27 '12 at 12:59
  • @iant: Parse the definitions of compound or derived CRS to e.g. understand which dimensions are involved and in which order, then use them to create CoordinateReferenceSystem instances (org.geotools.referencing.CRS class has a parseWKT() method, but not a parseGML() equivalent) – Campa Apr 27 '12 at 14:20
  • I suspect not then - best place to ask is the user list – Ian Turton Apr 27 '12 at 14:41
  • I did that, I'll report any possible hint/answer in case this question remains open. – Campa May 7 '12 at 21:22
  • 1
    The question remains unanswered, I think you should either delete the question or provide an answer – nmtoken Oct 7 '16 at 9:19
1

At present I do not believe that GeoTools can parse the sort of XML CRS definition you have linked to. I got excited when I found CRSFactory.createFromXml() but it throws a "Not Yet Implemented" exception.

However you could probably write a parser with not too much effort as there is already a CRSFactory and others which help with CRS creation from known EPSG codes for example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.