# dopecarpet
A toolset to generate 4 digit GeoHash tile sized Parquet/GeoJSON/CBOR files from OpenStreetMap PBF files. It comes with a custom tag filter and a minimal GET API to download the data in different formats.
## Dependencies
Installation (Fedora)
```bash
sudo dnf install osmium-tool jq python3-devel pip
pip install quackosm[cli] psycopg2-binary pyosmium geoalchemy2 geojson shapely pygeohash pyarrow pandas click
```
## Basic Use
### 1. Customize Filter
Edit the `tags.json` to specify which OSM tags you want to include in the metadata. This affects what geometries are extracted from the OSM data and has a direct influence on the file sizes.
```json
{
"name:en": true,
"name": true,
"aeroway": true,
"boundary": ["aboriginal_lands", "border_zone", "forest", "hazard", "national_park", "protected_area", "disputed"],
"geological": true,
"highway": ["motorway", "trunk", "primary", "raceway"],
"historic": true,
"landuse": true,
"leisure": ["dog_park", "garden", "miniature_golf", "nature_reserve", "park", "playground", "stadium", "swimming_pool", "water_park"],
"military": ["airfield", "base", "bunker", "barracks", "danger_area", "nuclear_explosion_site", "range", "training_area"],
"natural": true,
"place": ["plot", "farm", "island", "islet", "sea", "ocean"],
"power": ["plant"],
"railway": ["abandoned", "construction", "disused", "rail"],
"tourism": ["attraction", "yes"],
"water": true,
"waterway": true
}
```
### 2. Generate GeoHash Files
This extracts the desired data from the PBF file and generates four digit geohash parquet files in the `geohash/` directory.
```bash
just process