[OpenLayers-Users] Get features within x distance

Nicholas Efremov-Kendall n.e.kendall at gmail.com
Thu Jun 16 14:44:38 EDT 2011


Hi Coup,

You could try digging through the YQL library or another web-based service
like tinygeocoder to get the coordinates client-side. Not sure if this
helps.

On Thu, Jun 16, 2011 at 1:02 PM, Coup Coup <tencoupons55 at yahoo.com> wrote:

> Hi,
> I am using OpenLayers client side with a postGIS backend and have a map of
> county and zip layers that are hidden (each layer has one feature).
> I want to show them when the user requests them in a form GUI.
>
> To do this I need to :
> A) Obtain the centroid of the zip inputted from the features' geometry of
> the corresponding layer.
> B) Loop through the layers and perform a distance query on the centroid as
> compared to each layer's geometry to determine if it resides within x miles.
> C) Show the layer when the distance query returns true.
>
> I know how to toggle layer visibility (C). And I know how to access
> individual layers. I could use Ajax to perform the distance queries in
> POSTGIS, but would like to know how to do it client side so I can gauge
> performance (and gain more knowledge working with OpenLayers).
>
> Can anyone provide any insight or examples specifically in referencing
> geometries from layers and performing distance queries on them?
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110616/9d73b968/attachment.html


More information about the Users mailing list