[OSM-talk] Generate polygons out of administrative Relations

Nic osm at geoworld.de
Thu Dec 28 10:56:34 UTC 2017


ThanksĀ Frederik!

I will giveĀ osm2pgsql a try.
Any recommended URL where I can start reading about the "style file"
approach to only load boundaries?

Nic

Am Donnerstag, den 28.12.2017, 11:19 +0100 schrieb Frederik Ramm:
> Hi,
> 
> On 28.12.2017 10:37, Nic wrote:
> > 
> > I want to generate a polygon out of the different members/ways of
> > an
> > administrative relation (e.g. Bundesland).
> > For that purpose I have loaded a pbf file via osmosis into a
> > postgresql/postgis database.
> That makes things unnecessarily difficult. Use osm2pgsql to load the
> data instead, and the polygons will be built for you. You can even
> use a
> so-called "style file" with osm2pgsql that will only import
> boundaries,
> leaving out roads, buildings etc., which will speed up the process a
> lot.
> 
> > 
> > However it seem that the random order of relation members causes
> > trouble generating a "simplified" (st_linemerge) linestring
> > suitable to
> > apply the st_makepolygon funktion to it.
> If you insist on continuing down your path, then st_polygonize would
> be
> the function to use (it does not depend on the ordering of segments),
> but osm2pgsl is really the better approach because it builds the
> polygons on a "topological" level (using OSM node IDs) instead of on
> the
> geometric level (looking only at coordinates).
> 
> Bye
> Frederik
> 



More information about the talk mailing list