[Geoserver-devel] sorting WFS results

Hi,

we have set up GeoServer here in the UK and have connected it to a MySQL
spatial database.

The problem we have is that we would like to sort the results returned
by the WFS by date,lat,lon, currently they don't come back in a sorted
order. Has anyone got around this? I appreciate sorting is part of the
WFS spec, but it would be a nice to have!

Many thanks,

Norman Barker

Hi,

we have set up GeoServer here in the UK and have connected it to a MySQL
spatial database.

The problem we have is that we would like to sort the results returned
by the WFS by date,lat,lon, currently they don't come back in a sorted
order. Has anyone got around this? I appreciate sorting is part of the
WFS spec, but it would be a nice to have!

I have not heard anyone request this before, but I don't think it would be
that hard to do. We could add a vendor specific 'orderby' param, and pass
that off as a hint in the GeoTools query - datastores that could handle it
could turn it into sql.

You can go ahead and submit it to the JIRA task tracker (there are
instructions in the documentation), and someone might eventually get to
it. If you can do Java programming I can point you in the right
direction, or we can find someone who you could pay to implement it. I
don't think it would take more than a day or two to do.

Many thanks,

Norman Barker

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--

Hi,

Chris Holmes a écrit :

> I have not heard anyone request this before, but I don't think it would be that hard to do. We could add a vendor specific 'orderby' param, and pass that off as a hint in the GeoTools query - datastores that could handle it could turn it into sql.

Mmmh... this would break genericity IMHO (I am definitely not SQL-centric ;-). Why not provide a hook that would redirect the flow to an XSLT processor that could use <xsl:sort> (a kind of Cocoon-like pipeline) ?

Well, if the concern is sorting, there will be a penalty performance.

My 2 cents,

p.b.

Hi,

I used xsl:sort (we are requesting XML through Apache Cocoon to
Geoserver), and there is a big time penalty, so I wanted to move it more
towards the WFS and database.

If anyone can give some pointers we are happy to have a go at
implementing it!

Thanks,

Norman

On Thu, 2005-02-10 at 18:47 +0100, Pierrick Brihaye wrote:

Hi,

Chris Holmes a écrit :

> I have not heard anyone request this before, but I don't think it
would be that hard to do. We could add a vendor specific 'orderby'
param, and pass that off as a hint in the GeoTools query - datastores
that could handle it could turn it into sql.

Mmmh... this would break genericity IMHO (I am definitely not
SQL-centric ;-). Why not provide a hook that would redirect the flow to
an XSLT processor that could use <xsl:sort> (a kind of Cocoon-like
pipeline) ?

Well, if the concern is sorting, there will be a penalty performance.

My 2 cents,

p.b.

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Norman, Chris,

Sorting is part of the Filter 1.1, and WFS 1.1 specifications which have
been approved/proposed by the OGC. This is not currently supported by
Geoserver, but would be a great addition.

This would be a fairly easy addition after converting to the new XML
framework in Geotools.

David

On Thu, 2005-02-10 at 09:29, Chris Holmes wrote:

> Hi,
>
> we have set up GeoServer here in the UK and have connected it to a MySQL
> spatial database.
>
> The problem we have is that we would like to sort the results returned
> by the WFS by date,lat,lon, currently they don't come back in a sorted
> order. Has anyone got around this? I appreciate sorting is part of the
> WFS spec, but it would be a nice to have!

I have not heard anyone request this before, but I don't think it would be
that hard to do. We could add a vendor specific 'orderby' param, and pass
that off as a hint in the GeoTools query - datastores that could handle it
could turn it into sql.

You can go ahead and submit it to the JIRA task tracker (there are
instructions in the documentation), and someone might eventually get to
it. If you can do Java programming I can point you in the right
direction, or we can find someone who you could pay to implement it. I
don't think it would take more than a day or two to do.

>
> Many thanks,
>
> Norman Barker
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>

At 12:47 PM 2/10/2005, you wrote:

Hi,

Chris Holmes a écrit :

> I have not heard anyone request this before, but I don't think it would be that hard to do. We could add a vendor specific 'orderby' param, and pass that off as a hint in the GeoTools query - datastores that could handle it could turn it into sql.

Mmmh... this would break genericity IMHO (I am definitely not SQL-centric ;-).

It doesn't need to be that way, we could provide a fallback implementation in the same way that we implement spatial queries in datastores that are not backed by spatially aware back ends.

