[postgis-users] help needed with GEOS & other errors on postgis query

Brent Wood pcreso at pcreso.com
Mon Feb 21 20:17:47 PST 2005


I'm using (or trying to use) PostGIS to work with some Antarctic data.

I have a table with toothfish vessel's set positions, stored as linestrings.
The set data is lat/long, I loaded it with SRID=4326, then created another
table with a "create table as select .... transform(the_geom, 20001) from....
;"

I manually added a geometry_columns entry, a spatial index & a date index.

A second table has all the sea ice density data from the NATICE centre (NOAA)
as multipolygons.

The NATICE data is using a custom polar projection (SRID = 20001 in my
spatial_ref_sys table). The data were downloaded as e00 files, one per week
since 1977, and were converted using a script via avcimport/ogr2ogr/shp2pgsql. 

All the shapefiles are loaded into a single table, with a date field as an
identifier.



I manually added a geometry_columns entry and created a spatial index & a date
index.

I can select & query the data fine, no issues with PostGIS. I can display both
tables overlayed as I'd expect with QGIS.


What I want to do is generate a list of sets, where each output record has the
sea ice (ct) value for the sea ice polygons which cover the same week &
location as the set, (and the set length) 


The query I'm trying to run is:

psql $DB -c "select distinct id,
                    haul_id,
                    length(s.the_geom) as set_lgth,
                    ct
             from $ICE i,
                  $SET s
             where _date >= set_date - interval '3 days'
               and _date <= set_date + interval '3 days'
               and s.the_geom && i.the_geom
               and intersects(s.the_geom, i.the_geom);"


The result is a GEOS error message:

NOTICE:  TopologyException: side location conflict (-12.4841,1.2337e+06)
ERROR:  GEOS overlaps() threw an error!

I get the same result using intersects instead of overlaps.

Trying the same query without the last line (no GEOS), it exits with a
different error:

ERROR:  out of memory
DETAIL:  Failed on request of size 32.

There are 4558 set records and 73225 sea ice polygons. The system is a Linux,
dual Xeon 2400 with 2.5Gb memory. I'm not convinced there is a genuine memory
shortage. 



Any suggestions on how I can try to resolve this?


Thanks,

  Brent Wood



More information about the postgis-users mailing list