MultiPolygon constructor behavior
See original GitHub issueExpected behavior and actual behavior.
The MultiPolygon
constructor seems to behave oddly when provided a sequence containing other MP
objects.
See behavior example on nbviewer.
Steps to reproduce the problem.
see nbviewer link
Operating system
Windows 10
Shapely version and provenance
1.6.4 from Chris Gohlke’s whl file page
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
MultiPolygon constructor behavior #588 - shapely ... - GitHub
The MultiPolygon constructor seems to behave oddly when provided a sequence containing other MP objects. See behavior example on nbviewer. Steps ...
Read more >The Shapely User Manual — Shapely 2.0.0 documentation
The Polygon constructor takes two positional parameters. The first is an ordered sequence of (x, y[, z]) point tuples and is treated exactly...
Read more >L.MultiPolygon is not a constructor (Leaflet 1.2.0) - Drupal
After upgrading Leaflet library to 1.2.0, I get the error: "L.MultiPolygon is not a constructor", when trying to add MultiPolygons to the ...
Read more >Chapter 17 Advanced Topics - Green Tea Press
The constructor for DrawablePolygon uses super to invoke the constructor for Polygon , which initializes the attributes npoints , xpoints , and ypoints...
Read more >6.096 Introduction to C++, Assignment 03
Implement a constructor that creates a Polygon from two arguments: an array of Points and the length of that array. Use member initializer...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sgillies would you be amenable to raising an error instead of silently truncating the multipolygon instance passed to
MultiPolygon
to its first component polygon?I agree this makes the most sense.
But it does pose a problem: what is the best way to take a sequence of geometry objects, any of which could be multi or single, and combining them? Not into a union but as a “bag of” single geometries? Note that
GeometryCollection
doesn’t work the way that I mean:The collection keeps the multi and single parts separate. The only way to do this I can see is: