<div dir="ltr">Thank you for the answers guys.<div>My system only have gdal/ogr so i can't use PostGIS. I tried to use the <a href="http://www.gdal.org/classOGRSimpleCurve.html#aed4f22dceb31894dd1b12cdf9f4bb645">Project</a> method from OGRSimpleCurve class but always return -1 because i'm creating the geometry using OGR instead of GEOS library.</div><div>Regards</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 10, 2014 at 10:12 PM, Dmitry Baryshnikov <span dir="ltr"><<a href="mailto:bishop.dev@gmail.com" target="_blank">bishop.dev@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Hi Federico,<br>
Does the Project method of OGRLineString not suits you? The point snap to nearest point, the point on line via the project, and point on polygon via cast the outer or inner rings to line and project too.<br>
Best regards,<br>
Dmitry</p>
<div class="gmail_quote">11 дек. 2014 г. 0:56 пользователь "Even Rouault" <<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>> написал:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Le mercredi 10 décembre 2014 22:28:48, Federico Jurio a écrit :<br>
> Dear all, i'm trying to make a snapping tool to project new points in a<br>
> layer to the nearest geometry. First of all, when i activate my tool i make<br>
> a buffer of all the geometries in the layer. If the point that i'm trying<br>
> to add in the layer is within the buffer i want to move this point to the<br>
> nearest vertex/segment in that geometry but i don't know how to find the<br>
> new coordinates.<br>
> It would be helpful if someone could help me!<br>
<br>
Frederico,<br>
<br>
Available as ST_Snap in PostGIS (<a href="http://postgis.org/docs/ST_Snap.html" target="_blank">http://postgis.org/docs/ST_Snap.html</a>), that<br>
relies on GEOSSnap : <a href="http://geos.osgeo.org/doxygen/geos__c_8h_source.html" target="_blank">http://geos.osgeo.org/doxygen/geos__c_8h_source.html</a><br>
<br>
Would be easy to add in OGR geometry class as well (relying on GEOSSnap)<br>
<br>
Even<br>
<br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a><br></div></div>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Federico Jurio<br><div>SUR Emprendimientos Tecnológicos<br></div><div><br></div><div>Perú 345  Piso 5to Oficina "B" (C1067AAG)<br></div><div><div>Ciudad de Buenos Aires, Argentina</div><div>Tel. +54 (11) 4342-2976/84</div></div><div><div><a href="mailto:federicojurio@suremptec.com.ar" target="_blank">federicojurio@suremptec.com.ar</a></div><div><a href="http://www.suremptec.com" target="_blank">www.suremptec.com</a></div></div></div></div>
</div>