[gdal-dev] Snap point to vertex/segment

Federico Jurio federicojurio at suremptec.com.ar
Fri Dec 12 07:01:46 PST 2014


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.dev at 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.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
>
>

-- 
Federico Jurio
SUR Emprendimientos Tecnológicos

Perú 345  Piso 5to Oficina "B" (C1067AAG)
Ciudad de Buenos Aires, Argentina
Tel. +54 (11) 4342-2976/84
federicojurio at suremptec.com.ar
www.suremptec.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20141212/c353cf1a/attachment-0001.html>


More information about the gdal-dev mailing list