[Talk-es] Problems obtaining OSM data from java
Manuel Enrique Puebla Martinez
mpuebla en uci.cu
Lun Abr 11 13:16:46 UTC 2016
Hello:
I'm reading data from OSM (Node, Way and Relations) but I have found that I am not getting all the existing data in OSM.
I downloaded a replica of mapping Cuba, with the following command:
http://overpass-api.de/api/interpreter?data=(node(-85.166,23.362,-74.026,19.725);<;>);out;
To read the data I use the framework osm4j. Here the fundamental part of the code:
Collection<OsmEntity> collection = new LinkedList<>();
collection.addAll(boroughsData.getNodes().valueCollection()) ;
collection.addAll(boroughsData.getWays().valueCollection()) ;
collection.addAll(boroughsData.getRelations().valueCollection()) ;
for (OsmEntity objectSpatial : collection) {
Map<String, String> TablTags = OsmModelUtil.getTagsAsMap(objectSpatial);
InsertionErrorsOntology err=null;
if (TablTags.size()!=0 ) {
err = WriteToponymInOntology(objectSpatial);
if (err == InsertionErrorsOntology.ISPRESENT)
continue;
}
for (int i=0; i< objectSpatial.getNumberOfTags() ;i++) {
String TaqsKey = objectSpatial.getTag(i).getKey();
String TagsValue = objectSpatial.getTag(i).getValue();
if (TagsValue != null && TaqsKey == "place")
However, the variable "TaqsKey" never takes the value "place" or the "waterway" value. Naturally, there are data on Cuba in OSM, with those values labels, I searched and OSM site.
Any suggestions?
Best regards, MAnuel Puebla.
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.openstreetmap.org/pipermail/talk-es/attachments/20160411/d7e66c0d/attachment.html>
Más información sobre la lista de distribución Talk-es