// the find
osm2pgsql-dev/osm2pgsql
Import OpenStreetMap data into a PostgreSQL/PostGIS database
osm2pgsql is the standard tool for loading OpenStreetMap data into PostgreSQL/PostGIS, used by Nominatim, tile rendering stacks, and GIS analysis pipelines. It's been around for over a decade and is actively maintained by three core contributors. If you're building anything geospatial on top of OSM data, this is the entry point.
The flex output mode with Lua scripting is genuinely well-designed — you write a Lua config that defines exactly which OSM tags map to which columns and geometry types, giving you full control without patching C++. Incremental updates via replication diffs work reliably and keep large databases current without full reimports. The tool scales from a city extract on a laptop to the full planet file on a server with the same command. CI covers Linux, Windows, and macOS builds with dedicated GitHub Actions composites per platform, which is more than most C++ OSM tools manage.
The build dependency list is genuinely painful — Boost, expat, proj, lua, libpq, nlohmann-json, and optional OpenCV/potrace means a non-trivial environment setup before you can even compile. The generalization feature is explicitly marked experimental and only documented on a separate website page, not in the repo itself. Windows support exists but requires binary builds from the project website rather than a package manager, which is a second-class experience. The Lua flex config learning curve is steep; the example configs in flex-config/ are useful but there's no guided tutorial for someone who just wants to get roads and buildings into PostGIS without reading the full manual.