small medium large xlarge

Generic-user-small
23 Mar 2008, 08:41
Bill Parrill (2 posts)

I’m on chapter 5.9 and have reached the point where I’m supposed to create the multipolygons. However, when I run the select statement, I get an error:

g4wd=# select name, GeomUnion(the_geom) as location into us_50 from us_states group by name; ERROR: Operation on mixed SRID geometries

Any ideas what’s going on? Thanks! I’m using PostgreSQL 8.3.1.

Generic-user-small
03 Jun 2008, 14:42
Marc Hollins (5 posts)

I’m glad to see I’m not the only one having this problem.

Anybody know how to get it to work?

PostgreSQL 8.3, PostGIS 1.3

Generic-user-small
12 Jun 2008, 15:11
Charity Sipe (2 posts)

Although I didn’t experience the problem you are describing, it sounds like there are multiple geometries in your table which causes the command to fail. To discover which SRIDs are in your us_states table,

select distinct SRID(the_geom) from us_states;

If there is more than one SRID listed, you need to issue

update us_states set the_geom = setSRID(the_geom, 4269)

Recall that 4269 is the Geographic projection (Lat/Lon) and the datum is NAD83.

If more than one SRID isn’t listed in your table and the SRID displayed is -1, you may see the same behavior as when there are mixed SRIDs in the table. This is just a guess as I have no idea. But if -1 is displayed as the projection of data (meaning the projection is unknown), you can try setting it to 4269 using the aforementioned command to see if this solves your problem.

Hope this helps.

Charity

You must be logged in to comment