Once a sort capability was part of the DataStore api it would be up to DataStore writers to support it (either by handing the problem off as SQL or by some internal algorithm). So, it need not be a SQL-centric solution.

James

Hi,

James Macgill a écrit :

Mmmh... this would break genericity IMHO (I am definitely not SQL-centric ;-).

It doesn't need to be that way, we could provide a fallback implementation in the same way that we implement spatial queries in datastores that are not backed by spatially aware back ends.

Once a sort capability was part of the DataStore api it would be up to DataStore writers to support it (either by handing the problem off as SQL or by some internal algorithm). So, it need not be a SQL-centric solution.

This way, no problem at all :slight_smile: Thanks for this (important to me) clarification.

Cheers,

p.b.

Norman, Chris,

Sorting is part of the Filter 1.1, and WFS 1.1 specifications which have
been approved/proposed by the OGC. This is not currently supported by
Geoserver, but would be a great addition.

Cool, let's definitely do it. I have not yet seen the new specs, but
we should do what we can to get them implemented relatively soon. Is
there anything that looked very hard in them?

Chris

This would be a fairly easy addition after converting to the new XML
framework in Geotools.

David

On Thu, 2005-02-10 at 09:29, Chris Holmes wrote:
> > Hi,
> >
> > we have set up GeoServer here in the UK and have connected it to a MySQL
> > spatial database.
> >
> > The problem we have is that we would like to sort the results returned
> > by the WFS by date,lat,lon, currently they don't come back in a sorted
> > order. Has anyone got around this? I appreciate sorting is part of the
> > WFS spec, but it would be a nice to have!
>
> I have not heard anyone request this before, but I don't think it would be
> that hard to do. We could add a vendor specific 'orderby' param, and pass
> that off as a hint in the GeoTools query - datastores that could handle it
> could turn it into sql.
>
> You can go ahead and submit it to the JIRA task tracker (there are
> instructions in the documentation), and someone might eventually get to
> it. If you can do Java programming I can point you in the right
> direction, or we can find someone who you could pay to implement it. I
> don't think it would take more than a day or two to do.
>
> >
> > Many thanks,
> >
> > Norman Barker
> >
> >
> >
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide
> > Read honest & candid reviews on hundreds of IT Products from real users.
> > Discover which products truly live up to the hype. Start reading now.
> > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> > _______________________________________________
> > Geoserver-devel mailing list
> > Geoserver-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/geoserver-devel
> >

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--

The WFS 1.1 spec is not yet released, and is still under revisions. It
currently has GML 3.0 Level 0 (SFS for gml) and the Filter 1.1 spec as
the major changes.

The Filter 1.1 spec is really just an extension from what I could see
(only looked it over briefly). They added a couple operands, one of
which was SortBy.

I wouldn't recommend that Geoserver goes into GML 3.0 Level 0, as GML
3.0 is outdated, and would likely we replaced with a 3.1.1 version very
shortly after.

The Filter additions would be relatively simple, and map very closely to
simple SQL statements ... we would just have to add the Interfaces to
GT. The only issues for SortBy come when your data isn't in a DB (Shp,
GML) where this would have to occur in memory ... so something smart
would have to occur there.

David

Sorry for the brain dump ... just a couple thoughts

On Thu, 2005-02-10 at 14:19, Chris Holmes wrote:

> Norman, Chris,
>
> Sorting is part of the Filter 1.1, and WFS 1.1 specifications which have
> been approved/proposed by the OGC. This is not currently supported by
> Geoserver, but would be a great addition.
Cool, let's definitely do it. I have not yet seen the new specs, but
we should do what we can to get them implemented relatively soon. Is
there anything that looked very hard in them?

Chris

>
> This would be a fairly easy addition after converting to the new XML
> framework in Geotools.
>
> David
>
> On Thu, 2005-02-10 at 09:29, Chris Holmes wrote:
> > > Hi,
> > >
> > > we have set up GeoServer here in the UK and have connected it to a MySQL
> > > spatial database.
> > >
> > > The problem we have is that we would like to sort the results returned
> > > by the WFS by date,lat,lon, currently they don't come back in a sorted
> > > order. Has anyone got around this? I appreciate sorting is part of the
> > > WFS spec, but it would be a nice to have!
> >
> > I have not heard anyone request this before, but I don't think it would be
> > that hard to do. We could add a vendor specific 'orderby' param, and pass
> > that off as a hint in the GeoTools query - datastores that could handle it
> > could turn it into sql.
> >
> > You can go ahead and submit it to the JIRA task tracker (there are
> > instructions in the documentation), and someone might eventually get to
> > it. If you can do Java programming I can point you in the right
> > direction, or we can find someone who you could pay to implement it. I
> > don't think it would take more than a day or two to do.
> >
> > >
> > > Many thanks,
> > >
> > > Norman Barker
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > SF email is sponsored by - The IT Product Guide
> > > Read honest & candid reviews on hundreds of IT Products from real users.
> > > Discover which products truly live up to the hype. Start reading now.
> > > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> > > _______________________________________________
> > > Geoserver-devel mailing list
> > > Geoserver-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/geoserver-devel
> > >
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>

