Reading the XML by eyeballing it, some easy to answer questions

Hello,

I downloaded a small .osm non .pbf file as suggested.

I’m reading through it, and a vast majority of locations have no tags on them at all.
You got a node id, lat,lon, version,timestamp, changeset and user… but no tags… for the majority of nodes.
What should I assume they are? Buildings?


Question 2: Those are all gps points. How do I get street, trails and river data?

I think you 2nd question is close to an answer for the 1st :wink:
The data in a normal .osm file is sorted, first come all nodes, next the ways which refer to the nodes (via ids) and finally
the relations. So, just search for the string “way id” in your file to find the first way. Ways also sometimes don’t have tags,
in that case they are probably members of relations.

See also
http://wiki.openstreetmap.org/wiki/API_v0.6

and
http://wiki.openstreetmap.org/wiki/OSM_XML

Gerd

Thank you Gerdp.

The extra reading helped too.

I think I just need to figure out how to parse out the information that I care about now.

In case you don’t want to invent the wheel again you may want to use existing libraries like libosmium
http://osmcode.org/libosmium/

Still, I think you have to understand the basic concepts of OSM first, so maybe start mapping a few things in your area using
JOSM. The safe file option in JOSM also creates XML format, so you can use that to create and visualize small sample files.
If you plan to generate data in OSM format, make sure that you don’t upload it to the OSM servers.
JOSM understands the tags upload=‘false’ (or upload=‘never’) in the XML header. Sample:

<?xml version='1.0' encoding='UTF-8'?>

Gerd