<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
>Message: 1
<div>>Date: Thu, 8 Sep 2022 00:08:23 +0200</div>
<div>>From: Sandro Santilli <strk@kbt.io></div>
<div>>To: GEOS Development List <geos-devel@lists.osgeo.org></div>
<div>>Subject: Re: [geos-devel] GEOS C API for Polygonal Coverage</div>
<div>>        operations?</div>
<div>>Message-ID: <YxkWV0gym7hqAesi@c19></div>
<div>>Content-Type: text/plain; charset=us-ascii</div>
<div>></div>
<div>>On Tue, Sep 06, 2022 at 02:37:37PM -0700, Martin Davis wrote:</div>
<div>>> I've started to build out operations on Polygonal Coverages in JTS ([1],</div>
<div>>> [2]).  </div>
<div>></div>
<div>>[...]</div>
<div>></div>
<div>>> A key question is how to expose these operations in the GEOS C API.  I see</div>
<div>>> two options:</div>
<div>>> 1) Model a Polygonal Coverage as an array of simple Polygons (and possibly</div>
<div>>> MultiPolygons)</div>
<div>>> 2) Provide a Polygonal Coverage datatype (which might contain internal</div>
<div>>> topology)</div>
<div>></div>
<div>>Could a coverage datatype allow performing operations on PostGIS Topologies</div>
<div>>w/out building the polygons for each face ? There's an ISO standard</div>
<div>>representation of topologies, maybe such representation could be used</div>
<div>>to transfer those topologies back and forth with GEOS ?</div>
<div>></div>
<div>>--strk;</div>
<div>></div>
<div class="elementToProof">></div>
<div>>------------------------------</div>
<div>></div>
<div><br>
</div>
<div class="elementToProof">Hi</div>
<div><br>
</div>
<div class="elementToProof">To speed up now I sometimes use the faces directly like below so yes it would be very nice to avoid code like this:</div>
<div class="elementToProof"><br>
</div>
<div class="elementToProof">SELECT distinct t.omrade, ((t.omrade).id)</div>
<div class="elementToProof">FROM topo_rein.arstidsbeite_var_flate t, topology tt, topology.layer tl, topo_rein_sysdata_rvr.relation tr, topo_rein_sysdata_rvr.face tf</div>
<div class="elementToProof">WHERE </div>
<div class="elementToProof">((t.omrade).topology_id = tt.id AND (t.omrade).layer_id = tl.layer_id AND (t.omrade).type = tl.feature_type) AND</div>
<div>tr.topogeo_id = ((t.omrade).id) AND</div>
<div>((t.omrade).layer_id) = tr.layer_id AND ((t.omrade).id) = tr.topogeo_id AND tf.face_id = tr.element_id AND ((t.omrade).type) = tr.element_type AND</div>
<div>tf.mbr && </div>
<div class="elementToProof">'0103000020A21000000100000005000000EF94C2D58F783C4082E16983FE605140EF94C2D58F783C40AA4578DB36945140A4B7A470A6453D40AA4578DB36945140A4B7A470A6453D4082E16983FE605140EF94C2D58F783C4082E16983FE605140'</div>
<div>AND</div>
<div class="elementToProof">ST_Intersects('0103000020A21000000100000005000000EF94C2D58F783C4082E16983FE605140EF94C2D58F783C40AA4578DB36945140A4B7A470A6453D40AA4578DB36945140A4B7A470A6453D4082E16983FE605140EF94C2D58F783C4082E16983FE605140', t.omrade)</div>
<div><br>
</div>
<div class="elementToProof">So could it also be an option to let && operator to know about about Topology type is extension added as a start and then the && operator could include code like this ?</div>
<div class="elementToProof"><br>
</div>
<div>'((t.omrade).topology_id = tt.id AND (t.omrade).layer_id = tl.layer_id AND (t.omrade).type = tl.feature_type) AND</div>
<div>tr.topogeo_id = ((t.omrade).id) AND</div>
<div class="elementToProof">((t.omrade).layer_id) = tr.layer_id AND ((t.omrade).id) = tr.topogeo_id AND tf.face_id = tr.element_id AND ((t.omrade).type) = tr.element_type AND'</div>
<div><br>
</div>
<div class="elementToProof">The best off course is if this was solved in geos as you suggest, but it would help a lot if the code below used the face.mbr indexes also as a start.</div>
<div class="elementToProof"><br>
</div>
<div class="elementToProof">SELECT distinct t.omrade, ((t.omrade).id)</div>
<div class="elementToProof">FROM topo_rein.arstidsbeite_var_flate t</div>
<div>WHERE </div>
<div>t.omrade && </div>
<div class="elementToProof">'0103000020A21000000100000005000000EF94C2D58F783C4082E16983FE605140EF94C2D58F783C40AA4578DB36945140A4B7A470A6453D40AA4578DB36945140A4B7A470A6453D4082E16983FE605140EF94C2D58F783C4082E16983FE605140'</div>
<div>AND</div>
<div class="elementToProof">ST_Intersects('0103000020A21000000100000005000000EF94C2D58F783C4082E16983FE605140EF94C2D58F783C40AA4578DB36945140A4B7A470A6453D40AA4578DB36945140A4B7A470A6453D4082E16983FE605140EF94C2D58F783C4082E16983FE605140', t.omrade)</div>
<div class="elementToProof"><br>
</div>
<div class="elementToProof">Lars</div>
</body>
</html>