0

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 text file.

How can I do so?

Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
tamanna
  • 51
  • 2
  • 3
  • 11
  • Can you narrow down your question? Currently a valid answer would be *by typing Java code in a text editor*. – Felix Kling Mar 07 '11 at 10:08
  • Alright, looks like [GML](http://en.wikipedia.org/wiki/Geography_Markup_Language) is an XML based markup. I have no clue what you mean by converting text file to GML file! Perhaps rename the extension? – adarshr Mar 07 '11 at 10:08
  • You must show us what the text file looks like (just a small section) - we cannot help you otherwise – peter.murray.rust Mar 07 '11 at 10:34
  • GML stands for Game Maker Language. What the hell are you guys even talking about? Wrong tag. haha – kotAPI Jan 29 '14 at 08:51

3 Answers3

2

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.

peter.murray.rust
  • 37,407
  • 44
  • 153
  • 217
1

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.

Michael Borgwardt
  • 342,105
  • 78
  • 482
  • 720
-2

All a .gml file is a file that starts with #define script_name Then you put your code below that.

null
  • 548
  • 2
  • 6
  • 17