[gdal-dev] Snap point to vertex/segment

Dmitry Baryshnikov bishop.dev at gmail.com
Wed Dec 10 17:12:47 PST 2014


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.rouault at 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 at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20141211/4fe66387/attachment.html>


More information about the gdal-dev mailing list