I'm using osm2psql to import some OSM data, but the default style file that comes packaged with the tool for Windows returns an error.

It seems to be expecting a differently formatted style file, but I can't seem to change it for it to work.


osm2pgsql -U *** -W *** -d *** -O flex -S D:\downloads\osm2pgsql-1.5.1-x64\osm2pgsql-bin\default.style south-america-latest.osm.pbf

Binary (1.5.1): https://osm2pgsql.org/download/windows/

Data: https://download.geofabrik.de/south-america.html


ERROR: Error loading lua config: ...ownloads\osm2pgsql-1.5.1-x64\osm2pgsql-bin\default.style:2: unexpected symbol near '#'.

OS: Windows10

1 Answer 1


The default style file is meant to be used with the pgsql output.

For the flex output, there is no default and you would have to provide your own Lua config file.

See the doc for the various output type and more specifically for the new flex output type.

  • Thanks -- working with the psql output!
    – Encomium
    Commented Aug 12, 2021 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.