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.

Is there any module to fill a ring polygon ?

See original GitHub issue

I know the turf.mask() function can make a unmasked polygon to a ring polygon with holes. But conversely, if I want to fill the ring polygon, and get the unmasked polygon, is there any module help me to resolve this problem.

http://geojson.io/#id=gist:anonymous/ae1ca487f5bc83e8e14dac39b2a20c82&map=3/-26.98/130.00

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
rowanwinscommented, Oct 24, 2017

Ah so if I understand correctly you want to remove the holes from the polygon. Short answer is no there is nothing available.

If you’re just dealing with polygons (and not MultiPolygons) you should be able to do something like

   orig.geometry.coordinates.splice(1, orig.geometry.coordinates[0].length - 1)

This will leave you will the outer geometry and delete any holes

1reaction
ffflabscommented, Nov 2, 2017

Actually you could do it with multipolígons too by playing with CCW and using the ring directions to determine they are holes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating polygon from hole in polygon using QGIS
Switch to Fill all rings in selected polygons with new feature mode by clicking on a small triangle (right-hand-side). Start editing mode and ......
Read more >
Add a point, line, and polygon | Overview - ArcGIS Developers
A polygon graphic is created using a polygon and a fill symbol . A polygon is defined as a sequence of points (ring)...
Read more >
How to Plot Polygons in Python - deparkes
When you're working with polygons it can be useful to be able to plot ... First we need to import the necessary modules:...
Read more >
An Approach for Checking Overlaps and Gaps in Polygons ...
First, open the shapefile as geo-dataframe with Geopandas module. Then, dissolve the data into one polygon using 'dissolve'. We can create one ...
Read more >
The Shapely User Manual — Shapely 2.0.0 documentation
The point type is implemented by a Point class; curve by the LineString and LinearRing classes; and surface by a Polygon class. Shapely...
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