I want to import shapefile into PostGIS. There is one database postgres
in it but no table added yet.
I am using this command:
shp2pgsql -I -s 4326 districts.shp districts | psql -d postgres -U postgres
and it's giving me some error:
Unable to convert data value to UTF-8 (iconv reports "Invalid or incomplete multibyte or wide character"). Current encoding is "UTF-8". Try "LATIN1" (Western European), or one of the values described at postgresql.org/docs/current/static/multibyte.html
Is my command wrong ??
Answer
Have you tried -W "latin1"
flag? Sometimes the default encoding (UTF-8) doesn't work well. Maybe you'll have better luck with latin1 encoding:
shp2pgsql -I -s 4326 -W "latin1" districts.shp districts | psql -d postgres -U postgres
There's a useful cheat-sheet available here.
Hope it helps..
No comments:
Post a Comment