Hi, all.

I'm an experienced Python user, and pretty comfortable with GIS concepts, too.  
I'm using Shapely for several tasks; a hearty "thank you" to Sean Gillies and 
the team that develops and supports that library!

In my current application, I'm using Shapely mainly for its ability to marshal 
to/from WKT.

I'm having a bit of trouble using Shapely for one task.  I want to:

*         Put a few (potentially overlapping) polygons in a single Shapely 
object

*         I want the collection to preserve the "winding" of the polygons that 
I have carefully set.

A "MultiPolygon" won't work for me since my constituent polygons may overlap.

A "GeometryCollection" seems like the right object, but here are my two 
difficulties as I'm trying to use it:

*         It doesn't seem to have a way to create it directly with constituents 
of my choice

o   It only "comes about" after certain operations, like union() and 
cascaded_union()

o   But I don't want a union - it would merge my polygons' borders.  I wan't 
them to remain distinct.

*         Plus, the union() operations don't necessarily preserve the "winding" 
that I have set.

Can anyone think of a way to use the current API to accomplish what I want?

If Shapely would require an update to support this new feature, what do you 
think a good API would be for it?  I can think of two candidates; either:

*         Allow GeometryCollection() to be created with a list of initial 
constituents:

o   poly1 = Polygon(....); poly2 = Polygon(....); gcoll = 
GeometryCollection([poly1, poly2])

*         Introduce a new operation like ".add()" or ".superpose()" which adds 
another thing to the collection without performing a "union()" operation.

o   gcoll = GeometryCollection(); gcoll = gcoll.add(poly1); gcoll = 
gcoll.add(poly2)

Either approach also solves something else on my "wish list": I'd also 
sometimes like to collect a bunch of points in a GeometryCollection() -- even 
if they would "fit" just fine in a MultiPoint() object.

Thanks for your input and consideration.

-- Dan Harasty
[email protected]<mailto:[email protected]>




_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community

Reply via email to