Tag Info

Hot answers tagged

6

Ironically, the fastest way to find the set of things not within other things is to do a full join that finds the contained things, but using a LEFT JOIN, so the un-matched things are hanging about to be found, thus: SELECT pts.* FROM pts LEFT JOIN polys ON ST_Contains(polys.geom, pts.geom) WHERE polys.id IS NULL; The un-matched rows in a left join are ...


2

As far as I know, a table cannot have two geometry types (unless the type is a collection). Instead of modifying your existant table, try creating a new one: The geometry column is like any other column, it has one value for each row of the table. You are trying to create one geometry from many geometries, so what you want is not update the geometry of your ...


1

It's a bit difficult to determine exactly what you are trying to achieve. I've provided an example of how to handle the two scenarios that I think you are most likely trying to achieve. I have tried to keep the example short and simple, so I haven't included any SRID stuff and have just used INTs for coordinates. Scenario 1 is adding a line for each of ...


1

If we look at postgis source code(geography,geometry) we see that the function ST_DWithin is defined as: CREATE OR REPLACE FUNCTION ST_DWithin(geom1 geometry, geom2 geometry, float8) RETURNS boolean AS 'SELECT $1 && ST_Expand($2,$3) AND $2 && ST_Expand($1,$3) AND _ST_DWithin($1, $2, $3)' LANGUAGE 'sql' IMMUTABLE; the ...


1

Try AND instead of OR. If you want to deselect more layers you have to use AND. OR uses either 15% or 16% http://www.postgresql.org/docs/8.2/static/functions-logical.html 'Layer' NOT LIKE '15%' AND 'Layer' NOT LIKE '16%'



Only top voted, non community-wiki answers of a minimum length are eligible