The WFS 1.1 spec is not yet released, and is still under revisions. It
currently has GML 3.0 Level 0 (SFS for gml) and the Filter 1.1 spec as
the major changes.

You sure? The ogc newsletter:
http://www.opengeospatial.org/press/?page=newsletterr#D1 says that they
were approved in nyc with an electronic vote, and would be released soon.

The Filter 1.1 spec is really just an extension from what I could see
(only looked it over briefly). They added a couple operands, one of
which was SortBy.

I wouldn't recommend that Geoserver goes into GML 3.0 Level 0, as GML
3.0 is outdated, and would likely we replaced with a 3.1.1 version very
shortly after.

Well are the 3.1.1 improvements relevant for Level 0? If they aren't then
we might not have to change anything. And generating 3.0 Level 0 should
be pretty trivial I think, just a few names change vs. 2.1

The Filter additions would be relatively simple, and map very closely to
simple SQL statements ... we would just have to add the Interfaces to
GT. The only issues for SortBy come when your data isn't in a DB (Shp,
GML) where this would have to occur in memory ... so something smart
would have to occur there.

I'd say to start just throw an exception, we can figure out the smarts
later - like when we have an embedded spatial db to dump the stuff into
and cache the non-db datastores.

Chris

David

Sorry for the brain dump ... just a couple thoughts

On Thu, 2005-02-10 at 14:19, Chris Holmes wrote:
> > Norman, Chris,
> >
> > Sorting is part of the Filter 1.1, and WFS 1.1 specifications which have
> > been approved/proposed by the OGC. This is not currently supported by
> > Geoserver, but would be a great addition.
> Cool, let's definitely do it. I have not yet seen the new specs, but
> we should do what we can to get them implemented relatively soon. Is
> there anything that looked very hard in them?
>
> Chris
>
> >
> > This would be a fairly easy addition after converting to the new XML
> > framework in Geotools.
> >
> > David
> >
> > On Thu, 2005-02-10 at 09:29, Chris Holmes wrote:
> > > > Hi,
> > > >
> > > > we have set up GeoServer here in the UK and have connected it to a MySQL
> > > > spatial database.
> > > >
> > > > The problem we have is that we would like to sort the results returned
> > > > by the WFS by date,lat,lon, currently they don't come back in a sorted
> > > > order. Has anyone got around this? I appreciate sorting is part of the
> > > > WFS spec, but it would be a nice to have!
> > >
> > > I have not heard anyone request this before, but I don't think it would be
> > > that hard to do. We could add a vendor specific 'orderby' param, and pass
> > > that off as a hint in the GeoTools query - datastores that could handle it
> > > could turn it into sql.
> > >
> > > You can go ahead and submit it to the JIRA task tracker (there are
> > > instructions in the documentation), and someone might eventually get to
> > > it. If you can do Java programming I can point you in the right
> > > direction, or we can find someone who you could pay to implement it. I
> > > don't think it would take more than a day or two to do.
> > >
> > > >
> > > > Many thanks,
> > > >
> > > > Norman Barker
> > > >
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > SF email is sponsored by - The IT Product Guide
> > > > Read honest & candid reviews on hundreds of IT Products from real users.
> > > > Discover which products truly live up to the hype. Start reading now.
> > > > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> > > > _______________________________________________
> > > > Geoserver-devel mailing list
> > > > Geoserver-devel@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/geoserver-devel
> > > >
> >
> >
> >
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide
> > Read honest & candid reviews on hundreds of IT Products from real users.
> > Discover which products truly live up to the hype. Start reading now.
> > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> > _______________________________________________
> > Geoserver-devel mailing list
> > Geoserver-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/geoserver-devel
> >

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--