Update of "spatialite_osm_filter"
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: e48ee31da711c10efbdfa7930e092b27debc954e
Page Name:spatialite_osm_filter
Date: 2012-05-04 16:13:33
Original User: sandro
Parent: 70520a5935783a5da227db3d31cab3bf709194cd (diff)
Content

back to the OSM tools main page

spatialite_osm_filter

Syntax:
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

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

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).

Notes:
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