Saturday, 20 October 2018

PostGIS: how to merge contiguous features sharing same attributes values?


I have a big PostGIS table storing line features.


I would like to merge features that are both connected to each other and have given attribute values identical. Here is below an example of what I'd like to achieve.




  • The outmost features (black and blue ones) are not merged because there are not contiguous even if their attribute values are the same

  • Features green and red are merged because they match both conditions

  • Feature yellow is left as before.


How would you achieve that with a SQL query? enter image description here




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...