Yes, Osmarender can render coastlines [sort of]!

There’s been a nagging error in the Cleveland Neighborhood Map: No Lake.

Lake Erie will be in the upcoming CNM update as I figured out how to configure my rendering software, or/p, (a perl implementation of osmarender) to include the coastline.

Here is how I did it:

The problem:

When downloading data from OSM, the geographic area is (not always, but for the sake of this post, most of time) shaped in a rectangle defined by the bounding a north, east, south, and west coordinates (known as a bounding box).

When it comes to coastlines in OSM, the entire area is not downloaded, just the data within the bounding box. This can be a problem if your data partially contains a coastline and the data does not specify which side is land and which is water !

Thus, here’s what you should do if you have a large coastline to render in osmarender.
(thanks to bobkare in the OSM IRC channel for the help).

  1. download the tiles@home client.
  2. Extract the t@h client, copy both ./ and the folder png2tileinfo to the folder that contains the .OSM file you wish to render.
  3. Run ./ on the .OSM file
    As follows: ./ minlat minlon maxlat maxlon < theosmfile.osm > output.osm will download the additional coastline that was not in the bounding box and specify the area(s) near the coastline which contain water.

After running, my output .osm file, once rendered, still did not have water in it.
Why ?!
Through a couple trial and errors of running, I also learned that the the bounding box order IS NOT the same as your minlat minlon maxlat maxlon . The bounding box order (used in the OSM API, [v.06]) is left,bottom,right,top sides of your bounding box;

but the parameters of the
minlat is the bottom (of your bounding box) (southern portion),
maxlat is the top/north;
minlon is the left/west;
maxlon is the right/east.

I had mistakenly entered the bounding box coordinates in the same order of the API, not the specific order used in

The correct was:./ 41.49503 -81.7291 41.51245 -81.69391 < input.osm &rt; output.osm

EDIT: I haven’t fixed it yet I was able to render the coastline using an area of bounding box that consisted of the mall portion of downtown Cleveland (the above coordinates), for the sake of simplicity during this debugging process. However, when I attempt to run the above using the bounding box of the entire city of Cleveland (the same used for the Cleveland Neighborhood Map), the water is displayed everywhere on the rendered image, instead of just Lake Erie.

Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s