OpenStreetMap: US States & Territories
/

South Carolina

PostgreSQL
17.11

OpenStreetMap data for South Carolina from Geofabrik: roads, buildings, land use and points of interest, loaded into PostGIS.

Quick start
docker run -d -p 127.0.0.1:5432:5432 baseshift/db-osm-us-sc:pg17-dc1
View in registry
Latest snapshot
Snapshot date

November 13, 2026

Raw size

3.27 GB

Download size

0.70 GB

Engine

PostgreSQL

Version

17.11

Image tag

pg17-dc1-20261113

Overview

Database name: osm_us_sc_261113

What's inside

Each database in this space is one Geofabrik extract of OpenStreetMap for a single US state or territory, loaded into PostgreSQL 17 with PostGIS. It has the same schema as the country extracts at a size that is quick to pull and try.

How it's built

  1. Download the state's .osm.pbf extract from Geofabrik's US sub-region pages.
  2. Import it with osm2pgsql 1.11.0: default style, slim mode, all tags kept in an hstore column, geometries in EPSG:3857 (Web Mercator).
  3. Package the resulting database as a Docker image, compressed with DC1.

Each database page shows the extract date, sizes and image tag of its latest snapshot.

Schema

The standard osm2pgsql layout:

  • planet_osm_point: points of interest such as shops, cafes, stops and peaks.
  • planet_osm_line: roads, railways, rivers, boundaries and other linear features.
  • planet_osm_polygon: buildings, land use, parks, water bodies and areas.
  • planet_osm_roads: a smaller subset of major roads for low zoom levels.
  • planet_osm_nodes, planet_osm_ways, planet_osm_rels: raw slim-mode tables.

Quick start

Open a state below and copy its docker run command. Once PostgreSQL is up, connect without a password:

psql -h 127.0.0.1 -U postgres -d <database name>

Example query

SELECT name,
       ST_Area(way) / 1e6 AS area_km2
FROM planet_osm_polygon
WHERE leisure = 'park'
  AND name IS NOT NULL
ORDER BY area_km2 DESC
LIMIT 10;

Areas are in Web Mercator units, which overstate true area away from the equator. Transform to a local projection for exact figures.

Storage stats: baseshift_storage

The images ship with baseshift_storage, a read-only PostgreSQL extension that shows how the image stores each table, index and TOAST relation: raw size, compressed size, compression ratio and which DC1 codecs hold the blocks. It reveals storage layout, not data.

It is installed but not created. Enable it once per database as a superuser (the default postgres user is one):

CREATE EXTENSION baseshift_storage;

It only works inside a Baseshift image, where the clone engine is loaded. On plain PostgreSQL every function except the check below raises an error. To check:

SELECT baseshift_storage_available();

What it provides:

  • baseshift_storage: a view with one row per relation in the current database, including raw_bytes, stored_bytes, ratio, top_codec and codecs, plus clone_changed_blocks for what your running copy has rewritten since the snapshot.
  • baseshift_relation_storage(rel): the same measures for a single relation.
  • baseshift_chunks(rel): per-chunk detail, one row per 1,024 blocks.

The biggest relations, raw versus stored:

SELECT relname,
       pg_size_pretty(raw_bytes)    AS raw,
       pg_size_pretty(stored_bytes) AS stored,
       round(ratio::numeric, 2)     AS ratio,
       top_codec
FROM baseshift_storage
ORDER BY raw_bytes DESC
LIMIT 20;

The whole database:

SELECT pg_size_pretty(sum(raw_bytes))    AS raw,
       pg_size_pretty(sum(stored_bytes)) AS stored,
       round(sum(raw_bytes)::numeric / sum(stored_bytes), 2) AS ratio
FROM baseshift_storage;

Good to know:

  • pg_relation_size() and pg_total_relation_size() report the raw, decompressed size. Use this extension for compressed sizes.
  • stored_bytes includes the relation's shared artifacts, such as dictionaries and model weights, and ratio is raw divided by stored.
  • Codec names include LNN and LNNI, the neural codecs for tables and indexes.
  • Access is superuser only by default. To let other roles read it, grant it to pg_read_all_stats:

GRANT EXECUTE ON FUNCTION
  baseshift_chunks(regclass, bool),
  baseshift_relation_storage(regclass, bool)
TO pg_read_all_stats;
GRANT SELECT ON baseshift_storage TO pg_read_all_stats;

Source and license