Java OpenGL rendering of streets


OpenStreetMap newbie here! I am tasked with rendering the streets found in the OpenStreetMap data on a globe using Java OpenGL (JOGL).

I am trying to wrap my head around Osmosis, JOSM, and osm2poly. The last on that list being important because the polygon format is very friendly for drawing the streets.

My approach is to use Osmosis to strip out the specific types of streets I want (ie highway, local streets, etc.), use osm2poly to create polygon files for these streets, and then read these files in Java and draw them on the globe. Is this approach feasible and correct?

If so…

  1. I am having trouble using Osmosis to rip out the streets with the tags that I want. For example, I am using the following commands:
    “osmosis --read-xml Albuquerque.osm --way-key-value keyValueList=“waterway” --used-node --write-xml Albuquerque.waterway.osm”
    “osmosis --read-xml Albuquerque.osm --way-key-value keyValueList=“highway” --used-node --write-xml Albuquerque.highway.osm”

They both create identical files! What am I doing wrong?

  1. Osm2poly is returning errors no matter what OSM file I use. The error usually reads, “Cannot process tag ‘highway’…”. What does this mean?

According to point 1)

You can also try

You are using --way-key-value keyValueList=“…”, but you specify only keys for the filter, no values.
Try using --way-key keyList=“highway” instead.

I don’t know anything about Osm2poly, though.