<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 13, 2015 at 12:59 AM, Sandro Santilli <span dir="ltr"><<a href="mailto:strk@keybit.net" target="_blank">strk@keybit.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Apr 10, 2015 at 10:40:32AM -0700, Martin Davis wrote:<br>
> re what is happening in Shapely with relate on GeometryCollections:<br>
><br>
> In fact, homogeneous GeometryCollections of Points and LineStrings can be<br>
> trivially converted to MultiPoints and MultiLineStrings.  Is is possible<br>
> that Shapely is doing this automatically?<br>
><br>
> Handling homogeneous GCs would be a nice enhancement for JTS & GEOS....<br>
<br>
</span>There's actually a ST_CollectionHomogenize function in PostGIS that<br>
can be used to do just that.<br><br></blockquote><div>I'm starting to think about adding a "flatten" method to JTS that would do all the heavy lifting to transform an arbitrary GeometryCollection into something suitable for using with relate.  In addition to converting homogenous collections into the appropriate Multi-type, it would union all polygons to make them into a valid MultiPolygon. </div></div><br></div></div>