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:
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).
- download the tiles@home client.
- Extract the t@h client, copy both ./close-areas.pl and the folder png2tileinfo to the folder that contains the .OSM file you wish to render.
- Run ./close-areas.pl on the .OSM file
./close-areas.pl minlat minlon maxlat maxlon < theosmfile.osm > output.osm
close-areas.pl 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 close-areas.pl, my output .osm file, once rendered, still did not have water in it.
Through a couple trial and errors of running close-areas.pl, 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 close-areas.pl
The correct close-areas.pl was:
./close-areas.pl 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.