New answers tagged

2

but this is will not provide me the order and how many times municipalities are crossed. Assuming every row in Rivers table is a linestring with an entire river. Here's a query that will get you how many municipalities are crossed, the subquery t , will get you all the municipalities that each river crosses but yes they will not be in any guaranteed ...


1

To dump only unique points, you could use a few subqueries with a SELECT DISTINCT ON expression: SELECT geom, gid, path FROM ( SELECT DISTINCT ON (geom) geom, path, gid FROM ( SELECT (ST_DumpPoints(the_geom)).geom, (ST_DumpPoints(the_geom)).path, gid FROM my_linestrings_table ) f ORDER BY geom, path, gid ) f ORDER BY gid, path;


0

I've found the reason : it's a projection's problem. To resolve it : function transform_geometry(element) { var current_projection = new ol.proj.Projection({code: "EPSG:4326"}); var new_projection = layer.getSource().getProjection(); element.getGeometry().transform(current_projection, new_projection); } var features = [lineString_feature]; var ...


0

You could avoid the need for a recursive query by taking the following approach: From each input LineString, extract the endpoints into a two-point MultiPoint Run ST_ClusterWithin on the extracted endpoints Spatially join the endpoint clusters to the original geometries. Here's an example: CREATE TABLE test_lines (id serial, geom geometry); INSERT ...


2

Your logic seems sound, but you have some surplus text in your query which throws an error: "::geometry(linestring, SRID)" is not required. Also note that ST_ExteriorRing() does NOT work on multi-polygons, only polygons (null will be returned from multipolys, which may explain your lack of results). Also if you are using more than one polygon in each table, ...



Top 50 recent answers are included