Solved! The problem was because my GDAL/OGR had not been compiled with GEOS.<br><br><div class="gmail_quote">2012/10/10 Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org" target="_blank">even.rouault@mines-paris.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le mercredi 10 octobre 2012 19:48:07, Alisson Barbosa a écrit :<br>
<div class="im">> Hello, guys!<br>
><br>
> I'm truggling through a rough moment here...<br>
> I have this piece of code in a project that I work on:<br>
><br>
> if(basinPolygon->Intersects(luPolygon))<br>
> {<br>
> OGRGeometry *result = basinPolygon->Intersection(luPolygon);<br>
> if(result)<br>
> newLayer.push_back(result);<br>
> }<br>
><br>
> Somehow, the Intersects function returns true for those polygons<br>
> (basinPolygon and luPolygon) (i.e. there is a intersection area between<br>
> them), but<br>
><br>
> basinPolygon->Intersection(luPolygon);<br>
><br>
> Always returns NULL! why is it returning NULL if Intersects returns true?!<br>
> This is a mistery for me!<br>
<br>
</div>The likely cause is documented in the page you quoted<br>
<br>
About Intersection(): "This method is built on the GEOS library, check it for<br>
the definition of the geometry operation. If OGR is built without the GEOS<br>
library, this method will always fail, issuing a CPLE_NotSupported error."<br>
<br>
About Intersects(): "If GEOS is enabled, then this is done in rigerous fashion<br>
otherwise TRUE is returned if the envelopes (bounding boxes) of the two<br>
features overlap."<br>
<br>
Take your symptoms and the above highlighted precisions, and you should have<br>
the answer.<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Alisson Barbosa<div>Systems Analyst - FUNCEME<div><span lang="en"><span title="Clique para mostrar traduções alternativas">M.Sc. in Computer Science</span><span title="Clique para mostrar traduções alternativas"> - MACC</span></span><div>
<div>Graduate in Computer Science - UECE</div></div></div><br></div><br>