Not logged in

back to the OSM tools main page


usage: spatialite_osm_filter ARGLIST
-h or --help                    print this help message
-o or --osm-path pathname       the OSM-XML (output) file path
-w or --wkt-mask-path pathname  path of text file (WKT mask)
-d or --db-path  pathname       the SpatiaLite DB path

you can specify the following options as well
-cs or --cache-size    num      DB cache size (how many pages)
-m or --in-memory               using IN-MEMORY database
-jo or --journal-off            unsafe (but faster) mode

$ spatialite_osm_filter -o filtered.osm -d my_country.sqlite -w my_mask.txt
SQLite version: 3.7.11
SpatiaLite version: 3.1.0

the above shown command must be invoked from the shell:
WKT mask file:
POLYGON((11.05 43.81, 11.08 43.81, 11.08 43.84, 11.05 43.84, 11.05 43.81))
This file is expected to simply contain a valid WKT expression representing a Geometry of the POLYGON or a MULTIPOLYGON type.
In this example we've used a very simple square shape, but you can actually pass any arbitrary areal geometry (e.g. a complex administrative boundary defined by many thousand points, eventually containing internal holes and separate islands).

Any Map object stored within the DB-file will be exported if (and only if) at least one of its OSM-Nodes overlaps the given mask. OSM-Ways and OSM-Relations are never split / trucated: if a single OSM-Node referenced by a Way/Relation matches the given mask, then the whole Way/Relation will be exported, including any other Node falling outside the mask.
Once the command succesfully completes its execution, you'll find a brand new OSM-XML file representing the spatially filtered output of the process.

back to the OSM tools main page