[postgis-users] intersects() yields "TopologyException: side location conflict"

Paul Ramsey pramsey at cleverelephant.ca
Tue Sep 16 12:14:40 PDT 2008


SELECT gid FROM the_table WHERE NOT ST_IsValid(the_geom);

On Tue, Sep 16, 2008 at 10:55 AM, Reid Priedhorsky <reid at umn.edu> wrote:
> Dear all,
>
> PostGIS is failing on one of my tables with the following in the logs:
>
> 2008-09-16 01:27:31 CDT NOTICE:  TopologyException: side location conflict
> 464854 4.96637e+06
> 2008-09-16 01:27:31 CDT ERROR:  GEOS intersects() threw an error!
> 2008-09-16 01:27:31 CDT STATEMENT:                     SELECT
>            id,
>                          version,
>                          name,
>                          type_code,
>                          draw_class_code,
>                          z,
>                          valid_starting_rid,
>                          valid_before_rid,
>                          AsSVG(Scale(geometry, 1, -1, 1), 0, 2) as geometry
>                                             FROM (basemap_polygon bp JOIN
> basemap_polygon_type
>                         ON (type_code = basemap_polygon_type.code))
>                   WHERE
>                     (Intersects(bp.geometry, SetSRID('BOX(459128.000000
> 4962591.500000, 463188.000000 4966303.500000)'::box2d, 26915)))
>                     AND
>                     (    valid_before_rid = rid_inf()
>                        AND NOT deleted)
>
> The table (6k rows) looks like this:
>
>                           Table "public.basemap_polygon"
>      Column       |   Type   |                      Modifiers
>
> --------------------+----------+------------------------------------------------------
> id                 | integer  | not null default
> nextval('feature_id_seq'::regclass)
> version            | integer  | not null
> deleted            | boolean  | not null
> name               | text     | type_code          | integer  | not null
> valid_starting_rid | integer  | not null
> valid_before_rid   | integer  | not null
> geometry           | geometry | not null
> z                  | integer  | not null
> Indexes:
>   "basemap_polygon_pkey" PRIMARY KEY, btree (id, version)
>   "temp2" UNIQUE, btree (id)
>   "basemap_polygon_gist" gist (geometry)
>   "basemap_polygon_valid_before_rid" btree (valid_before_rid)
>   "basemap_polygon_valid_starting_rid" btree (valid_starting_rid)
> Check constraints:
>   "enforce_dims_geometry" CHECK (ndims(geometry) = 2)
>   "enforce_geotype_geometry" CHECK (geometrytype(geometry) = 'POLYGON'::text
> OR geometry IS NULL)
>   "enforce_srid_geometry" CHECK (srid(geometry) = 26915)
>   "enforce_version" CHECK (version >= 1)
> Foreign-key constraints:
>   "basemap_polygon_type_code_fkey" FOREIGN KEY (type_code) REFERENCES
> basemap_polygon_type(code) DEFERRABLE
>   "basemap_polygon_valid_before_rid_fkey" FOREIGN KEY (valid_before_rid)
> REFERENCES revision(id) DEFERRABLE
>   "basemap_polygon_valid_starting_rid_fkey" FOREIGN KEY (valid_starting_rid)
> REFERENCES revision(id) DEFERRABLE
>
> PostGIS version info:
>
>                              postgis_full_version
>
> ----------------------------------------------------------------------------------
> POSTGIS="1.3.3" GEOS="3.0.0-CAPI-1.4.1" PROJ="Rel. 4.6.0, 21 Dec 2007"
> USE_STATS
>
> Please advise.
>
> Is this a GEOS bug? Has it been fixed?
>
> How can I identify which row(s) in my table is/are causing the exception?
> They may turn out to be unimportant, in which case I can delete them as a
> workaround.
>
> Let me know what additional info I should provide.
>
> Thanks,
>
> Reid
> _______________________________________________
> 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