Skip to content

Instantly share code, notes, and snippets.

@xVir
Last active December 10, 2015 02:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save xVir/4369036 to your computer and use it in GitHub Desktop.
RgeothesRecordsParsing
List<Record> result = new ArrayList<Record>();
for (int i = 0; i < nodes.getLength(); i++) {
Node node = nodes.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element) node;
Record record = new Record();
System.out.println("Object name: " + getValue("name", element));
System.out.println("Object language: " + getValue("language", element));
System.out.println("Object type: " + getValue("type", element));
Name recordName = new Name(getValue("name", element), getValue("language", element), getValue("type", element));
record.addName(recordName);
System.out.println("Object latitude: " + getValue("latitude", element));
System.out.println("Object longitude: " + getValue("longitude", element));
Point objectLocation = new Pint(ConvertToDouble(getValue("latitude", element)), ConvertToDouble(getValue("longitude", element));
record.addLocation(objectLocation);
result.add(record);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment