From geos-trac at osgeo.org Mon Apr 13 04:35:00 2015 From: geos-trac at osgeo.org (GEOS) Date: Mon, 13 Apr 2015 11:35:00 -0000 Subject: [geos-devel] [GEOS] #725: GEOS allows relate ops on GeometryCollection, while JTS and PostGIS do not Message-ID: <045.e3d907b6230729d4a227f2cf6d204937@osgeo.org> #725: GEOS allows relate ops on GeometryCollection, while JTS and PostGIS do not ------------------------+--------------------------------------------------- Reporter: mwtoews | Owner: geos-devel@? Type: task | Status: new Priority: minor | Milestone: GEOS Future Component: Default | Version: svn-trunk Severity: Unassigned | Keywords: ------------------------+--------------------------------------------------- GEOS currently allows relate ops on GEOMETRYCOLLECTION geometries, e.g. with Shapely: {{{ from shapely.wkt import loads g1 = loads('GEOMETRYCOLLECTION(POINT(1 2),POINT(3 4))') g2 = loads('GEOMETRYCOLLECTION(POINT(3 4),POINT(1 2))') print(g1.equals(g2)) # True print(g1.relate(g2)) # 0FFFFFFF2 }}} or with R {{{ library(rgeos) g1 <- readWKT("GEOMETRYCOLLECTION(POINT(1 2),LINESTRING(3 4, 5 6))") g2 <- readWKT("GEOMETRYCOLLECTION(LINESTRING(3 4, 5 6),POINT(1 2))") g3 <- readWKT("GEOMETRYCOLLECTION(LINESTRING(3 4, 5 6),POINT(1 1))") gEquals(g1, g2) # [1] TRUE gRelate(g1, g2) # [1] "1FFF0FFF2" gRelate(g1, g3) # [1] "1F0F0F0F2" }}} PostGIS and JTS do not allow these operations, see email threads: * http://lists.osgeo.org/pipermail/postgis-devel/2015-April/024827.html * http://lists.osgeo.org/pipermail/postgis-devel/2015-April/024829.html In particular, the rationale for the restriction in JTS from Martin Davis: > It's because GeometryCollection have no inherent topology. In other words, > geometry components can overlap. To compute relationships with a geometry > with overlapping components the components have to be merged to form a > topologically valid arrangement. This is more complex and more > computationally expensive than the rest of the relate algorithm. So > basically it just didn't get done. (It would also introduce potential > robustness issues, which I was hoping to avoid in the relate code. > A few relationships (eg intersects and disjoint) could be computed more > easily, so they could have special case code added for them more easily. This task is to assess the situation for GEOS, whether a similar restriction should be set for relate ops, or any other changes. Note that I haven't found a case that returns a bad result, but I haven't looked hard. -- Ticket URL: GEOS GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS). From gim.spb at gmail.com Tue Apr 28 05:56:55 2015 From: gim.spb at gmail.com (Gorbachev Ivan) Date: Tue, 28 Apr 2015 15:56:55 +0300 Subject: [geos-devel] intersected but not touch Message-ID: I need to find the intersection between the couples of objects in the set of objects. There are hundreds of thousands of objects. I only need to find objects that intersect but do not touched. To find out it, I call the method "intersect" and after that I call the method "touch". For 100 of objects is 100! * 2 checks. Is there are way to find the intersection of objects, excluding objects witch are only touch? Then checks will take half a time. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From strk at keybit.net Tue Apr 28 07:08:39 2015 From: strk at keybit.net (Sandro Santilli) Date: Tue, 28 Apr 2015 16:08:39 +0200 Subject: [geos-devel] intersected but not touch In-Reply-To: References: Message-ID: <20150428140839.GA14705@localhost> On Tue, Apr 28, 2015 at 03:56:55PM +0300, Gorbachev Ivan wrote: > Is there are way to find the intersection of > objects, excluding objects witch are only touch? See GEOSRelatePatternMatch, and http://en.wikipedia.org/wiki/DE-9IM --strk; () Free GIS & Flash consultant/developer /\ http://strk.keybit.net/services.html