This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Error reading style file when loading osm data into postgis using osm2pgsql

0

When I used osm2pgsql to load OpenStreetMap data into my postgis, I got the error message:Error reading style file line 1(fields = 1). I really don't know how to deal with it. Beg your help! Thanks very much!

asked 12 Oct '15, 03:46

kandifa's gravatar image

kandifa
11112
accept rate: 0%

It would help if you could add the full line of the osm2pgsql command you're using (and on what OS).

(12 Oct '15, 08:54) SomeoneElse ♦

One Answer:

0

I have the same problem. I tried to load *.pbf file via osm2pgsql. I copied the command from site, but when I replaced filename, I deleted one parametr.

Commnd from site:

C:>osm2pgsql -d gis -U postgres -W -H localhost -P 5432 -s -S C:\osm2pgsql\default.style RU-MOW.osm.pbf

My command:

osm2pgsql -d gis -U postgres -W -H localhost -P 5432 -s -S C:\RU-MOW.osm.pbf
Instead of style-file I specify pbf, and get the error:
Osm2pgsql Error reading style file line 2 (fields=1)

correct command:

C:>osm2pgsql -d gis -U postgres -W -H localhost -P 5432 -s -S C:\osm2pgsql-bin\default.style C:\osm.pbf

answered 04 Jul '18, 09:41

Vladimir-554455's gravatar image

Vladimir-554455
112
accept rate: 0%

edited 04 Jul '18, 09:46

Source code available on GitHub .