On Tue, Mar 10, 2015 at 7:45 PM, Martin Davis <mtnclimb@anonymised.com> wrote:
When you say "encode the search queries accordingly" do you mean leave off
the spatial filter entirely? That won't work in my case, there is too much
data to not use an index. I think what I want is a way to force the use of
another geometry column (but this seems like it would have to be a bit of a
hack - ie. look around to see if there was another geometry column
available and use that).
This sounds a bit like your second suggestion. A bbox query against the
"original geometry" would work I think. Not sure how you would identify
the "original geometry" though? It would have to be present in the SQLView
columns, presumably - and then determined by just assuming the "other
geometry column" was the one to filter against? Or would require UI/model
changes to allow user to pick which geometry column is to be filtered by.
You would not identify the original geometry, GeoServer does not parse the
sql view at all, does not know anything about it, and I believe it should
stay that way, because doing otherwise would open a big can on worms (sql
parsing, database differences, understanding calling stored procedures...
ooof)
Nope, what I'm suggesting is more similar to the mapserver way where they
provide a "box" template parameter that will be replaced with a real bbox:
DATA "the_geom from (select g.gid, ST_Union(g.the_geom, 10.0) as
the_geom from geotable g where ST_Intersects(g.geom,!BOX!)) as
subquery using unique gid using srid=4326"
Now... I find the above still quite unsatisfactory, as you are forcing a
intersection test even when you don't have one in your original query,
and you have to make up a non existent bbox.
Maybe something like this instead (open to alternative syntax):
select .... from geotable where .... %BOX%{and ST_Intersects(g.geom,$bbox)}
you know, a bit of sql that would be explanded only if we find that the
query condition we have going on can actually be
matched to some bbox (there is a filter visitor taking a filter and
returning a bbox that would contain its results).
This would be the "primary filter", the encoding of the full ifilter would
still happen against the computed geometry like today,
but it would end up being a "secondary filter" that just makes sure we
return the right features (the fact the original geometry
intersects the bbox does not mean its centroid matches the original query,
and we need to provide correct responses, as
this would also be used for WFS)
Probably not a quick hack, but doable.
Cheers
Andrea
--
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
-------------------------------------------------------