[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] shp2pgsql: can we ignore invalid (corrupted?)
From:       Mark Cave-Ayland <mark.cave-ayland () siriusit ! co ! uk>
Date:       2008-03-31 9:56:54
Message-ID: 200803311056.54448.mark.cave-ayland () siriusit ! co ! uk
[Download RAW message or body]

On Wednesday 26 March 2008 09:15:59 kreshna_iceheart@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
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic