[postgis-devel] Shp2pgsql picks wrong field type?

TECHER Jean David davidtecher at yahoo.fr
Wed Apr 6 01:38:01 PDT 2005


Hi Marc

Before doing the test, do U try to view the shapefile
with a viewer like QGIS???
----------------------------------------------------------------
TECHER Jean David
Responsable Informatique 01MAP
e-mail: davidtecher at yahoo.fr
Bureau: 04 67 45 60 27
Portable: 06 85 37 36 75
site perso : http://techer.pascal.free.fr/postgis/
site pro: http://www.01map.com/download/
K-S:"The greatest trick the devil pulled off was convincing people he didn't
exist"
------------------------------------------------------------
----- Original Message -----
From: "Mark Cave-Ayland" <m.cave-ayland at webbased.co.uk>
To: "'PostGIS Development Discussion'"
<postgis-devel at postgis.refractions.net>
Sent: Wednesday, April 06, 2005 10:25 AM
Subject: [postgis-devel] Shp2pgsql picks wrong field type?


Hi guys,

Here's another problem I've found with the shapefile loader for PostGIS
1.0.0-rc6 where it picks up the wrong datatype for a column.

The problem can be seen in this TIGER shapefile which I've copied to
http://www.webbased.co.uk/mca/tmp/lkA12133.zip. Extract the ZIP, and then
run shp2pgsql on the shapefile to produce the .sql file, and then try and
load the .sql into the database. What happens is that some of the
transactions fail during the load.

Taking a closer look, it appears as if shp2pgsql determines the wrong
datatype for the "fraddr" field, which shp2pgsql assumes is an int8. This is
fine until the .sql script gets to line 1153 at which point we find the
"fraddr" field is set to '11-82' which of course will cause the insert to
fail.

I'm not sure yet whether this is an incorrectly generated shapefile or a
bug, however what should shp2pgsql do (if anything) if it detects data that
doesn't correctly match the field type?


Many thanks,

Mark.

------------------------
WebBased Ltd
South West Technology Centre
Tamar Science Park
Plymouth
PL6 8BT

T: +44 (0)1752 791021
F: +44 (0)1752 791023
W: http://www.webbased.co.uk


_______________________________________________
postgis-devel mailing list
postgis-devel at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-devel






More information about the postgis-devel mailing list