This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Problem with rendering water from Overpass data

1

EDIT: The question is also posted here: http://forum.openstreetmap.org/viewtopic.php?id=55126

In the past, I thought thay it might be a problem with Maperitive, but apparently it is not: https://groups.google.com/forum/m/#!msg/maperitive/-aXn7-2_f-4/nrVaQJ18HgAJ

Hello! I am trying to render a simple but complete map of a 18x18km city area.

I extract data from my own instance of OverpassAPI, using query given below, and then open extracted *.osm file in Maperitive and render a bitmap.

My example query for NYC:

[timeout:3600];(node(40.64975,-74.09327,40.811447,-73.87989);rel(bn)->.x;way(bn);rel(bw););(._;way(r););(._;node(r)->.x;node(w););(._;rel(br);rel(br);rel(br);rel(br););out;

Example map - as you can clearly see, a huge part of water is not rendered at all:

alt text

P.S. Someone has already advised me to download data from geofabrik, and extract a piece of it with osmconvert, using the 'keep ways and areas complete, even if they cross the border' option. It works just fine, but is 10x slower than downloading data from Overpass. I am pretty sure that it is possible to write a Overpass query which will fit my needs, but the query language is difficult. Help me please!

asked 13 Jul '16, 14:12

Kervyn's gravatar image

Kervyn
26112
accept rate: 0%

edited 15 Jul '16, 10:09

2

Did you check your .osm file in JOSM already to see if it includes all relevant data?

(13 Jul '16, 14:48) mmd

One Answer:

3

I don't know enough about coastline rendering to be positive, but if you have a look at one of the ways where your water stops you'll see that it's only part of one multipolygon. Hence your map is rendering the data correctly: there is actually nothing in the data that would imply this is water. That has something to do with this being the sea: in OpenStreetMap, coastlines are treated a bit special. A dataset defining the main bodies of water is kept a little separate from the general database, to define main landmasses and oceans. This is to avoid the constant flooding of continents you would see everytime someone makes a tiny mistake when editing coastlines.

I guess you might solve it for your usecase by closing your landmasses along the border of your area, and defining everything not enclosed as sea.

I'm sure others can give a more exact answer as to the rendering of coastlines.

answered 13 Jul '16, 19:13

joost%20schouppe's gravatar image

joost schouppe
3.4k245087
accept rate: 12%

Thanks joost! It would be quite difficult to write a tool automatically closing the landmasses as you suggest, though. I hope that somebody will help me rewrite the query, or suggest other solution to download the data (including water) properly ;-)

(14 Jul '16, 11:23) Kervyn

Well, I'm not sure if there's a way to let overpass return you data that doesn't exist :) (i.e. continents aren't regular polygons in OSM) But you could refrase your question into "how to get closed landmasses with overpass" or something like that. Other than that, I would think the simplest way would be to manually create a polygon for the area you need.

(18 Jul '16, 10:58) joost schouppe
2
(18 Jul '16, 12:42) joost schouppe

Source code available on GitHub .