[postgis-users] Importing shapefiles with srid != -1

Lee Hachadoorian lee.hachadoorian at gmail.com
Fri May 9 12:16:58 PDT 2008


Is there any chance spatial_ref_sys is missing srid 4326?

Lee Hachadoorian
PhD Student, Geography
Program in Earth & Environmental Sciences
CUNY Graduate Center

On Fri, May 9, 2008 at 12:21 PM, Stephen Lee <stephenljk at gmail.com> wrote:
> Hi James,
>
> Why not try qGIS and use its import wizard to give it a shot?
>
> regards,
>
> stephen
>
> On Fri, May 9, 2008 at 8:01 PM, James Dominy <james at sun.ac.za> wrote:
>>
>> Hi all,
>>
>> I have a shape file with an associated prj. The prj file says the shape
>> file is in WGS84, so I'm using
>>
>> shp2pgsql -a -g gisdata -s 4326 provinces.shp GISProvices
>>
>>
>>
>> When I run the result through psql, I get
>>
>> ERROR: new row for relation "gisprovices" violates check constraint
>> "enforce_srid_gisdata"
>>
>>
>>
>> The table definition is as follows...
>>
>> CREATE TABLE GISProvinces (
>>        region_id SERIAL PRIMARY KEY,
>>        name VARCHAR(255) NULL,
>>        layer INTEGER NOT NULL REFERENCES TGISLayer
>> );
>> SELECT AddGeometryColumn('', 'gisprovinces', 'gisdata', 4326,
>> 'MULTIPOLYGON', 2);
>>
>> Everything works fine if I don't specify any srid. As soon as I specify an
>> SRID for either the column or the inserts (via -s with shp2pgsql), or both,
>> even if they are the same, I get the error. What am I doing wrong?
>>
>> Thanks,
>> James
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>



More information about the postgis-users mailing list