Small python tool to clip pre-defined areas from the planet osm file.
Project description
OpenStreetMap clipper
Small python tool to clip pre-defined areas from large osm.pbf files, using osmconvert or osmosis.
The tool is at the moment specifically written to split OpenStreetMap Protocolbuffer Binary Format (PBF) files into a set of countries and/or regions, based on the GADM36 classification. Future versions will allow for user-defined regional classifications as well.
Please note: This package is still in development phase. In case of any problems, or if you have any suggestions for improvements, please raise an issue.
Installation
- Open the python environment in your command prompt or bash in which you want to install this package.
- Type
pip install osm-clipper
and it should install itself into your python environment. - Now you can import the package like any other package!
OR:
- Clone the repository or download the package on your computer and extract the folder.
- Go to the osm_clipper folder in your command prompt or bash.
- Type
python setup.py install
and it should install itself into your python environment. - Now you can import the package like any other package!
Dependency on osmcovert or osmosis
In essence, osm_clipper is just a wrapper around osmconvert and osmosis. To make it work, make sure you add either osmconvert or osmosis to your environmental variables.
How to set environmental variables on Windows:
- Search for Edit the System Environmental Variables and click on it.
- Click on the Environmental Variables button.
- Search in your System variables for Path.
- Click on the New button and add the location of osmconvert and/or osmosis.
NOTE: the default is osmconvert. If you want to use osmosis, specify osmconvert==False in the single_countries or all_countries functions.
License
Copyright (C) 2020 Elco Koks. All versions released under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for osm_clipper-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef5dad35592f6f0985d4e9c9440b34148cb44fcd2bf0c7d53f62da1b31d11f3f |
|
MD5 | d5f3237013e3ef5381d4c8b323fad534 |
|
BLAKE2b-256 | 5ccaa104ce54c1401017039e18d8f9c947bda9d0463f6b604acabc4b8b3b4d48 |