HUB
Sign inSign up
db-osm-us logo

baseshift/db-osm-us

By baseshift

•Updated 19 days ago

OpenStreetMap United States in PostGIS, ready to query. Data © OpenStreetMap contributors, ODbL.

Image
Data science
Databases & storage
0

365

baseshift/db-osm-us repository overview

⁠OpenStreetMap United States — PostGIS, ready to query

Map data © OpenStreetMap contributors⁠, available under the Open Database License (ODbL) 1.0⁠. The OpenStreetMap data in this image belongs to its contributors. This image is a derivative database offered under the ODbL. Baseshift is not affiliated with or endorsed by the OpenStreetMap Foundation.

Packaged by Baseshift⁠: database clones for developers that start in seconds.

The full osm2pgsql import of the United States: a 242 GB PostgreSQL database in a 29.6 GB download. Skip the import: pull it, start it, and query.

⁠Quick start

docker run -d -p 127.0.0.1:5432:5432 baseshift/db-osm-us
psql -h localhost -U postgres -d osm_us_261025
  • No password is needed. Binding to 127.0.0.1 keeps the database reachable only from your own machine.
  • Startup takes about 10–20 seconds.
  • You need about 30 GB of free disk. Docker's containerd image store keeps both the download and the unpacked copy, so allow up to ~60 GB there.
  • Parallel query is off by default. For large scans, run SET max_parallel_workers_per_gather = 4; first.

Example: count the buildings in central San Francisco.

SELECT count(*)
FROM planet_osm_polygon
WHERE building IS NOT NULL
  AND way && ST_Transform(ST_MakeEnvelope(-122.52, 37.70, -122.35, 37.82, 4326), 3857);

⁠What's inside

  • Data: the Geofabrik⁠ United States extract us-261025.osm.pbf, replication timestamp 2026-10-25T21:21:21Z (sequence 2423).
    • sha256 1b127070917e2f4e5d9e778e2412bb44d24116519cf084ab72fe13e679eb11ff
  • Import: osm2pgsql 1.11.0, --create --slim --hstore, default style. Geometries are in EPSG:3857.
    • Tables: planet_osm_point, planet_osm_line, planet_osm_polygon, planet_osm_roads, plus the slim planet_osm_nodes, planet_osm_ways and planet_osm_rels.
    • osm2pgsql_properties records the replication URL and updatable=true. osm2pgsql-replication update is untested.
  • Software: PostgreSQL 17.11, PostGIS 3.6.4 and hstore, on the official postgres:17.11 image. Both linux/amd64 and linux/arm64 (Apple Silicon) are supported.
  • Storage: Baseshift dc1 compression.
    • Each 8 KB page is compressed on its own and decompressed when PostgreSQL reads it, so nothing is unpacked to disk.
    • Lossless: every page has been verified byte-identical to the original.
    • Reads cost some CPU: index lookups feel normal, but large sequential scans are slower than on an uncompressed database.
    • CREATE EXTENSION baseshift_storage; shows raw and compressed sizes per table and index.
  • Autovacuum is off by default, because vacuuming would rewrite pages uncompressed and grow the container. Turn it on with ALTER SYSTEM SET autovacuum = on; and a reload if you plan heavy writes.

⁠Tags

TagMeaning
pg17-dc1.1-20261025PostgreSQL 17, dc1.1 (autovacuum off by default), data as of 2026-10-25 (pinned)
pg17-dc1-20261025the original dc1 image, same data (pinned)
pg17-dc1latest dc1.x on PostgreSQL 17
pg17, latestlatest overall

⁠Rebuild it yourself

Download the extract above, check its sha256, and run osm2pgsql 1.11.0 with --create --slim --hstore and the default style into a PostGIS-enabled PostgreSQL 17 database.

⁠About Baseshift

Baseshift⁠ builds database clones for development and testing. These images run on our clone engine with dc1, a new compression mode we're developing.

Tag summary

Content type

Image

Digest

sha256:f7a3adcfd…

Size

27.6 GB

Last updated

19 days ago

docker pull baseshift/db-osm-us