Opened 12 years ago

Closed 12 years ago

#1594 closed defect (invalid)

AddGeometryColumns has a problem with certain SRID's

Reported by: soi Owned by: pramsey
Priority: low Milestone: PostGIS 2.0.0
Component: postgis Version: 1.5.X
Keywords: Cc:

Description

AddGeometryColumns() reports lots of given SRID's (all i tested it with except -1) as invalid but at the same time it is possible to change the SRID with UpdateGeometrySRID(). Corrensponding logs follow.

2012-02-20 14:52:27 CET LOG: statement: CREATE TABLE "shape_basin" (gid serial PRIMARY KEY,

"sampleid" varchar(50), "area" float8);

2012-02-20 14:52:46 CET LOG: statement: SELECT AddGeometryColumn(,'shape_basin','the_geom',4326,'MULTIPOLYGON',2); 2012-02-20 14:52:46 CET ERROR: AddGeometryColumns() - invalid SRID

However this is possible:

2012-02-20 14:55:21 CET LOG: statement: SELECT AddGeometryColumn(,'shape_basin','the_geom',-1,'MULTIPOLYGON',2); 2012-02-20 14:55:57 CET LOG: statement: SELECT UpdateGeometrySRID('shape_basin', 'the_geom', 4326);

Change History (2)

comment:1 by Mike Taves, 12 years ago

With your database, do you get any rows returned with this query:

SELECT * FROM spatial_ref_sys
WHERE srid=4326;

My guess is that you haven't populated spatial_ref_sys yet.

comment:2 by soi, 12 years ago

Resolution: invalid
Status: newclosed

Yes you were right. I fixed it by applying spatial_ref_sys.sql.

Note: See TracTickets for help on using tickets.