New answers tagged query
How about SELECT EXISTS? According to the docs it should run until the first (if any) row is returned.
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 ...
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 ...
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 ...
I have the table working a lot better. I have another issue though, I can't get the row select, zoom to work correctly. I've deduced that it doesn't matter which row I click on, the 'dgrid-select' event always returns the same row to the call back. Any ideas on that?
From a quick glance, your configuration looks correct. You can omit the geometry property for the query but that should not influence the success or failure. The most common reason for the query not executing and not receiving an error message is that the url for the query is wrong or cannot be determined from the layer using layerID and sublayerID. I ...
Thanks guys, I found and easy and quick solution using the following query: SELECT * FROM mytable WHERE mytable.geom && ST_MakeEnvelope(minX, minY, maxX, maxY); My question was already answered somewhere else but I didn't use the correct search terms.
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 ...
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%'
Top 50 recent answers are included