[OSM-talk] Extract a polygon into a polygon filter file format

Jukka Rahkonen jukka.rahkonen at latuviitta.fi
Sat Aug 27 10:45:03 BST 2011


Pieren <pieren3 <at> gmail.com> writes:

> 
> On Fri, Aug 26, 2011 at 2:23 PM, Kirill Bestoujev <bestoujev <at> gmail.com>
wrote:
> > I think it is better to try to persuade
> > mappers from those countries to create the border in way everyone does.
> 
> No. If we created this super-relation in France, it is because the
> original single relation became simply too big for normal editions.
> The country boundary is very long and complex (following natural
> features).
> If you want an approximate polygon, you can download the one published
> by geofabrik for instance. If you want a very precise polygon
> following exactly the border, we have a python script which is doing
> what you want with super-relations. Please contact the french mailing
> list or the french "dev-fr" ML for that.

If relations are such that osm2pgsql can handle them and convert into polygons
it might be easier to catch them from the Mapnik PostGIS schema. For example the
natural=water, name=Saimaa multipolygons (total number or polygons 68, all
together have 4262 holes, one polygon alone has 490 holes in it, and the whole
dataset is having 157551 nodes) can be drawn on a map from with this request

http://188.64.1.61/cgi-bin/ms_ows?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=563&HEIGHT=437&LAYERS=sea,borders,osm_alueet&TRANSPARENT=TRUE&FORMAT=image/png&BBOX=-369151.98300283286,6597900.0,1511076.628895184,8057331.444759207&SRS=EPSG:3067&STYLES=&sql=(tags
@> 'natural=>water') AND (tags @> 'name=>Saimaa')

and data can be downloaded with this

http://188.64.1.61/cgi-bin/ms_ows?service=wfs&version=1.0.0&request=getfeature&typename=osm_alueet&sql=(tags
@> 'natural=>water') AND (tags @> 'name=>Saimaa')

The latter request will take some time, perhaps 30 seconds. 

I suppose this is not yet as easy to do from the native OSM database but for
sure sometimes in the future it will. Some kind of direct access to polygons
would be the first step and there has been some discussion about it in
http://wiki.openstreetmap.org/wiki/Talk:The_Future_of_Areas






More information about the talk mailing list