How to create a gml file from Java code
I want to create an application which require to create a .gml file using Java. And I want to add elements in that newly created .gml file from a t开发者_JAVA百科ext file.
How can I do so?
I'm guessing that you have legacy output of some form without explicit markup and that it has geo-coordinates in it. There is no simple or easy answer to that - we are engaged in writing parsers that will extract geo-coordinates from free text and it's a long process, involving heuristics and without 100% recall/precision.
Sometimes you have semi-structured documents - such as Wikipedia and it is easier - but not trivial - to write a geo-coordinate scraper.
But you should give more details of your potential inputs.
Since GML is an XML dialect, I'd say the best way is to take your GML application schema and use JAX-B to generate an Object model from it, then parse the text format, transfer the data to the objext model and use JAX-B to marshal it to XML.
All a .gml file is a file that starts with #define script_name Then you put your code below that.
精彩评论