Contents Prev: Visualizing data: restaurant density Next: Command line interface: osm4j-utils

Rendering a map

In this example we will render a map to a Swing panel. This is how the result will look like:

To build the map, we retrieve some data from the Overpass API using a bounding box query and read the data into memory. We will then select the features we would like to appear on the map and assemble their geometries. Whenever the panel's paintComponent() method is invoked, we render the objects onto the panel's canvas.

Contents Prev: Visualizing data: restaurant density Next: Command line interface: osm4j-utils