[OSM-talk] Generate polygons out of administrative Relations
Frederik Ramm
frederik at remote.org
Thu Dec 28 10:19:20 UTC 2017
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
--
Frederik Ramm ## eMail frederik at remote.org ## N49°00'09" E008°23'33"
More information about the talk
mailing list