Hi,<div><br></div><div>I need to do the following request to find some data:</div><div><br></div><div>- I have a bunch of towns (let&#39;s call them group A)</div><div>- I retrieve the towns touching the group A (let&#39;s call them group B)</div>
<div>- I make the union of group A and group B</div><div>- I ask the towns covered by the resulting union<br clear="all"><br></div><div>For the moment, I use GDAL to do the processing like that:</div><div><br></div><div>- I use OGRGeometry::Union to make the union of group A towns</div>
<div>- I send a request to a postgis database with a ST_Touches where clause and the group A geometry as WKT</div><div>- I make the union of the resulting geometries with OGRGeometry::Union</div><div>- I send a request to a postgis database with a ST_Covers where clause and the union of group A and group B as WKT</div>
<div><br></div><div>My problem is that I don&#39;t retrieve all the towns I initially have to build my geometry.</div><div><br></div><div>If I try to do the same request totally in pgsql (union, touches and covers), I have the awaited result. If I compare the area of the geometry of the ST_Covers where clause (between generation with GDAL and computation by postgis), I ha ve the same area.</div>
<div><br></div><div>What could explain the difference in the result ? Precision loss in GDAL ? Precision loss because of the use of WKT ? Should I use WKB instead of WKT ? Should I do all my computations in postgis ?</div>
<div><br>-- <br>Alexandre Gacon<br>
</div>