Hi Christian,

I deliberately omitted a geometry collection constructor because there was
almost no support in GEOS for operations on them. You couldn't buffer a
collection, for example, or find its difference to another geometry. I've
seen some signs of this changing in GEOS, but until it does I don't think
there's any point to the class. It wouldn't be much more than a list of
geometries.

On Tuesday, November 13, 2012, Christian Ledermann wrote:

> I want to parse a kml like :
>
> <kml:MultiGeometry xmlns:kml="http://www.opengis.net/kml/2.2";>
>   <kml:Polygon>
>     <kml:outerBoundaryIs>
>       <kml:LinearRing>
>         <kml:coordinates>3.000000,0.000000 4.000000,0.000000
> 4.000000,1.000000 3.000000,0.000000</kml:coordinates>
>       </kml:LinearRing>
>     </kml:outerBoundaryIs>
>   </kml:Polygon>
>   <kml:Point>
>     <kml:coordinates>0.000000,1.000000</kml:coordinates>
>   </kml:Point>
>   <kml:LineString>
>     <kml:coordinates>0.000000,0.000000 1.000000,1.000000</kml:coordinates>
>   </kml:LineString>
> </kml:MultiGeometry>
>
>
> into a shapely geometry
>
>
> I tried
>
>         po = Polygon([(3,0), (4,0), (4,1), (3,0)])
>         l = LineString([(0,0), (1,1)])
>         p = Point(0,1)
>         g = GeometryCollection([po,p,l])
>
> which fails with:
> TypeError: __init__() takes exactly 1 argument (2 given)
> and
>         geo_if = {'type': 'GeometryCollection', 'geometries': [
>             po.__geo_interface__, l.__geo_interface__,
>             p.__geo_interface__ ]}
>         g = asShape(geo_if)
>
> which fails with:
> ValueError: Unknown geometry type: geometrycollection
>
>
> How can I create a GeometryCollection?
>
>
>
> --
> Best Regards,
>
> Christian Ledermann
>
> Nairobi - Kenya
> Mobile : +254 702978914
>
> <*)))>{
>
> If you save the living environment, the biodiversity that we have left,
> you will also automatically save the physical environment, too. But If
> you only save the physical environment, you will ultimately lose both.
>
> 1) Don’t drive species to extinction
>
> 2) Don’t destroy a habitat that species rely on.
>
> 3) Don’t change the climate in ways that will result in the above.
>
> }<(((*>
>


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

Reply via email to