tags: Osm

UNICODE from OSM to PGSQL (part 2)

There is no problem importing OSM data into PostgresSQL / PostGIS. In part one of the article we’ve seen Geofabrik’s shapefiles having a text data truncation problem, but using osm2pgsql everything gets into an UTF-8 database without a failure. It’s as simple as: $ osm2pgsql -l -c -S default.style africa.osm.bz2 -d osm The -l switch aks for keeping lat/long projection, -c requests creation of the schema, -d specifies the database to use.

Read more →

UNICODE from OSM to PGSQL

This week I’ve been presented with a problem importing OpenStreetMap data of Africa from GeoFabrik’s shapefile export into a PostgreSQL / PostGIS database. The problem consisted in a loss of information during the transport, resulting in wrongly encoded strings (road names) ending up in the db. This was during a feasibility study. So, is that feasible ? Let’s take a look. I downloaded the shapefiles and tried to import the roads one using shp2pgsql with no options, and here’s the result:

Read more →