question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ENH: Add example or implement dissolve of contiguous or otherwise related geometries

See original GitHub issue

An example was added to networkx (https://github.com/networkx/networkx/pull/4381) that may be more appropriate here, either via implementation in the API or as an example (potentially as a more advanced example, it is a little complex). It certainly has room to be improved further.

This was also raised in a comment on #1568

This could leverage #1674 to capitalize on vectorized spatial relations between two GeoSeries - which in this case would be the same GeoSeries against itself. The important part is that it uses a spatial index followed by the predicate operation.

In early testing, the linked example appears faster than PySAL Queen contiguity.

Ideally, this would permit the user to specify the spatial relationship (within reason). The linked example uses intersects, but it could also be expanded to touches, overlaps, etc.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
martinfleiscommented, Dec 3, 2020

Probably related is this PR https://github.com/pysal/libpysal/pull/335 implementing libpysal’s fuzzy_contiguity based on query_bulk exposing predicate. Therefore you can do the following to dissolve based on predicate (+ some buffer options)

W = libpysal.weights.fuzzy_contiguity(gdf, predicate='touches')
gdf.dissolve(W.component_labels)

I would not add it to our API but it may be a nice set of examples.

1reaction
martinfleiscommented, Dec 3, 2020

@ljwolf I have a WIP version of Queen somewhere which uses pygeos to get coordinates (instead of looping) which brings reasonable speedups esp. on large gdfs. I’ll dig it out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ee.Geometry.dissolve - Earth Engine - Google Developers
ee.Geometry.dissolve ... Returns the union of the geometry. This leaves single geometries untouched, and unions multi geometries. Usage, Returns ...
Read more >
GIS dictionary - Esri Support
A representation of a three-dimensional, real-world object in a map or scene, with elevation values (z-values) stored within the feature's geometry. Unlike 3D ......
Read more >
Module 2- Valuation - Minnesota Department of Revenue
Example : A residential homestead property with an estimated market value of ... connected or not connected to utilities when located in a ......
Read more >
Silicon Dioxide | SiO2 - PubChem - NIH
Silica may combine with other metallic elements and oxides to form silicates. ... In fact very little dissolution occurs; for example, 9 mg...
Read more >
FFmpeg Filters Documentation
1 Description. This document describes filters, sources, and sinks provided by the libavfilter library. 2 Filtering Introduction.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found