Hot answers tagged query
You must first UNION all the geometries. Then you can LEFT JOIN the geometries ON ST_Equals to retrieve the values. Sample code -- Create dummy test values WITH sand1 AS ( SELECT val, ST_MakePoint(x, y) geom FROM (VALUES (11, 0, 0), (22, 1, 2), (32, 3, 1)) a(val, x, y) ), sand2 AS ( SELECT val, ST_MakePoint(x, y) geom FROM (VALUES (12, 0, 0), (23, 1, 3)...
The following query translates your question into a PostGIS query which sets the default state speed to all roads with NULL speed completely within a state. UPDATE roads SET speed = states.speed FROM states WHERE ST_Within(roads.geom, states.geom) AND roads.speed IS NULL
To prepare your script for receiving a parameter from the user, assign value to arcpy.getParameterAsText(0). The zero in the assignment identifies this as the first parameter you will set in the script tool. Next, modify your script to work with the parameter. Add an IF/ELSE statement to handle the option to clear the query: value = arcpy....
You don't need to store your query extent in the database, but the best option is still to make a geometry type from it. I would recommend making a WKT represenation of your geometry by whatever means you deem appropriate, then just use ST_GeomFromText in a query, e.g.: -- wkt is a WKT representation of your box SELECT * FROM bc_roads WHERE bc_roads.geom &...
Create a view CREATE VIEW v_location AS SELECT id, name, address, ST_AsGeoJSON (location) AS location FROM "locations"; Use the "SELECT *" on it: SELECT * FROM v_location where "locations"."id" = 2 limit 1
Only top voted, non community-wiki answers of a minimum length are eligible