Hi,
Being that i’m kind of new to GeoServer, i’m looking for some ideas for how best to implement the ability to basically send a query through WMS to PostGIS but still have it processed as if it was a defined layer?
My scenario is that i have to be able to query any individual (or group or) geometry-row(s) from a PostGIS table that contains millions of rows and build a GeoTiff. It seems filtering a layer in GeoServer for such a large amount of data isn’t possible and given the huge (and growing) number of rows, defining static layers in GeoServer is also infeasible?
I think, ideally, i’d like to be able to write a virtual OWS that is dynamic, which just ships the URL’s path and query string to my fully custom service. Something like:
[http://localhost:8080/geoserver/[](http://localhost:8080/geoserver/[)*let/me/put/anything/here*]/wms?request=GetMap
BUT, since all i really need is a GeoTiff of any row(s) of the table, an alternate approach might be if i can create a custom data store that is similar to the GeoTiff store yet mine will be dynamic based on the filename in the URL path.
If you can just point me to an example of the code i can use as a starting point, i can probably take it from there.
Any help will be greatly appreciated.
Thanks
–nix
GeoServer 2.2.4
Linux
On Thu, Feb 14, 2013 at 4:21 AM, Robert Nix <robert@anonymised.com> wrote:
Hi,
Being that i’m kind of new to GeoServer, i’m looking for some ideas for how best to implement the ability to basically send a query through WMS to PostGIS but still have it processed as if it was a defined layer?
My scenario is that i have to be able to query any individual (or group or) geometry-row(s) from a PostGIS table that contains millions of rows and build a GeoTiff. It seems filtering a layer in GeoServer for such a large amount of data isn’t possible and given the huge (and growing) number of rows, defining static layers in GeoServer is also infeasible?
Before delving into programming options, have you looked into:
Cheers
Andrea
–
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
Excellent, Andrea!
SQLViews look exactly like what i need (though i haven’t gotten it to work yet … and i was kinda looking forward to some GeoServer coding 
It seems to me that CQL is still doing the filtering in GeoServer?
Thanks
–nix
On Feb 14, 2013, at 02:15, Andrea Aime <andrea.aime@anonymised.com> wrote:
On Thu, Feb 14, 2013 at 4:21 AM, Robert Nix <robert@anonymised.com> wrote:
Hi,
Being that i’m kind of new to GeoServer, i’m looking for some ideas for how best to implement the ability to basically send a query through WMS to PostGIS but still have it processed as if it was a defined layer?
My scenario is that i have to be able to query any individual (or group or) geometry-row(s) from a PostGIS table that contains millions of rows and build a GeoTiff. It seems filtering a layer in GeoServer for such a large amount of data isn’t possible and given the huge (and growing) number of rows, defining static layers in GeoServer is also infeasible?
Before delving into programming options, have you looked into:
Cheers
Andrea
–
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
On Thu, Feb 14, 2013 at 2:42 PM, Robert Nix <robert@anonymised.com> wrote:
Excellent, Andrea!
SQLViews look exactly like what i need (though i haven’t gotten it to work yet … and i was kinda looking forward to some GeoServer coding 
It seems to me that CQL is still doing the filtering in GeoServer?
No, every kind of filter we have is translated back in SQL, of course, limited
by the abilities of our SQL translators
Cheers
Andrea
–
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
Sorry, I might be misunderstanding filters. I was thinking of this:
Unless otherwise specified, none of the filter functions in this reference are understood natively by the data stores, and thus expressions using them will be evaluated in-memory.
So i assumed that other types of filters (except SQLViews) would simply be translations to this type of filtering. Sorry for my newbie assumptions.
Also, when i try to create a SQLView, i get an error:
- Failed to create SQL view: ERROR: syntax error at or near “)” Position: 88
My view is simply:
select id, fid, the_geom from mytable where fid = %fid%
If i remove the where clause (which makes the SQLVIew useless?), i can create it but accessing it with the &viewparams=fid:102376549 i get:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Rendering process failed
java.io.IOException
null
java.util.ArrayList cannot be cast to java.lang.String
–nix
On Feb 14, 2013, at 08:44, Andrea Aime <andrea.aime@anonymised.com> wrote:
On Thu, Feb 14, 2013 at 2:42 PM, Robert Nix <robert@anonymised.com> wrote:
Excellent, Andrea!
SQLViews look exactly like what i need (though i haven’t gotten it to work yet … and i was kinda looking forward to some GeoServer coding 
It seems to me that CQL is still doing the filtering in GeoServer?
No, every kind of filter we have is translated back in SQL, of course, limited
by the abilities of our SQL translators
Cheers
Andrea
–
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
On Thu, Feb 14, 2013 at 4:00 PM, Robert Nix <robert@anonymised.com> wrote:
Sorry, I might be misunderstanding filters. I was thinking of this:
Unless otherwise specified, none of the filter functions in this reference are understood natively by the data stores, and thus expressions using them will be evaluated in-memory.
So i assumed that other types of filters (except SQLViews) would simply be translations to this type of filtering. Sorry for my newbie assumptions.
Also, when i try to create a SQLView, i get an error:
- Failed to create SQL view: ERROR: syntax error at or near “)” Position: 88
My view is simply:
select id, fid, the_geom from mytable where fid = %fid%
Did you declare the fid parameter in the params table, and set a proper default value for it?
If i remove the where clause (which makes the SQLVIew useless?), i can create it but accessing it with the &viewparams=fid:102376549 i get:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Rendering process failed
java.io.IOException
null
java.util.ArrayList cannot be cast to java.lang.String
This one does not help, we need the full stack trace to make head or tails of it.
Please enable “verbose exception reporting” in the server config panel and try again
Cheers
Andrea
–
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