
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
This project is in a usable state on Linux and Mac. The current Export Tool web service repository is at hotosm/osm-export-tool.
This program filters and transforms OpenStreetMap data into thematic, tabular GIS formats. Filtering of features is specified via SQL embedded in a YAML mapping file, for example:
buildings_with_addresses: # creates a thematic layer called "buildings_with_addresses"
types:
- polygons
select:
- building
- height
- addr:housenumber
where:
- building = 'yes' and addr:housenumber IS NOT NULL
It can also create files in non-tabular formats such as those for Garmin GPS devices or the OSMAnd Android app. (coming soon)
pip install osm-export-tool
. Python 3 and a working GDAL installation are required. GDAL can be installed via Homebrew on Mac or the ubuntugis
PPAs on Ubuntu.PyOsmium is used to read OSM files and GDAL/OGR is used to write GIS files, so this program should be reasonably fast and light on memory. There is a built-in OSM reader available for GDAL/OGR, but this program is much more flexible.
This library will not automatically install GDAL because it needs to match the version on your system. You will need to separately run pip install GDAL==2.3.2
(change 2.3.2 to match gdalinfo --version
)
If you want to avoid installing the right version of GDAL on your system you can run the program as a docker container instead.
To build the docker image, use the following command.
docker build -t osm-export-tool .
To run the tool as a container, using your current directory as working directory, use the following command.
docker run -it --rm -v $(pwd):/work osm-export-tool INPUT_FILE.pbf OUTPUT_NAME
osm-export-tool INPUT_FILE.pbf OUTPUT_NAME
will create OUTPUT_NAME.gpkg.
All the below flags are optional.
osm_export_tool/mappings/defaults.yaml
, which is a very broad selection of OSM tags ported from the imposm3 defaults.-f, --formats
: a comma-separated list of formats such as gpkg,shp
. Defaults to just gpkg.--omit-osm-ids
: By default, every table will have an osm_id
column. Relation IDs are negative.--clip <file>
: either a .poly or GeoJSON file.
height > 20
amenity='parking' OR (building = 'yes' and height > 5)
20 < height
building > height
types
key is omitted, it defaults to points
, lines
and polygons
.select
key.where
key is omitted, it defaults to choosing all features where any of the select
ed keys are present.where
is a list of SQL, it is equivalent to joining each SQL in the list with OR
.Maps.ME (coming soon)
OsmAnd (coming soon)
Garmin (coming soon)
FAQs
Convert OpenStreetMap data into GIS and mobile mapping file formats.
We found that osm-export-tool demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.