On Mon, May 19, 2014 at 5:16 PM, Mauro Bartolomeoli <
[email protected]> wrote:
> Hi,
> recently we tried to implement a WPS process to do paginated extraction of
> sorted unique attribute values from features.
>
> The approach was to apply a UniqueVisitor to a Query object with sortBy
> and limits applied.
> The problem with this approach is that the current semantic for such
> implementation is:
> - first apply the sort and limits
> - then apply the visitor (in this case unique)
>
>
> This is not the desired behaviour for us, we would need:
> - first apply the sort and unique
> - then apply the limits
>
> Now my question is: is the current behaviour the desired semantic, or just
> a constraint of the aggregation by visitor implementation for which the
> visitor needs to be applied only after feature fetching has happened (apart
> from cases like JDBC where the visitor can be implemented directly on the
> database)?
>
> Just to decide if we need to reimplement the process or we can try to
> change the Geotools semantic.
>
Hmm... interesting question.
In terms of API, we have a collection, that has a certain content defined
by the Query object.
And then we have a Visitor, that can visit the contents of the collection,
and it's completely
unaware of the Query.
Stores can decided to avoid doing the full scan of the collection, and
optimized out the
visitor some way, like the JDBCDataStore does, but they have to do so that
the results
are the same as if the visit happened in memory.
Given this, I don't think it's possible to change the way the store works
now, nor change
the Visitor semantic, because to do so, we'd need to provide the visitor
with the Query object,
so that in memory visits can take into account sort and paging.
That said, I see how the current behavior is not desirable for extracting a
large number of
unique values, and you're not the first to have issues with it, there was a
recent thread
with the very same issue reported.
I'm wondering if the way to go would be to add a SortBy[] and a start/limit
to the UniqueVisitor,
to specify how the results should be paged, implement memory support for
them for all
stores to use, and then have JDBCDataStore consider those when encoding the
visitor
into a SQL query
Cheers
Andrea
--
==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
-------------------------------------------------------
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel