[postgis-users] shp2pgsql: can we ignore invalid (corrupted?) .DBF?
Mark Cave-Ayland
mark.cave-ayland at siriusit.co.uk
Mon Mar 31 02:56:54 PDT 2008
On Wednesday 26 March 2008 09:15:59 kreshna_iceheart at yahoo.com wrote:
> I'm trying to convert SHPs to postGIS tables, but I encountered two kind of
> problems regarding to invalid DBF.
>
> The first SHP shows weird ASCII characters when I tried to convert it, and
> the process failed with the following error message: NULL,fread(45816)
> failed on DBF file.
> (complete error message attached)
>
> When I opened the first SHP with Quantum GIS, its attribute table shows
> weird ASCII character on column names (pic attached).
>
>
> The second SHP does not show ASCII characters when I tried to convert it,
> yet it also failed with the following error message: dbf file(.dbf) can not
> be opened.
>
> And when I tried to open the second SHP with Quantum GIS, its attribute
> table only shows one single column named "ID" (pic also attached).
>
>
> Yet DBF files do exist for both SHP. What's wrong? What's going on?
>
> Can I just convert the attribute data while completely ignoring the invalid
> .DBF attribute? What is the shp2pgsql switch for the purpose?
>
>
> Thanks,
> -Kresh
At least the first error looks like an encoding problem. You need to look at
what encoding is used for your shapefile, and then use the -W option for
shp2pgsql to convert it into a form usable by your database.
HTH,
Mark.
--
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063
More information about the postgis-users
mailing list