[ZMapServer-Developers] Re: [ZMapServer-Users] Need help with PCL/ZCO Query
Status: Alpha
Brought to you by:
sgillies
|
From: Sean G. <sgi...@fr...> - 2005-01-28 22:33:31
|
Forwarding this to the developers list ... comments at bottom. On Jan 27, 2005, at 2:57 PM, Chris Holmes wrote: >> Etienne, >> >> You should allow_class(Query) instead of IQuery. And make sure to >> restart, although I am sure you are doing that. >> >> Please keep in mind that I am evaluating a couple possible query >> interfaces for ZCO which will extend PCL like the ZCO.MapRenderer >> extends the underlying PCL functionality. One possibility is for this >> query interface to behave like the Python DB API. Another possibility >> is for the queries to act more like the OGC's GetFeatureInfo request. >> Currently, I am leaning towards this second way. > > I would definitely recommend the OGC approach, but if you're thinking > of > OGC style I would recommend GetFeature of WFS instead of > GetFeatureInfo of > WMS. GetFeatureInfo was sort of added to provide some additional info > for > WMS, whereas the GetFeature query is the central part of the WFS. It > allows complex filters, handles, maxFeatures, specific properties, ect. > See > http://svn.refractions.net/geotools/geotools/trunk/gt/module/main/src/ > org/geotools/data/Query.java > for how we did it in GeoTools (GeoAPI is quite similar I am sure). Or > http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd which contains the > xml > schema for a Query (which gt2 was modeled upon, though it currently > contains a few additions, like coordinate systems stuff, which will be > in > 1.1 I am pretty sure). > > best regards, and keep up the great work > > Chris > Chris, I'm convinced to take the GetFeature route and have spent some time today outlining a Python-ic way of expressing query filters that will be a lot like the rule filter expressions under cartography.mapping.Rule and ZCO.Style. This means that a filter would be a string and simple usage would be something like this shape = spatial.Polygon(...) filter = 'f.the_geom.intersects(shape)' names = ['*'] # all attributes results = layer.query(names, filter, maxfeatures=-1) # no limit for result in results: ... There are some cases where the filter would be evaluated in Python, and for the cases that the layer pointed to some external WFS or a PostGIS database I think the filter expression should be munged to XML or SQL. This would mean using the Python parser on the filter strings ... I'll have to consider whether we are not better off with Filter objects. I'll take a closer look at GeoTools2 over the weekend. Thanks for the input! cheers, Sean -- Sean Gillies sgillies at frii dot com http://users.frii.com/sgillies |