Tag Info

New answers tagged

1

In your code: def EXPCODE(field_value): if field_value = "S4DNN2" return field_value "3.5" if field_value = "H2BNN2" return field_value "5.0" should probably be: def EXPCODE(field_value): if field_value == "S4DNN2": return 3.5 elif field_value == "H2BNN2": return 5.0 but if this is coming from the ...


1

How about SELECT EXISTS? According to the docs it should run until the first (if any) row is returned.


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 ...


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 ...


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 ...



Top 50 recent answers are included