[geos-devel] Looking for the closest point
bontepaarden at gmail.com
Tue Mar 4 03:04:38 PST 2014
Unfortunately I can't use SpatiaLite or PostGIS.
For now I do this:
1) Break all lines into separate linestrings
2) Search around my location for 1 or more linestrings
3) Create a perpendicular line from my location to the found linestring
4) Use the linestring with the shortest perpendicular line.
I was just wondering if GEOS can already do this.
*Paul Meems *
Release manager, configuration manager
and forum moderator of MapWindow GIS.
Owner of MapWindow.nl - Support for
Dutch speaking users.
*Join us at the MapWindow GIS Conference 2014
<http://geogis.detek.unideb.hu/TKonferencia/2014/>, in Debrecen Hungary*
2014-03-04 10:50 GMT+01:00 Rémi Cura <remi.cura at gmail.com>:
> if you have access to sql,
> you don't need geos.
> You could simply convert line to point then order by distance and get the
> Using postgis it would be quiet easy.
> You lines appears to be big, so a simple euclidian distance may give you
> wrong result, you would need a geographical distance.
> 2014-03-03 10:35 GMT+01:00 Paul Meems <bontepaarden at gmail.com>:
>> Hi List,
>> We use with MapWinGIS (C++ ActiveX control) GDAL with GEOS.
>> I've got a linestring (stream) and need to know the closest point at that
>> stream from a specific location.
>> What I need is the index of the point in the stream and the distance from
>> the location to that point.
>> We currently have a custom GetClosestPoint method which is not using
>> GEOS, but that is not working when a long linestring is close to the
>> location but the points are far away.
>> For example my line has two points, starts in Amsterdam and ends in
>> Paris. My location is near Antwerp.
>> Does GEOS have a better method for this? I did searched using Google and
>> found several methods/pages but I'm not sure what to use.
>> I also want to make it a generic method that will work with all types of
>> lines and polygons.
>> Any advice would be much appreciated.
>> *Paul Meems *
>> Release manager, configuration manager
>> and forum moderator of MapWindow GIS.
>> Owner of MapWindow.nl - Support for
>> Dutch speaking users.
>> *Join us at the MapWindow GIS Conference 2014
>> <http://geogis.detek.unideb.hu/TKonferencia/2014/>, in Debrecen Hungary*
>> geos-devel mailing list
>> geos-devel at lists.osgeo.org
> geos-devel mailing list
> geos-devel at lists.osgeo.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the geos-devel