Tag Info

Hot answers tagged

3

ST_StartPoint is the correct function to find single nodes at the start of a Linestring, however it does not work with MultiLinestring, so you will need to use ST_Dump to get the constituent Linestrings. If I have understood you question correctly, you then want all start points which are not also end points for more than one line, ie, points where two ...


2

If I got you right, you can achieve that by running a Python script. You can follow this workflow: Open QGIS, load a vector layer and select it (activate it) in the ToC. Observe this function: def selectByExpression(): cLayer = iface.mapCanvas().currentLayer() expr = QgsExpression( "\"COD_DANE\"=13" ) it = cLayer.getFeatures( ...


2

Note that planners have difficulty with subqueries, and your example can be rewritten without subqueries. A flattened query should look like this: SELECT A.* FROM osm_addr2 AS addr, osm_addr2 AS POI WHERE POI.osm_id=-332537 AND ST_Intersects(addr.geometry, POI.geometry); There's a relevant example in the manual (last two SQL examples), where a subquery is ...


1

The documentation for ST_AsLatLonText explains that you can use an optional second argument to specify the format. In your case, it would be: UPDATE members SET latlong_degree = ST_AsLatLonText (the_geom, 'D°M''S"C') Note that the ' mark for the minutes has to be double quoted to avoid it just terminating the string.


1

I have found that rearranging the query so that the sub-query is at the same level as the initial select, essentially a Cartesian product, but then using the where clause to restrict the records read, will cause the indexes to be used and avoid a full table scan. SELECT * FROM osm_addr2 AS addr, (SELECT geometry FROM osm_addr2 WHERE osm_id=-332537) ...


1

I recommend two Queries, since the results from focnetworkpart and node are not related in anyway (at least according to your desciption). The Problem you will or already ran into is the combination of both results. So you are better of first asking one table for results and then the other. Then you can work with both results. Also be aware that ST_DWithin ...


1

I've included a screenshot to show where the function is in the Configure shortcuts option:


1

PostgreSQL doesn't use indexes for functions, it uses indexes for operators only. What happens is function inlining. ST_INTERSECTS is defined as: CREATE OR REPLACE FUNCTION ST_Intersects(geom1 geometry, geom2 geometry) RETURNS boolean AS 'SELECT $1 && $2 AND _ST_Intersects($1,$2)' LANGUAGE 'sql' IMMUTABLE; And so the query gets rewritten to use ...



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