mapquery icon indicating copy to clipboard operation
mapquery copied to clipboard

Problems when importing a Latin 1 shapefile zip

Open rogerfischer opened this issue 9 years ago • 2 comments

Hi Keith, Thanks for your great work! I wanted to import this shapefile here: http://statbel.fgov.be/en/binaries/scbel01012011_gen13_tcm327-275679.zip into mapquery.

And got this error message:

{"status":"error","message":"Command failed: shp2pgsql -W "latin1" -c -D -s 4269 -I ./shapefile-imports/scbel01012011_gen13_tcm327-275679/scbel01012011_gen13.shp public.temp | psql -h localhost -p 5432 -d mapquery

So I suspect that the belgian Latin 1 names caused Mapquery some trouble.

rogerfischer avatar May 13 '16 16:05 rogerfischer

Hi Keith, Thanks for your great work! I wanted to import this shapefile here: http://statbel.fgov.be/en/binaries/scbel01012011_gen13_tcm327-275679.zip into mapquery. And got this error message: {"status":"error","message":"Command failed: shp2pgsql -W "latin1" -c -D -s 4269 -I ./shapefile-imports/scbel01012011_gen13_tcm327-275679/scbel01012011_gen13.shp public.temp | psql -h localhost -p 5432 -d mapquery So I suspect that the belgian Latin 1 names caused Mapquery some trouble.

did you try configuring psql again because it might also fail because of psql and you might not be able to understand that

shockwavemoto avatar May 30 '17 17:05 shockwavemoto

So I suspect that the belgian Latin 1 names caused Mapquery some trouble.

At least as far as the database is concerned, the library does manual string concatenation for queries, which is a strict no-no. It should have the driver escape all the parameters.

I've added a PR: https://github.com/Quartz/mapquery/pull/4

vitaly-t avatar Jun 10 '17 00:06 vitaly-t