Thank you for the answers guys. My system only have gdal/ogr so i can't use PostGIS. I tried to use the Project <http://www.gdal.org/classOGRSimpleCurve.html#aed4f22dceb31894dd1b12cdf9f4bb645> method from OGRSimpleCurve class but always return -1 because i'm creating the geometry using OGR instead of GEOS library. Regards
On Wed, Dec 10, 2014 at 10:12 PM, Dmitry Baryshnikov <bishop....@gmail.com> wrote: > > Hi Federico, > 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. > Best regards, > Dmitry > 11 дек. 2014 г. 0:56 пользователь "Even Rouault" < > even.roua...@spatialys.com> написал: > >> Le mercredi 10 décembre 2014 22:28:48, Federico Jurio a écrit : >> > Dear all, i'm trying to make a snapping tool to project new points in a >> > layer to the nearest geometry. First of all, when i activate my tool i >> make >> > a buffer of all the geometries in the layer. If the point that i'm >> trying >> > to add in the layer is within the buffer i want to move this point to >> the >> > nearest vertex/segment in that geometry but i don't know how to find the >> > new coordinates. >> > It would be helpful if someone could help me! >> >> Frederico, >> >> Available as ST_Snap in PostGIS (http://postgis.org/docs/ST_Snap.html), >> that >> relies on GEOSSnap : http://geos.osgeo.org/doxygen/geos__c_8h_source.html >> >> Would be easy to add in OGR geometry class as well (relying on GEOSSnap) >> >> Even >> >> -- >> Spatialys - Geospatial professional services >> http://www.spatialys.com >> _______________________________________________ >> gdal-dev mailing list >> gdal-dev@lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/gdal-dev > > -- Federico Jurio SUR Emprendimientos Tecnológicos Perú 345 Piso 5to Oficina "B" (C1067AAG) Ciudad de Buenos Aires, Argentina Tel. +54 (11) 4342-2976/84 federicoju...@suremptec.com.ar www.suremptec.com
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev