QuackOSM Command Line Interface¶
QuackOSM contains a CLI for users convenience. It is not installed by default when installed using pip install quackosm
.
To include the CLI, QuackOSM has to be installed with additional group called cli
: pip install quackosm[cli]
.
CLI is based on the typer
library and exposes almost all of the features implemented in the Python API.
After installation, the QuackOSM
(or quackosm
) command will be available in the shell.
Each command error returns a verbose description what went wrong.
# Extend the default console width from 80 characters
import os
os.environ["COLUMNS"] = "160"
Basic usage¶
By default, the quackosm requires just the path to the PBF
file. Without it, there will be an error.
! QuackOSM
Usage: QuackOSM [OPTIONS] PBF file path Try 'QuackOSM -h' for help. ╭─ Error ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ Missing argument 'PBF file path'. QuackOSM requires either the path to the pbf file, an OSM extract query (--osm-extract-query) or a geometry filter (one of │ │ --geom-filter-bbox, --geom-filter-file, --geom-filter-geocode, --geom-filter-geojson, --geom-filter-index-geohash, --geom-filter-index-h3, │ │ --geom-filter-index-s2, --geom-filter-wkt) to download the file automatically. All three cannot be empty at once. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Let's download a small extract and test the basic usage.
Because we are passing an URL, QuackOSM will download it automatically and save it in the files
directory.
! QuackOSM https://download.geofabrik.de/europe/andorra-latest.osm.pbf
0%| | 0.00/3.07M [00:00<?, ?B/s]
0%| | 8.19k/3.07M [00:00<00:45, 68.0kB/s]
1%|▍ | 36.9k/3.07M [00:00<00:18, 160kB/s]
3%|█▏ | 94.2k/3.07M [00:00<00:10, 289kB/s]
7%|██▋ | 209k/3.07M [00:00<00:05, 523kB/s]
14%|█████▌ | 434k/3.07M [00:00<00:02, 958kB/s]
29%|██████████▉ | 889k/3.07M [00:00<00:01, 1.81MB/s]
59%|█████████████████████▋ | 1.80M/3.07M [00:00<00:00, 3.49MB/s] 0%| | 0.00/3.07M [00:00<?, ?B/s] 100%|█████████████████████████████████████| 3.07M/3.07M [00:00<00:00, 24.4GB/s]
⠋ [ 1/32] Reading nodes • 0:00:00
⠋ [ 2/32] Filtering nodes - intersection • 0:00:00 ⠋ [ 3/32] Filtering nodes - tags • 0:00:00 ⠋ [ 4/32] Calculating distinct filtered nodes ids • 0:00:00
⠙ [ 5/32] Reading ways • 0:00:00
⠋ [ 6/32] Unnesting ways • 0:00:00 ⠋ [ 7/32] Filtering ways - valid refs • 0:00:00 ⠋ [ 8/32] Filtering ways - intersection • 0:00:00 ⠋ [ 9/32] Filtering ways - tags • 0:00:00 ⠋ [ 10/32] Calculating distinct filtered ways ids • 0:00:00
⠋ [ 11/32] Reading relations • 0:00:00
⠋ [ 12/32] Unnesting relations • 0:00:00 ⠋ [ 13/32] Filtering relations - valid refs • 0:00:00 ⠋ [ 14/32] Filtering relations - intersection • 0:00:00 ⠋ [ 15/32] Filtering relations - tags • 0:00:00 ⠋ [ 16/32] Calculating distinct filtered relations ids • 0:00:00 ⠋ [ 17/32] Loading required ways - by relations • 0:00:00 ⠋ [ 18/32] Calculating distinct required ways ids • 0:00:00
⠋ [ 19/32] Saving filtered nodes with geometries • 0:00:00 ⠋ [20.1/32] Grouping filtered ways - assigning groups • 0:00:00
⠧ [20.2/32] Grouping filtered ways - joining with nodes • 0:00:02
⠋ [20.3/32] Grouping filtered ways - partitioning by group • 0:00:00
[ 21/32] Saving filtered ways with linestrings 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/1 • 0:00:01 < 0:00:00 •
⠋ [22.1/32] Grouping required ways - assigning groups • 0:00:00
⠏ [22.2/32] Grouping required ways - joining with nodes • 0:00:01 ⠋ [22.3/32] Grouping required ways - partitioning by group • 0:00:00
[ 23/32] Saving required ways with linestrings 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/1 • 0:00:01 < 0:00:00 •
⠙ [ 24/32] Saving filtered ways with geometries • 0:00:00
⠋ [ 25/32] Saving valid relations parts • 0:00:00 ⠋ [ 26/32] Saving relations inner parts • 0:00:00
⠋ [ 27/32] Saving relations outer parts • 0:00:00
⠋ [ 28/32] Saving relations outer parts with holes • 0:00:00 ⠋ [ 29/32] Saving relations outer parts without holes • 0:00:00
⠋ [ 30/32] Saving filtered relations with geometries • 0:00:00
⠋ [ 31/32] Saving all features • 0:00:00
[ 32/32] Saving final geoparquet file 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4/4 • 0:00:00 < 0:00:00 • Finished operation in 0:00:10 files/andorra-latest_nofilter_noclip_compact.parquet
Second execution of this command will immediately return a path to the previously generated file.
Since the file is already downloaded, we can use it directly.
! QuackOSM files/andorra-latest.osm.pbf
files/andorra-latest_nofilter_noclip_compact.parquet
To force the regeneration of the GeoParquet file, add the --ignore-cache
flag (or --no-cache
) to the command.
! QuackOSM files/andorra-latest.osm.pbf --ignore-cache
⠋ [ 1/32] Reading nodes • 0:00:00 ⠋ [ 2/32] Filtering nodes - intersection • 0:00:00 ⠋ [ 3/32] Filtering nodes - tags • 0:00:00 ⠋ [ 4/32] Calculating distinct filtered nodes ids • 0:00:00
⠙ [ 5/32] Reading ways • 0:00:00
⠋ [ 6/32] Unnesting ways • 0:00:00
⠋ [ 7/32] Filtering ways - valid refs • 0:00:00 ⠋ [ 8/32] Filtering ways - intersection • 0:00:00 ⠋ [ 9/32] Filtering ways - tags • 0:00:00 ⠋ [ 10/32] Calculating distinct filtered ways ids • 0:00:00
⠋ [ 11/32] Reading relations • 0:00:00 ⠋ [ 12/32] Unnesting relations • 0:00:00 ⠋ [ 13/32] Filtering relations - valid refs • 0:00:00 ⠋ [ 14/32] Filtering relations - intersection • 0:00:00
⠋ [ 15/32] Filtering relations - tags • 0:00:00 ⠋ [ 16/32] Calculating distinct filtered relations ids • 0:00:00 ⠋ [ 17/32] Loading required ways - by relations • 0:00:00 ⠋ [ 18/32] Calculating distinct required ways ids • 0:00:00 ⠋ [ 19/32] Saving filtered nodes with geometries • 0:00:00 ⠋ [20.1/32] Grouping filtered ways - assigning groups • 0:00:00
⠏ [20.2/32] Grouping filtered ways - joining with nodes • 0:00:01
⠋ [20.3/32] Grouping filtered ways - partitioning by group • 0:00:00
[ 21/32] Saving filtered ways with linestrings 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/1 • 0:00:01 < 0:00:00 • ⠋ [22.1/32] Grouping required ways - assigning groups • 0:00:00
⠏ [22.2/32] Grouping required ways - joining with nodes • 0:00:01 ⠋ [22.3/32] Grouping required ways - partitioning by group • 0:00:00
[ 23/32] Saving required ways with linestrings 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/1 • 0:00:01 < 0:00:00 •
⠹ [ 24/32] Saving filtered ways with geometries • 0:00:00
⠋ [ 25/32] Saving valid relations parts • 0:00:00 ⠋ [ 26/32] Saving relations inner parts • 0:00:00 ⠋ [ 27/32] Saving relations outer parts • 0:00:00
⠙ [ 28/32] Saving relations outer parts with holes • 0:00:00 ⠋ [ 29/32] Saving relations outer parts without holes • 0:00:00
⠋ [ 30/32] Saving filtered relations with geometries • 0:00:00
⠋ [ 31/32] Saving all features • 0:00:00
[ 32/32] Saving final geoparquet file 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4/4 • 0:00:00 < 0:00:00 • Finished operation in 0:00:07 files/andorra-latest_nofilter_noclip_compact.parquet
Help command¶
To get the full description of all arguments of the QuackOSM command, you can use the --help
(or -h
) parameter.
! QuackOSM --help
Usage: QuackOSM [OPTIONS] PBF file path QuackOSM CLI. Wraps convert_pbf_to_parquet, convert_geometry_to_parquet and convert_osm_extract_to_parquet functions and prints final path to the saved geoparquet file at the end. ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ pbf_file PBF file path PBF file to convert into GeoParquet. Can be an URL. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ --osm-tags-filter TEXT (JSON) OSM tags used to filter the data in the JSON text │ │ form. Can take the form of a flat or grouped dict │ │ (look: OsmTagsFilter and GroupedOsmTagsFilter). │ │ Cannot be used together with osm-tags-filter-file. │ │ --osm-tags-filter-file PATH OSM tags used to filter the data in the JSON file │ │ form. Can take the form of a flat or grouped dict │ │ (look: OsmTagsFilter and GroupedOsmTagsFilter). │ │ Cannot be used together with osm-tags-filter. │ │ --keep-all-tags,--all-tags Whether to keep all tags while filtering with OSM │ │ tags. Doesn't work when there is no OSM tags │ │ filter applied (osm-tags-filter or │ │ osm-tags-filter-file). Will override grouping if │ │ GroupedOsmTagsFilter has been passed as a filter. │ │ --geom-filter-bbox BBOX Geometry to use as a filter in the bounding box │ │ format - 4 floating point numbers separated by │ │ commas. Cannot be used together with other │ │ geom-filter-... parameters. │ │ --geom-filter-file PATH Geometry to use as a filter in the file format - │ │ any that can be opened by GeoPandas. Will return │ │ the unary union of the geometries in the file. │ │ Cannot be used together with other geom-filter-... │ │ parameters. │ │ --geom-filter-geocode TEXT Geometry to use as a filter in the string to │ │ geocode format - it will be geocoded to the │ │ geometry using Nominatim API (GeoPy library). │ │ Cannot be used together with other geom-filter-... │ │ parameters. │ │ --geom-filter-geojson TEXT (GEOJSON) Geometry to use as a filter in the GeoJSON format. │ │ Cannot be used together with other geom-filter-... │ │ parameters. │ │ --geom-filter-index-geohash TEXT (GEOHASH) Geometry to use as a filter in the Geohash index │ │ format. Separate multiple values with a comma. │ │ Cannot be used together with other geom-filter-... │ │ parameters. │ │ --geom-filter-index-h3 TEXT (H3) Geometry to use as a filter in the H3 index │ │ format. Separate multiple values with a comma. │ │ Cannot be used together with other geom-filter-... │ │ parameters. │ │ --geom-filter-index-s2 TEXT (S2) Geometry to use as a filter in the S2 index │ │ format. Separate multiple values with a comma. │ │ Cannot be used together with other geom-filter-... │ │ parameters. │ │ --geom-filter-wkt TEXT (WKT) Geometry to use as a filter in the WKT format. │ │ Cannot be used together with other geom-filter-... │ │ parameters. │ │ --custom-sql-filter TEXT Allows users to pass custom SQL conditions used to │ │ filter OSM features. It will be embedded into │ │ predefined queries and requires DuckDB syntax to │ │ operate on tags map object. │ │ --osm-extract-query TEXT Query to find an OpenStreetMap extract from │ │ available sources. Will automatically find and │ │ download OSM extract. Can be used instead of PBF │ │ file path argument. │ │ --osm-extract-source,--pbf-download-source [any|Geofabrik|osmfr|BBBike] Source where to download the PBF file from. Can be │ │ Geofabrik, BBBike, OSMfr (OpenStreetMap.fr) or │ │ any. │ │ [default: (any)] │ │ --explode-tags,--explode --compact-tags,--compact Whether to split tags into columns based on the │ │ OSM tag keys. If None, it will be set based on the │ │ osm-tags-filter/osm-tags-filter-file and │ │ keep-all-tags parameters. If there is a tags │ │ filter applied without keep-all-tags then it'll be │ │ set to explode-tags (True). Otherwise it'll be set │ │ to compact-tags (False). │ │ --output -o PATH Path where to save final result file. If not │ │ provided, it will be generated automatically based │ │ on the input pbf file name. Can be .parquet or .db │ │ or .duckdb extension. │ │ --duckdb Export to duckdb database. If not provided, data │ │ can still be exported if output has .db or .duckdb │ │ extension. │ │ --duckdb-table-name TEXT Table name which the data will be imported into in │ │ the DuckDB database. │ │ [default: quackosm] │ │ --ignore-cache,--no-cache Whether to ignore previously precalculated │ │ geoparquet files or not. │ │ --working-directory,--work-dir PATH Directory where to save the parsed parquet and │ │ geoparquet files. Will be created if doesn't │ │ exist. │ │ [default: files] │ │ --osm-way-polygon-config PATH Config where alternative OSM way polygon features │ │ config is defined. Will determine how to parse way │ │ features based on tags. Option is intended for │ │ experienced users. It's recommended to disable │ │ cache (no-cache) when using this option, since │ │ file names don't contain information what config │ │ file has been used for file generation. │ │ --filter-osm-ids TEXT List of OSM features IDs to read from the file. │ │ Have to be in the form of 'node/<id>', 'way/<id>' │ │ or 'relation/<id>'. Separate multiple values with │ │ a comma. │ │ --wkt-result,--wkt Whether to save the geometry as a WKT string │ │ instead of WKB blob. │ │ --silent Whether to disable progress reporting. │ │ --transient Whether to make more transient (concise) progress │ │ reporting. │ │ --iou-threshold FLOAT RANGE [0<=x<=1] Minimal value of the Intersection over Union │ │ metric for selecting the matching OSM extracts. Is │ │ best matching extract has value lower than the │ │ threshold, it is discarded (except the first one). │ │ Has to be in range between 0 and 1. Value of 0 │ │ will allow every intersected extract, value of 1 │ │ will only allow extracts that match the geometry │ │ exactly. Works only when PbfFileReader is asked to │ │ download OSM extracts automatically. │ │ [default: 0.01] │ │ --allow-uncovered-geometry Suppresses an error if some geometry parts aren't │ │ covered by any OSM extract. Works only when │ │ PbfFileReader is asked to download OSM extracts │ │ automatically. │ │ --show-extracts,--show-osm-extracts Show available OSM extracts and exit. │ │ --version -v Show the application's version and exit. │ │ --install-completion Install completion for the current shell. │ │ --show-completion Show completion for the current shell, to copy it │ │ or customize the installation. │ │ --help -h Show this message and exit. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Geometry filters¶
QuackOSM can automatically download required PBF files based on multiple geometry filters:
- Text to geocode using Nominatim
- WKT geometry
- GeoJSON geometry
- Geometry file path
- H3 spatial index
- Geohash spatial index
- S2 spatial index
These filters can also be used to filter out geometries from provided pbf file.
QuackOSM
will raise an error if provided geometry has parts without area (such as Points, LineStrings or empty geometry).
Let's see the example based on Monaco region.
First, we will visualise multiple filters on the map.
import geopandas as gpd
from quackosm.cli import (
GeocodeGeometryParser,
GeohashGeometryParser,
GeoJsonGeometryParser,
H3GeometryParser,
S2GeometryParser,
WktGeometryParser,
)
geocode_string = "Monaco-Ville, Monaco"
geojson_string = """{"type":"Feature","geometry":{"coordinates":[[[7.416,43.734],[7.416,43.731],[7.421,43.731],[7.421,43.734],[7.416,43.734]]],"type":"Polygon"}}"""
wkt_string = "POLYGON ((7.414 43.735, 7.414 43.732, 7.419 43.732, 7.419 43.735, 7.414 43.735))"
h3_string = "893969a4037ffff"
geohash_string = "spv2bcs"
s2_string = "12cdc28dc"
geometry_types = ["Geocode", "GeoJSON", "WKT", "H3", "GeoHash", "S2"]
geometries = [
GeocodeGeometryParser().convert(geocode_string),
GeoJsonGeometryParser().convert(geojson_string),
WktGeometryParser().convert(wkt_string),
H3GeometryParser().convert(h3_string),
GeohashGeometryParser().convert(geohash_string),
S2GeometryParser().convert(s2_string),
]
gpd.GeoDataFrame(
data=dict(type=geometry_types),
geometry=geometries,
crs=4326,
).explore(column="type", tiles="CartoDB positron")
Now we will execute each filter and let QuackOSM find required region on its own.
During first execution, QuackOSM will cache three PBF files sources locally. This operation takes some time.
The --silent
flag will disable the progress output to the terminal.
Geocoding¶
! QuackOSM --geom-filter-geocode 'Monaco-Ville, Monaco' --silent --output files/geocode_example.parquet
/home/runner/.local/lib/python3.12/site-packages/pyogrio/geopandas.py:662: UserWarning: 'crs' was not provided. The output dataset will not have projection information defined and may not be usable in other systems. write(
/home/runner/.local/lib/python3.12/site-packages/geopandas/array.py:1638: UserWarning: CRS not set for some of the concatenation inputs. Setting output's CRS as WGS 84 (the single non-null crs provided). return GeometryArray(data, crs=_get_common_crs(to_concat))
0%| | 0.00/549k [00:00<?, ?B/s]
1%|▌ | 8.19k/549k [00:00<00:08, 63.4kB/s]
7%|██▌ | 36.9k/549k [00:00<00:03, 155kB/s]
17%|██████▋ | 94.2k/549k [00:00<00:01, 285kB/s]
38%|███████████████▏ | 209k/549k [00:00<00:00, 519kB/s]
79%|███████████████████████████████▋ | 434k/549k [00:00<00:00, 953kB/s] 0%| | 0.00/549k [00:00<?, ?B/s] 100%|███████████████████████████████████████| 549k/549k [00:00<00:00, 4.94GB/s]
files/geocode_example.parquet
GeoJSON¶
! QuackOSM --geom-filter-geojson '{"type":"Feature","geometry":{"coordinates":[[[7.416,43.734],[7.416,43.731],[7.421,43.731],[7.421,43.734],[7.416,43.734]]],"type":"Polygon"}}' --silent --output files/geojson_example.parquet
files/geojson_example.parquet
Geohash¶
! QuackOSM --geom-filter-index-geohash spv2bcs --silent --output files/geohash_example.parquet
files/geohash_example.parquet
H3¶
! QuackOSM --geom-filter-index-h3 893969a4037ffff --silent --output files/h3_example.parquet
files/h3_example.parquet
S2¶
! QuackOSM --geom-filter-index-s2 12cdc28dc --silent --output files/s2_example.parquet
files/s2_example.parquet
WKT¶
! QuackOSM --geom-filter-wkt 'POLYGON ((7.414 43.735, 7.414 43.732, 7.419 43.732, 7.419 43.735, 7.414 43.735))' --silent --output files/wkt_example.parquet
files/wkt_example.parquet
Plot all results for comparison
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
fig, axs = plt.subplots(2, 3, sharex=True, sharey=True, figsize=(10, 6))
for idx, (geometry_type, geometry) in enumerate(zip(geometry_types, geometries)):
ax = axs[idx // 3, idx % 3]
gdf = gpd.read_parquet(f"files/{geometry_type.lower()}_example.parquet")
gdf.plot(ax=ax, markersize=1, zorder=1, alpha=0.8)
gdf.boundary.plot(ax=ax, markersize=0, zorder=1, alpha=0.8)
gpd.GeoSeries([geometry], crs=4326).plot(
ax=ax,
color=(0, 0, 0, 0),
zorder=2,
hatch="///",
edgecolor="orange",
linewidth=1.5,
)
ax.set_title(geometry_type)
blue_patch = mpatches.Patch(color="C0", alpha=0.8, label="OSM features")
orange_patch = mpatches.Patch(
facecolor=(0, 0, 0, 0), edgecolor="orange", hatch="///", linewidth=1.5, label="Geometry filter"
)
fig.legend(handles=[blue_patch, orange_patch], bbox_to_anchor=(0.98, 0.15))
fig.tight_layout()
OSM extracts¶
QuackOSM automatically downloads best suited OpenStreetMap extract based on geometry filter.
User can also find and download an extract using a text query.
QuackOSM
will raise an error (system exit code 1) if multiple or zero extracts has been matched by the query. Some suggestions might be showed as well.
You can read more about OSM extracts in a dedicated example page.
Info
There are currently 3 sources of OpenStreetMap extracts available in QuackOSM:
- BBBike
- Geofabrik
- OpenStreetMap France
For example, query Monaco
will match both Monaco extracts from Geofabrik and OSM FR.
Searching function will return full names of matched extracts as well as suggestions based on typos.
Those suggestions are sorted from the closest to the query.
Single match¶
Vatican City
extract is available only in a single extracts source - OSM FR.
! QuackOSM --osm-extract-query 'Vatican City' --silent
0%| | 0.00/1.61M [00:00<?, ?B/s]
2%|▋ | 30.7k/1.61M [00:00<00:05, 305kB/s]
5%|█▊ | 75.8k/1.61M [00:00<00:03, 390kB/s]
11%|████ | 170k/1.61M [00:00<00:02, 641kB/s]
21%|███████▉ | 339k/1.61M [00:00<00:01, 1.05MB/s]
33%|████████████▋ | 537k/1.61M [00:00<00:00, 1.39MB/s]
58%|█████████████████████▉ | 931k/1.61M [00:00<00:00, 2.25MB/s] 0%| | 0.00/1.61M [00:00<?, ?B/s] 100%|█████████████████████████████████████| 1.61M/1.61M [00:00<00:00, 13.8GB/s]
files/osmfr_europe_vatican_city_nofilter_noclip_compact.parquet
Multiple matches¶
Monaco
is available both in Geofabrik and OSM FR.
! QuackOSM --osm-extract-query 'Monaco' --silent
Multiple extracts matched by query "Monaco". Matching extracts full names: "geofabrik_europe_monaco", "osmfr_europe_monaco".
To match a single extract, you can use a full name or specify a given extact source.
! QuackOSM --osm-extract-query 'geofabrik_europe_monaco' --silent
files/geofabrik_europe_monaco_nofilter_noclip_compact.parquet
! QuackOSM --osm-extract-query 'Monaco' --osm-extract-source 'Geofabrik' --silent
files/geofabrik_europe_monaco_nofilter_noclip_compact.parquet
Zero matches¶
Typos with suggestions - here we will try to find Portland, but fail at writing it properly 😉
! QuackOSM --osm-extract-query 'Prland' --silent
Zero extracts matched by query "Prland". Found full names close to query: "bbbike_portland", "osmfr_europe_poland", "geofabrik_europe_poland", "geofabrik_europe_united-kingdom_england_rutland", "bbbike_orlando", "osmfr_europe_norway_oppland".
And there might be zero suggestions if nothing close have been matched.
! QuackOSM --osm-extract-query 'Jupiter' --silent
Zero extracts matched by query "Jupiter".
Zero close matches have been found.
Displaying available extracts¶
CLI exposes a dedicated flag --show-extracts
(or --show-osm-extracts
) for display a list of available extracts.
You can read more about it in a dedicated OSM extracts example.
Without providing an OSM extract source (--osm-extract-source
), all sources will be displayed at once.
! QuackOSM --show-extracts --osm-extract-source 'BBBike'
BBBike ├── 🌐 bbbike_aachen (2.14K km²) ├── 🌐 bbbike_aarhus (1.14K km²) ├── 🌐 bbbike_adelaide (795 km²) ├── 🌐 bbbike_albuquerque (734 km²) ├── 🌐 bbbike_alexandria (1.72K km²) ├── 🌐 bbbike_amsterdam (1.62K km²) ├── 🌐 bbbike_antwerpen (1.52K km²) ├── 🌐 bbbike_arnhem (1.22K km²) ├── 🌐 bbbike_auckland (2.91K km²) ├── 🌐 bbbike_augsburg (2.14K km²) ├── 🌐 bbbike_austin (2.92K km²) ├── 🌐 bbbike_baghdad (704 km²) ├── 🌐 bbbike_baku (4.29K km²) ├── 🌐 bbbike_balaton (6.51K km²) ├── 🌐 bbbike_bamberg (2.35K km²) ├── 🌐 bbbike_bangkok (3.07K km²) ├── 🌐 bbbike_barcelona (2.46K km²) ├── 🌐 bbbike_basel (4.15K km²) ├── 🌐 bbbike_beijing (3.27K km²) ├── 🌐 bbbike_beirut (24 km²) ├── 🌐 bbbike_berkeley (1.41K km²) ├── 🌐 bbbike_berlin (5.44K km²) ├── 🌐 bbbike_bern (2.23K km²) ├── 🌐 bbbike_bielefeld (2.38K km²) ├── 🌐 bbbike_birmingham (944 km²) ├── 🌐 bbbike_bochum (1.05K km²) ├── 🌐 bbbike_bogota (644 km²) ├── 🌐 bbbike_bombay (2.48K km²) ├── 🌐 bbbike_bonn (1.89K km²) ├── 🌐 bbbike_bordeaux (1.48K km²) ├── 🌐 bbbike_boulder (838 km²) ├── 🌐 bbbike_brandenburghavel (6.89K km²) ├── 🌐 bbbike_braunschweig (8.08K km²) ├── 🌐 bbbike_bremen (3.01K km²) ├── 🌐 bbbike_bremerhaven (6.76K km²) ├── 🌐 bbbike_brisbane (3.74K km²) ├── 🌐 bbbike_bristol (1.28K km²) ├── 🌐 bbbike_brno (1.17K km²) ├── 🌐 bbbike_bruegge (839 km²) ├── 🌐 bbbike_bruessel (1.29K km²) ├── 🌐 bbbike_budapest (1.8K km²) ├── 🌐 bbbike_buenosaires (3.34K km²) ├── 🌐 bbbike_cairo (659 km²) ├── 🌐 bbbike_calgary (1.54K km²) ├── 🌐 bbbike_cambridge (438 km²) ├── 🌐 bbbike_cambridgema (1.8K km²) ├── 🌐 bbbike_canberra (761 km²) ├── 🌐 bbbike_capetown (1.64K km²) ├── 🌐 bbbike_chemnitz (4.85K km²) ├── 🌐 bbbike_chicago (2.53K km²) ├── 🌐 bbbike_clermontferrand (1.16K km²) ├── 🌐 bbbike_colmar (398 km²) ├── 🌐 bbbike_copenhagen (945 km²) ├── 🌐 bbbike_cork (1.31K km²) ├── 🌐 bbbike_corsica (19.1K km²) ├── 🌐 bbbike_corvallis (671 km²) ├── 🌐 bbbike_cottbus (7.25K km²) ├── 🌐 bbbike_cracow (574 km²) ├── 🌐 bbbike_craterlake (18.3K km²) ├── 🌐 bbbike_curitiba (296 km²) ├── 🌐 bbbike_cusco (4.7K km²) ├── 🌐 bbbike_dallas (1.67K km²) ├── 🌐 bbbike_darmstadt (896 km²) ├── 🌐 bbbike_davis (122 km²) ├── 🌐 bbbike_denhaag (934 km²) ├── 🌐 bbbike_denver (1.19K km²) ├── 🌐 bbbike_dessau (3.35K km²) ├── 🌐 bbbike_dortmund (556 km²) ├── 🌐 bbbike_dresden (2.05K km²) ├── 🌐 bbbike_dublin (1.39K km²) ├── 🌐 bbbike_duesseldorf (1.54K km²) ├── 🌐 bbbike_duisburg (1.25K km²) ├── 🌐 bbbike_edinburgh (2.26K km²) ├── 🌐 bbbike_eindhoven (947 km²) ├── 🌐 bbbike_emden (5.94K km²) ├── 🌐 bbbike_erfurt (1.41K km²) ├── 🌐 bbbike_erlangen (1.23K km²) ├── 🌐 bbbike_eugene (498 km²) ├── 🌐 bbbike_flensburg (2.34K km²) ├── 🌐 bbbike_fortcollins (406 km²) ├── 🌐 bbbike_frankfurt (2.17K km²) ├── 🌐 bbbike_frankfurtoder (6.84K km²) ├── 🌐 bbbike_freiburg (3.25K km²) ├── 🌐 bbbike_gdansk (1.49K km²) ├── 🌐 bbbike_genf (2.37K km²) ├── 🌐 bbbike_gent (842 km²) ├── 🌐 bbbike_gera (4.53K km²) ├── 🌐 bbbike_glasgow (981 km²) ├── 🌐 bbbike_gliwice (628 km²) ├── 🌐 bbbike_goerlitz (5.53K km²) ├── 🌐 bbbike_goeteborg (933 k
m²) ├── 🌐 bbbike_goettingen (3.1K km²) ├── 🌐 bbbike_graz (9.77K km²) ├── 🌐 bbbike_groningen (1.21K km²) ├── 🌐 bbbike_halifax (321 km²) ├── 🌐 bbbike_halle (4.61K km²) ├── 🌐 bbbike_hamburg (4.69K km²) ├── 🌐 bbbike_hamm (1.57K km²) ├── 🌐 bbbike_hannover (4.41K km²) ├── 🌐 bbbike_heilbronn (3.22K km²) ├── 🌐 bbbike_helsinki (963 km²) ├── 🌐 bbbike_hertogenbosch (98 km²) ├── 🌐 bbbike_huntsville (1.81K km²) ├── 🌐 bbbike_innsbruck (1.51K km²) ├── 🌐 bbbike_istanbul (2.11K km²) ├── 🌐 bbbike_jena (2.16K km²) ├── 🌐 bbbike_jerusalem (221 km²) ├── 🌐 bbbike_johannesburg (4.15K km²) ├── 🌐 bbbike_kaiserslautern (3.45K km²) ├── 🌐 bbbike_karlsruhe (3.43K km²) ├── 🌐 bbbike_kassel (1.23K km²) ├── 🌐 bbbike_katowice (799 km²) ├── 🌐 bbbike_kaunas (833 km²) ├── 🌐 bbbike_kiel (3.15K km²) ├── 🌐 bbbike_kiew (1.47K km²) ├── 🌐 bbbike_koblenz (3.39K km²) ├── 🌐 bbbike_koeln (2.56K km²) ├── 🌐 bbbike_konstanz (4.47K km²) ├── 🌐 bbbike_lapaz (2.74K km²) ├── 🌐 bbbike_laplata (2.23K km²) ├── 🌐 bbbike_lakegarda (5.96K km²) ├── 🌐 bbbike_lausanne (1.82K km²) ├── 🌐 bbbike_leeds (1.03K km²) ├── 🌐 bbbike_leipzig (4.26K km²) ├── 🌐 bbbike_lima (6.07K km²) ├── 🌐 bbbike_linz (2.48K km²) ├── 🌐 bbbike_lisbon (5.33K km²) ├── 🌐 bbbike_liverpool (1.82K km²) ├── 🌐 bbbike_ljubljana (1.5K km²) ├── 🌐 bbbike_lodz (1.38K km²) ├── 🌐 bbbike_london (3.31K km²) ├── 🌐 bbbike_losangeles (2.56K km²) ├── 🌐 bbbike_luebeck (3.51K km²) ├── 🌐 bbbike_luxemburg (7.3K km²) ├── 🌐 bbbike_lyon (1.6K km²) ├── 🌐 bbbike_maastricht (1.09K km²) ├── 🌐 bbbike_madison (684 km²) ├── 🌐 bbbike_madrid (3.8K km²) ├── 🌐 bbbike_magdeburg (2.14K km²) ├── 🌐 bbbike_mainz (3.36K km²) ├── 🌐 bbbike_malmoe (4.09K km²) ├── 🌐 bbbike_manchester (1.83K km²) ├── 🌐 bbbike_mannheim (3.35K km²) ├── 🌐 bbbike_marseille (1.19K km²) ├── 🌐 bbbike_melbourne (2.97K km²) ├── 🌐 bbbike_memphis (2.94K km²) ├── 🌐 bbbike_mexicocity (767 km²) ├── 🌐 bbbike_miami (63 km²) ├── 🌐 bbbike_minsk (1.47K km²) ├── 🌐 bbbike_moenchengladbach (3.43K km²) ├── 🌐 bbbike_montevideo (4.07K km²) ├── 🌐 bbbike_montpellier (1.77K km²) ├── 🌐 bbbike_montreal (3.2K km²) ├── 🌐 bbbike_moscow (1.37K km²) ├── 🌐 bbbike_muenchen (4.83K km²) ├── 🌐 bbbike_muenster (1.59K km²) ├── 🌐 bbbike_newdelhi (1.69K km²) ├── 🌐 bbbike_neworleans (8.01K km²) ├── 🌐 bbbike_newyork (3.11K km²) ├── 🌐 bbbike_nuernberg (4.58K km²) ├── 🌐 bbbike_oldenburg (4.71K km²) ├── 🌐 bbbike_oranienburg (13.2K km²) ├── 🌐 bbbike_orlando (3.34K km²) ├── 🌐 bbbike_oslo (1.27K km²) ├── 🌐 bbbike_osnabrueck (1.37K km²) ├── 🌐 bbbike_ostrava (1.21K km²) ├── 🌐 bbbike_ottawa (1.53K km²) ├── 🌐 bbbike_paderborn (2.34K km²) ├── 🌐 bbbike_palma (8.68K km²) ├── 🌐 bbbike_paloalto (1.08K km²) ├── 🌐 bbbike_paris (2.23K km²) ├── 🌐 bbbike_perth (2.89K km²) ├── 🌐 bbbike_philadelphia (814 km²) ├── 🌐 bbbike_phnompenh (338 km²) ├── 🌐 bbbike_portland (1.85K km²) ├── 🌐 bbbike_portlandme (1.73K km²) ├── 🌐 bbbike_porto (3.01K km²) ├── 🌐 bbbike_portoalegre (492 km²) ├── 🌐 bbbike_potsdam (5.46K km²) ├── 🌐 bbbike_poznan (1.45K km²) ├── 🌐 bbbike_prag (1.18K km²) ├── 🌐 bbbike_providence (325 km²) ├── 🌐 bbbike_regensburg (2.34K km²) ├── 🌐 bbbike_riga (1.25K km²) ├── 🌐 bbbike_riodejaneiro (3.75K km²) ├── 🌐 bbbike_rostock (5.69K km²) ├── 🌐 bbbike_rotterdam (1.13K km²) ├── 🌐 bbbike_ruegen (4.65K km²) ├── 🌐 bbbike_saarbruecken (3.37K km²) ├── 🌐 bbbike_sacramento (1.72K km²) ├── 🌐 bbbike_saigon (863 km²) ├── 🌐 bbbike_salzburg (4.92K km²) ├── 🌐 bbbike_sanfrancisco (839 km²) ├── 🌐 bbbike_sanjose (91 km²) ├── 🌐 bbbike_sanktpetersburg (992 km²) ├── 🌐 bbbike_santabarbara (326 km²) ├── 🌐 bbbike_santacruz (3.87K km²) ├── 🌐 bbbike_santiago (2.73K km²) ├── 🌐 bbbike_sarajewo (425 km²) ├── 🌐 bbbike_schwerin (3.41K km²) ├── 🌐 bbbike_seattle (1.66K km²) ├── 🌐 bbbike_seoul (2.65K km²) ├── 🌐 bbbike_sheffield (44 km²) ├── 🌐 bbbike_singapore (1.27K km²) ├── 🌐 bbbike_sofia (983 km²) ├── 🌐 bbbike_stockholm (3.04K km²) ├── 🌐 bbbike_stockton (1.62K km²) ├── 🌐 bbbike_strassburg (1.17K km²) ├── 🌐 bbbike_stuttgart (2.73K km²) ├── 🌐 bbbike_sucre (1.02K km²) ├── 🌐 bbbike_sydney (1.95K km²) ├── 🌐 bbbike_szczecin (939 km²) ├── 🌐 bbbike_tallinn (1.19K km²) ├── 🌐 bbbike_tehran (59 km²) ├── 🌐 bbbike_tilburg (557 km²) ├── 🌐 bbbike_tokyo (729 km²) ├── 🌐 bbbike_toronto (3.11K km²) ├── 🌐 bbbike_toulouse (1.32K km²) ├── 🌐 bbbike_trondheim (521 km²) ├── 🌐 bbbike_tucson (986 km²) ├── 🌐 bbbike_turin (1.18K km²) ├── 🌐 bbbike_ulanbator (44.9 km²) ├── 🌐 bbbike_ulm (3.47K km²) ├── 🌐 bbbike_usedom (8.7K km²) ├── 🌐 bbbike_utrecht (2.23K km²) ├── 🌐 bbbike_vancouver (2.18K km²) ├── 🌐 bbbike_victoria (84 km²) ├── 🌐 bbbike_warenmueritz (12.1K km²) ├── 🌐 bbbike_warsaw (2.37K km²) ├── 🌐 bbbike_washingtondc (1.01K km²) ├── 🌐 bbbike_waterloo (1.51K km²) ├── 🌐 bbbike_wien (4.44K km²) ├── 🌐 bbbike_wroclaw (823 km²) ├── 🌐 bbbike_wuerzburg (6.2K km²) ├── 🌐 bbbike_wuppertal (1.8K km²) ├── 🌐 bbbike_zagreb (1.21K km²) └── 🌐 bbbike_zuerich (2.19K km²)
OSM tags filters¶
By default, QuackOSM parses all of the features (nodes, ways, relations) from the *.osm.pbf
file with tags attached.
Hovewer, there is also an option to pass an OSM tags filter in the form of JSON string or path to the JSON file.
OSM tags filter logic is based on the filter from the OSMnx
library.
Filter is expected to be in the form of dictionary with keys
as string and values
as one of the types: string, list of strings or bool value. Full tutorial for OSM tags filters can be accessed here.
Example filters:
- All of the buildings
{ "building": true }
- Parkings and offices
{ "amenity": "parking", "building": "office" }
- General shops
{ "shop": [ "convenience", "department_store", "general", "kiosk", "mall", "supermarket", "wholesale" ] }
Tags filters can be used together with geometry filters to get specific features from the area of interest.
Info
By default, without any tags filters, QuackOSM returns all of the tags of the feature grouped as a single column: tags.
With tags filter, result file will keep the used in the filter and keep each tag key as a separate column.
To keep all tags while filtering the file, use --keep-all-tags flag.
! QuackOSM files/andorra-latest.osm.pbf --osm-tags-filter '{ "building": true }'
⠋ [ 1/32] Reading nodes • 0:00:00 ⠋ [ 2/32] Filtering nodes - intersection • 0:00:00 ⠋ [ 3/32] Filtering nodes - tags • 0:00:00 ⠋ [ 4/32] Calculating distinct filtered nodes ids • 0:00:00
⠋ [ 5/32] Reading ways • 0:00:00
⠋ [ 6/32] Unnesting ways • 0:00:00
⠋ [ 7/32] Filtering ways - valid refs • 0:00:00 ⠋ [ 8/32] Filtering ways - intersection • 0:00:00 ⠋ [ 9/32] Filtering ways - tags • 0:00:00 ⠋ [ 10/32] Calculating distinct filtered ways ids • 0:00:00
⠋ [ 11/32] Reading relations • 0:00:00 ⠋ [ 12/32] Unnesting relations • 0:00:00
⠋ [ 13/32] Filtering relations - valid refs • 0:00:00 ⠋ [ 14/32] Filtering relations - intersection • 0:00:00 ⠋ [ 15/32] Filtering relations - tags • 0:00:00 ⠋ [ 16/32] Calculating distinct filtered relations ids • 0:00:00 ⠋ [ 17/32] Loading required ways - by relations • 0:00:00 ⠋ [ 18/32] Calculating distinct required ways ids • 0:00:00 ⠋ [ 19/32] Saving filtered nodes with geometries • 0:00:00 ⠋ [20.1/32] Grouping filtered ways - assigning groups • 0:00:00
⠏ [20.2/32] Grouping filtered ways - joining with nodes • 0:00:01
⠋ [20.3/32] Grouping filtered ways - partitioning by group • 0:00:00
[ 21/32] Saving filtered ways with linestrings 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/1 • 0:00:01 < 0:00:00 • ⠋ [22.1/32] Grouping required ways - assigning groups • 0:00:00
⠏ [22.2/32] Grouping required ways - joining with nodes • 0:00:01 ⠋ [22.3/32] Grouping required ways - partitioning by group • 0:00:00
[ 23/32] Saving required ways with linestrings 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/1 • 0:00:01 < 0:00:00 •
⠋ [ 24/32] Saving filtered ways with geometries • 0:00:00
⠋ [ 25/32] Saving valid relations parts • 0:00:00 ⠋ [ 26/32] Saving relations inner parts • 0:00:00 ⠋ [ 27/32] Saving relations outer parts • 0:00:00 ⠋ [ 28/32] Saving relations outer parts with holes • 0:00:00 ⠋ [ 29/32] Saving relations outer parts without holes • 0:00:00 ⠋ [ 30/32] Saving filtered relations with geometries • 0:00:00
⠋ [ 31/32] Saving all features • 0:00:00 [ 32/32] Saving final geoparquet file 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4/4 • 0:00:00 < 0:00:00 • Finished operation in 0:00:06 files/andorra-latest_ae99e3d94b104c32f569e07bbca0718664a35b810b85c9d092c1e9221f26aa22_noclip_exploded.parquet
Keeping tags compact or separate¶
QuackOSM can keep tags in the compact form (as a single column named tags
) or wide form (each tag key as separate column).
If not set by the user, it will change depending on the presence of tags filter:
- without tags filter: tags kept together as a sinlge column
- with tags filter: tags split into separate columns
User can force one of those two behaviours regardless of osm tags filter being present or not:
--explode-tags
(or--explode
): will always split tags into separate columns, sometimes resulting in hundreds or event thousands of columns in the result file.--compact-tags
(or--compact
): will always keep tags together as a single column.
Separated tags¶
Flag --explode
! QuackOSM files/andorra-latest.osm.pbf --osm-tags-filter '{ "amenity": "parking", "building": "office" }' --explode --output files/andorra_filtered_exploded.parquet --silent
files/andorra_filtered_exploded.parquet
! ./duckdb :memory: "FROM read_parquet('files/andorra_filtered_exploded.parquet')"
┌───────────────────┬─────────┬──────────┬─────────────────────────────────────┐ │ feature_id │ amenity │ building │ geometry │ │ varchar │ varchar │ varchar │ geometry │ ├───────────────────┼─────────┼──────────┼─────────────────────────────────────┤ │ node/7091319015 │ parking │ │ POINT (1.5230608 42.5067077) │ │ node/10098178397 │ parking │ │ POINT (1.5832823 42.5362953) │ │ node/11168194614 │ parking │ │ POINT (1.4199497 42.5464181) │ │ node/11168201642 │ parking │ │ POINT (1.5749946 42.5638175) │ │ node/11407308612 │ parking │ │ POINT (1.4914621 42.4373972) │ │ node/11425467759 │ parking │ │ POINT (1.6384293 42.5810699) │ │ node/442879444 │ parking │ │ POINT (1.5236629 42.5435671) │ │ node/442881998 │ parking │ │ POINT (1.5145288 42.5468042) │ │ node/3600721792 │ parking │ │ POINT (1.5233613 42.5095249) │ │ way/1059734587 │ parking │ │ POLYGON ((1.5476384 42.5109029, 1… │ │ way/1059803907 │ parking │ │ POLYGON ((1.541195 42.5111152, 1.… │ │ way/1059803919 │ parking │ │ POLYGON ((1.5404288 42.5111142, 1… │ │ way/1059810436 │ parking │ │ POLYGON ((1.5401372 42.5116091, 1… │ │ way/1059810441 │ parking │ │ POLYGON ((1.5385785 42.5116973, 1… │ │ way/1060048141 │ parking │ │ POLYGON ((1.5368414 42.5129991, 1… │ │ way/1060398762 │ parking │ │ POLYGON ((1.5367709 42.5091895, 1… │ │ way/1060471703 │ parking │ │ POLYGON ((1.5479665 42.5092989, 1… │ │ way/1060494204 │ parking │ │ POLYGON ((1.5481956 42.508005, 1.… │ │ way/1073293262 │ parking │ │ POLYGON ((1.4966988 42.6282373, 1… │ │ way/1073293263 │ parking │ │ POLYGON ((1.4949347 42.6284296, 1… │ │ · │ · │ · │ · │ │ · │ · │ · │ · │ │ · │ · │ · │ · │ │ way/512761608 │ parking │ │ POLYGON ((1.538993 42.5081254, 1.… │ │ way/512798893 │ parking │ │ POLYGON ((1.5338687 42.512687, 1.… │ │ way/516775883 │ parking │ │ POLYGON ((1.7360303 42.5436696, 1… │ │ way/517836383 │ parking │ │ POLYGON ((1.53264 42.556084, 1.53… │ │ way/542627593 │ parking │ │ POLYGON ((1.5981013 42.565526, 1.… │ │ way/547231008 │ parking │ │ POLYGON ((1.4889464 42.4768151, 1… │ │ way/547248796 │ parking │ │ POLYGON ((1.4916229 42.4742377, 1… │ │ way/565487439 │ parking │ │ POLYGON ((1.5484362 42.5078799, 1… │ │ way/565489577 │ parking │ │ POLYGON ((1.5204385 42.5050388, 1… │ │ way/488724547 │ parking │ │ POLYGON ((1.4520821 42.474611, 1.… │ │ way/558590853 │ │ office │ POLYGON ((1.5427063 42.5092394, 1… │ │ way/558591064 │ parking │ │ POLYGON ((1.5428323 42.5132163, 1… │ │ node/1922608179 │ parking │ │ POINT (1.5916925 42.5400579) │ │ node/1933942547 │ parking │ │ POINT (1.5876803 42.5354027) │ │ node/2966839661 │ parking │ │ POINT (1.5154836 42.5448509) │ │ node/8964053327 │ parking │ │ POINT (1.6691093 42.5759698) │ │ node/8968430428 │ parking │ │ POINT (1.5308996 42.5087236) │ │ node/12137379578 │ parking │ │ POINT (1.5981086 42.5655227) │ │ relation/7947925 │ parking │ │ POLYGON ((1.5193453 42.4356578, 1… │ │ relation/15665695 │ parking │ │ POLYGON ((1.5310421 42.5119889, 1… │ ├───────────────────┴─────────┴──────────┴─────────────────────────────────────┤ │ 394 rows (40 shown) 4 columns │ └──────────────────────────────────────────────────────────────────────────────┘
Compact tags¶
Flag --compact
! QuackOSM files/andorra-latest.osm.pbf --osm-tags-filter '{ "amenity": "parking", "building": "office" }' --compact --output files/andorra_filtered_compact.parquet --silent
files/andorra_filtered_compact.parquet
! ./duckdb :memory: "FROM read_parquet('files/andorra_filtered_compact.parquet')"
┌───────────────────┬──────────────────────┬───────────────────────────────────┐ │ feature_id │ tags │ geometry │ │ varchar │ map(varchar, varch… │ geometry │ ├───────────────────┼──────────────────────┼───────────────────────────────────┤ │ node/12137379578 │ {amenity=parking} │ POINT (1.5981086 42.5655227) │ │ node/1922608179 │ {amenity=parking} │ POINT (1.5916925 42.5400579) │ │ node/1933942547 │ {amenity=parking} │ POINT (1.5876803 42.5354027) │ │ node/2966839661 │ {amenity=parking} │ POINT (1.5154836 42.5448509) │ │ node/894263141 │ {amenity=parking} │ POINT (1.6072153 42.5708288) │ │ node/3662672002 │ {amenity=parking} │ POINT (1.5207317 42.5059069) │ │ node/4354246974 │ {amenity=parking} │ POINT (1.522799 42.507504) │ │ way/1059734587 │ {amenity=parking} │ POLYGON ((1.5476384 42.5109029,… │ │ way/1059803907 │ {amenity=parking} │ POLYGON ((1.541195 42.5111152, … │ │ way/1059803919 │ {amenity=parking} │ POLYGON ((1.5404288 42.5111142,… │ │ way/1059810436 │ {amenity=parking} │ POLYGON ((1.5401372 42.5116091,… │ │ way/1059810441 │ {amenity=parking} │ POLYGON ((1.5385785 42.5116973,… │ │ way/1060048141 │ {amenity=parking} │ POLYGON ((1.5368414 42.5129991,… │ │ way/1060398762 │ {amenity=parking} │ POLYGON ((1.5367709 42.5091895,… │ │ way/1060471703 │ {amenity=parking} │ POLYGON ((1.5479665 42.5092989,… │ │ way/1060494204 │ {amenity=parking} │ POLYGON ((1.5481956 42.508005, … │ │ way/1073293262 │ {amenity=parking} │ POLYGON ((1.4966988 42.6282373,… │ │ way/1073293263 │ {amenity=parking} │ POLYGON ((1.4949347 42.6284296,… │ │ way/1074662730 │ {amenity=parking} │ POLYGON ((1.4792778 42.5379586,… │ │ way/1074665013 │ {amenity=parking} │ POLYGON ((1.6652299 42.5867934,… │ │ · │ · │ · │ │ · │ · │ · │ │ · │ · │ · │ │ way/477675391 │ {amenity=parking} │ POLYGON ((1.516324 42.5328644, … │ │ way/512761597 │ {building=office} │ POLYGON ((1.534242 42.5082595, … │ │ way/512761608 │ {amenity=parking} │ POLYGON ((1.538993 42.5081254, … │ │ way/512798893 │ {amenity=parking} │ POLYGON ((1.5338687 42.512687, … │ │ way/516775883 │ {amenity=parking} │ POLYGON ((1.7360303 42.5436696,… │ │ way/517836383 │ {amenity=parking} │ POLYGON ((1.53264 42.556084, 1.… │ │ way/542627593 │ {amenity=parking} │ POLYGON ((1.5981013 42.565526, … │ │ way/547231008 │ {amenity=parking} │ POLYGON ((1.4889464 42.4768151,… │ │ way/547248796 │ {amenity=parking} │ POLYGON ((1.4916229 42.4742377,… │ │ way/565487439 │ {amenity=parking} │ POLYGON ((1.5484362 42.5078799,… │ │ way/565489577 │ {amenity=parking} │ POLYGON ((1.5204385 42.5050388,… │ │ way/488724547 │ {amenity=parking} │ POLYGON ((1.4520821 42.474611, … │ │ way/558590853 │ {building=office} │ POLYGON ((1.5427063 42.5092394,… │ │ way/558591064 │ {amenity=parking} │ POLYGON ((1.5428323 42.5132163,… │ │ node/3928793753 │ {amenity=parking} │ POINT (1.5981013 42.565526) │ │ node/6398374422 │ {amenity=parking} │ POINT (1.5192594 42.5076271) │ │ node/6586256024 │ {amenity=parking} │ POINT (1.5408996 42.5493517) │ │ node/7091319015 │ {amenity=parking} │ POINT (1.5230608 42.5067077) │ │ relation/7947925 │ {amenity=parking} │ POLYGON ((1.5193453 42.4356578,… │ │ relation/15665695 │ {amenity=parking} │ POLYGON ((1.5310421 42.5119889,… │ ├───────────────────┴──────────────────────┴───────────────────────────────────┤ │ 394 rows (40 shown) 3 columns │ └──────────────────────────────────────────────────────────────────────────────┘
WKT mode¶
By default, QuackOSM saves parsed files in the GeoParquet
format with the geometry in the WKB
format.
There is also an option to save the file as a Parquet
file with the geometry in the WKT
format using --wkt-result
(or --wkt
) parameter.
! QuackOSM files/andorra-latest.osm.pbf --wkt-result --silent
files/andorra-latest_nofilter_noclip_compact_wkt.parquet
! ./duckdb :memory: "FROM read_parquet('files/andorra-latest_nofilter_noclip_compact_wkt.parquet')"
Not implemented Error: Unsupported geometry encoding