[Geoserver-users] KNN k-nearest neighbor

hi,
I want to cacluate the KNN (K-nearest neighor). I look for WFS filter document ,and it seems there are no such operators. Thus it may not be in geoserver, what should I do, should I implement it myself? if so, how?
Thanks a lot.

Vicky


[广告] 金秋最关注楼盘-房不胜房

Can any one help me? Thanks a lot.
在2008-11-17,“ruan.tong” ruan.tong@anonymised.com 写道:

hi,
I want to cacluate the KNN (K-nearest neighor). I look for WFS filter document ,and it seems there are no such operators. Thus it may not be in geoserver, what should I do, should I implement it myself? if so, how?
Thanks a lot.

Vicky


[广告] 金秋最关注楼盘-房不胜房


[广告] 金秋最关注楼盘-房不胜房

Hi Vicky,

No one else has replied with a ready-made solution.

If you would like to let me know about the type of data you are
working with (either on or off the list) I will see if I can help out.
As I mentioned previously, I would also like to have this analysis
available.

Michael

2008/11/20 ruan.tong <ruan.tong@...887...>:

Can any one help me? Thanks a lot.
在2008-11-17,"ruan.tong" <ruan.tong@...887...> 写道:

hi,
  I want to cacluate the KNN (K-nearest neighor). I look for WFS filter
document ,and it seems there are no such operators. Thus it may not be
in geoserver, what should I do, should I implement it myself? if so, how?
  Thanks a lot.

Vicky

________________________________
[广告] 金秋最关注楼盘-房不胜房

________________________________
[广告] 金秋最关注楼盘-房不胜房
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

ruan.tong ha scritto:

Can any one help me? Thanks a lot.
ÔÚ2008-11-17£¬"ruan.tong" <ruan.tong@anonymised.com> дµÀ£º

          hi,
      I want to cacluate the KNN (K-nearest neighor). I look for WFS
    filter document ,and it seems there are no such operators. Thus it
    may not be in geoserver, what should I do, should I implement it
    myself? if so, how?

You mean this?
http://en.wikipedia.org/wiki/K-nearest_neighbor_algorithm

There is no way you can do such a thing with WFS, it's just beyond its
scope. WFS lives by these two limitations (among the others):
- it just returns xml element that comply with the schema of the feature
   type queried. To make a parallel with SQL, it's like doing a select in
   which you can just choose which attributes to output, but you cannot
   use expressions, aggregations, and so on. Actually it's even worse,
   since if the schema says an attribute must be there you'll get it
   in the output no matter if you asked for it or not
- filtering works on a feature per feature basis, each feature gets
   evaluated by the filters in total isolation, you cannot do the
   self join needed to do a nearest neighbour operation. Put in other
   terms, a WFS filter can only see one feature at a time, never sees
   the whole collection

What you're asking for is the domain of another OGC specification,
namely WPS (Web Processing Service) which is totally hands free and
can do basically what it wants with the input data, including performing
joins if there is need for that. Unfortunately at the moment we
don't ship with a WPS implementation (we're working on it) so if
you need K-nearest neighbour right now you can either try to roll out
your custom extension (by coding it) or try to use 52N WPS implementation (and again code in Java your KNN filter, since they ship
with only 3 sample processes or so):
http://52north.org/index.php?option=com_projects&task=showProject&id=21&Itemid=127

Hope this helps
Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.