DE:Osmosis/Polygon Filter File Format

From OpenStreetMap Wiki
Jump to: navigation, search
Help
Verfügbare Sprachen
Deutsch English

Das Osmosis polygon filter file format wird unterstützt von Osmosis, osmchange, pbftoosm and osmconvert. Es ermöglicht die Definition von unregelmäßigen Flächen.

For OSM Polygons, see Multipolygon relation.

Contents

Beispiel

australia_v
1
     0.1446763E+03    -0.3825659E+02
     0.1446693E+03    -0.3826255E+02
     0.1446627E+03    -0.3825661E+02
     0.1446763E+03    -0.3824465E+02
     0.1446813E+03    -0.3824343E+02
     0.1446824E+03    -0.3824484E+02
     0.1446826E+03    -0.3825356E+02
     0.1446876E+03    -0.3825210E+02
     0.1446919E+03    -0.3824719E+02
     0.1447006E+03    -0.3824723E+02
     0.1447042E+03    -0.3825078E+02
     0.1446758E+03    -0.3826229E+02
     0.1446693E+03    -0.3826255E+02
END
!2
     0.1422483E+03    -0.3839481E+02
     0.1422436E+03    -0.3839315E+02
     0.1422496E+03    -0.3839070E+02
     0.1422543E+03    -0.3839025E+02
     0.1422574E+03    -0.3839155E+02
     0.1422467E+03    -0.3840065E+02
     0.1422433E+03    -0.3840048E+02
     0.1422420E+03    -0.3839857E+02
     0.1422436E+03    -0.3839315E+02
END
END

Bounding-polygon task

Diese Beispiele zeigen, wie eine Fläche mit Hilfe einer als Polygon-Datei abgespeicherte Flächendefinition ausgeschnitten wird. In den Beispielen heißt die Polygon-Datei country.poly. Sie ist mit allen genannten Programmen kompatibel. Nur der Aufruf in den verschiedenen Programmen variiert.

Beispiel für Osmosis:

osmosis --read-xml file="planet-latest.osm" --bounding-polygon file="country.poly" --write-xml file="australia.osm"

Beispiel für osmchange (program):

cat planet-latest.osm | osmchange -B=country.poly >australia.osm

Beispiel für pbftoosm:

pbftoosm -i=europe.osm.pbf -B=country.poly >switzerland.osm

Beispiel für osmconvert:

osmconvert europe.osm.pbf -B=country.poly --out-o5m >switzerland.o5m

Details zum Osmosis-Code siehe hier:

http://svn.openstreetmap.org/applications/utils/osmosis/trunk/areafilter/src/org/openstreetmap/osmosis/areafilter/common/PolygonFileReader.java

Bezugsquellen für Polygon-Dateien

Basic outline polygons für Länder sind erhältlich auf http://www.naturalearthdata.com/ Digital Charts of the World server
Klicke Dich auf dieser Seite durch zu "Downloads". Dort findest Du drei Einstiege zu Polygon-Dateien und die Beschreibung des Datei-Formates. Du kannst wählen zwischen hoher, mittlerer und niedriger Auflösung.

CloudMade bietet Polygon-Dateien für Länder im Rahmen ihres Download-Service: http://downloads.cloudmade.com/ These are not straightforward outline polygons. Instead each file is a series of rectangular polygons which overall covers the area of the country (useful for use with Osmosis in splitting data into manageable chunks)

Einige Dateien für Deutschland und Österreich im SVN-Format gibt es hier: http://trac.openstreetmap.org/browser/applications/utils/osm-extract/polygons

Dateien für Rußland und russische first level administative regions (buffered and not) sowie einigen Nachbarländern gibt es hier (also includes the description for QGIS extension to generate such files): http://gis-lab.info/qa/osm-poly.html (RU)

Ein kleines Tool, das die Erstellung eigener Polygone erleichtert wird hier zur Verfügung gestellt: http://www.geocaching-dresden.de/tools/gpx-to-poly/

Converting To/From OSM Format

Should you wish to convert a Polygon file to/from an OSM way (to use as a nice boundary on a printed map, for example, or to create and edit polygons in an OSM editor like JOSM) you can find the 'osm2poly.pl' and 'poly2osm.pl' tools here:

Buffering the Polygon file

In case you would like to use a Polygon file of an area with a certain buffer distance, it is possible to use the tool 'polybuffer.py', which can be found here: [1]. For the buffering PostGIS is being used. Requirements:

The instructions can be read by typing "./polybuffer -h" on the command prompt.

Personal tools
Namespaces
Variants
Actions
site
Toolbox