[OpenLayers-Users] SelectFeature
Tim Schaub
tschaub at openplans.org
Thu Oct 11 21:55:39 EDT 2007
I've added a geometry.intersects method in my geom sandbox. You can
mess around with this intersection example to see how it works:
http://dev.openlayers.org/sandbox/tschaub/geom/examples/intersects.html
Note that without a spatial index, it's hugely a hugely inefficient way
to check for intersections between every feature on a layer - but with
this code we can add functionality that lets you select features by any
other feature (or click location).
The intersects method passes 470 some of the 500 or so geos intersection
tests (see the test directory in that sandbox). When I get a chance,
I'll fix the problem with intersecting multi-points.
Some form of this will likely make it in to 2.6.
Tim
Lourens Veen wrote:
> On Tuesday 09 October 2007 19:57:13 staff-gmail wrote:
>> Selection by lat/lon can be done by using a point in polygon
>> algorithm which we've found to be pretty fast (it is in java and c++,
>> we'll see in Ruby).
>
> Well, for an OL client-side tool it would have to be JavaScript. But of
> course, the language doesn't affect the complexity of the algorithm.
>
>> Using this selection method allows you to
>> specify which object groups you're testing on which means you can
>> filter down the search space and avoid the "layers" problem.
>
> Whoa, now you're going too fast. You would still need to have some kind
> of spatial index for that, right. If you're going to exclude groups of
> objects, you need to know that you can do that without throwing away
> solutions.
>
>> And if you name your svg element id's with the database id's, then
>> your lat/long lookup can be translated back to a DOM operation, if
>> that makes any sense.
>
> So you propose to send the mouse click to the server, do the lookup
> server-side, and then send the resulting features back to the client?
>
> Then you might as well use a WMS and query it...
>
> Lourens
>
More information about the Users
mailing list