Tag Info

Hot answers tagged

3

Calculating a couple of new fields and using the Summary Statistics tool should be one method able to get you what you want. Add a new field to hold the area * thickness for each aquifer and field calculate that value for all the aquifers. Add a second new field to hold the water body id portion of your internal code and populate it as suggested in the ...


3

The main difference is that in a classical join, inner (equi), left or right the joined fields or field must match exactly on both sides of the join, ie, in both tables you are joining. In a spatial join, there is no notion of exactness. Instead you are joining on an intersection, containment or even distance between a geometry field in one table and a ...


3

You are just adding location or proximity attribute data to your tabular query. If I have a sales order code number on in an order table, then in a "classical" join I might just look up the description of that sales order code number. If that same order table also has, say, an x_coord and y_coord column, I can use those values to find out sales districts ...


3

The default OGR SQL engine does not support LIMIT. Try switching to the SQLite dialect, which is done by adding the argument -dialect SQLITE ie. ogr2ogr -f GeoJSON -sql "SELECT * FROM ne_10m_populated_places WHERE ADM0NAME = 'India' ORDER BY POP_MAX DESC LIMIT 1,30" -dialect SQLITE places.tmp.geo.json ne_10m_populated_places.shp


3

You can simplify the whole thing by using coalesce, which selects the first non-null item in a list, in this case, either the nearest point to you search point, (28.959495,41.019913), or the point itself. with input_geom (geom) as (select st_setsrid(st_makepoint(28.959495,41.019913), 4326)) select coalesce( (select st_closestpoint(pts.the_geom, ...


2

Use a self-join of the same table twice with different alias. To find the intersection of one linestring with all others: SELECT b.id FROM trajectory a, trajectory b WHERE a.id = %s AND a.id <> b.id AND ST_Intersects(a.line_geometry, b.line_geometry) And to find all combinations of intersections of linestrings in the table: SELECT a.id || ' ...


2

If you have GDAL/OGR 1.10 or later, use -dialect SQLITE for the SQLite SQL dialect, which supports ORDER BY POP_MAX DESC LIMIT 30 in SQL statements.


2

'Limit' is not implemented with OGR2OGR . However, you can add and calculate a field with an integer on your 30 biggest places and filter on your new field. this works : ogr2ogr -f GeoJSON -sql "SELECT * FROM ne_10m_populated_places WHERE ADM0NAME = 'India' ORDER BY POP_MAX" places.tmp.geo.json ne_10m_populated_places.shp with your new field : ogr2ogr ...


1

This is almost not a GIS question, but you will need to aggregate your geometries. Right? Thought so. The following query does not use a subquery as I thought would be required earlier. You will simply GROUP BY the value columns. All columns not being grouped will need to be aggregated, and that's where the SpatiaLite function GUnion comes in. Note that ...



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