[Featureserver] SQLite

Brent Pedersen bpederse at gmail.com
Tue Jul 24 14:26:04 EDT 2007


On 7/24/07, Christopher Schmidt <crschmidt at metacarta.com> wrote:
> On Mon, Jul 23, 2007 at 03:07:58PM -0700, Brent Pedersen wrote:
> > hi, i'm on an sqlite kick. so i've uploaded an sqlite datasource for
> > feature server:
> > http://dev.featureserver.org/ticket/3
> > and the code:
> > http://dev.featureserver.org/attachment/ticket/3/SQLite.py
> > it's just cribbed from DBM.py and PostGIS.py so there's  likely stuff
> > in there from both of those that shouldnt be, but it's functional.
> >
> > the justification is that it's more portable than postgis, more easily
> > updated outside of FeatureServer than DBM, and accessible via any
> > language.
> > it has no extra dependencies in python2.5. and requires pysqlite2 in <=2.4
> >
>
> Brent --
>
> Thanks! I had originally been planning to do a sqlite DataSource, but
> decided against it when I realized that earlier versions of Python
> didn't have the neccesary support built in. It's good that 2.5 does, and
> I'll definitely work on getting this in soon -- hopefully later this
> week.
>
> Couple quick comments from a short readthrough:
>
>  * in general, we've avoided decorator syntax to maintain backwards
>    compatibility with 2.3. (I was almost convinced I could drop this,
>    until I found out that the IronPython and Jython ports are both based
>    off something like 2.1. Sigh.) if it's possible to change the
>    '@property' to something else, that would be cool. (If you can't suss
>    it out, I can look at it when I get time.)
>  * It looks like you might have reimplemented feature.get_bbox(),
>    defined in DataSource.__init__, with your DataSource._bbox -- though
>    I'm not 100% sure.
>  * Oh man, it even supports open-ended attributes. sweet. I don't think
>    we even bothered to do this with the standard PostGIS stuff...
>    Though it looks like that might mean it doesn't support attribute
>    queries. I might make that behavior a switch on the DS, so that it'll
>    just shove everything in the main table if it is told to.
>

>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Featureserver mailing list
> Featureserver at openlayers.org
> http://featureserver.org/mailman/listinfo/featureserver
>
hi chris,
i've got rid of the decorator, and used get_bbox(). the open-ended
attributes do make the attribute queries more complex.
one option is to add to Request.py something like :
-                elif key in queryable:
+                elif key in queryable or ds.allow_open_queries:
                     action.attributes[key] = value

so attribute queries are possible from a config param but will require
considerable changes to SQLite.feature_predicates() and
.value_formats()
and because i keep getting confused when i try to make those
changes, i'll wait til you add the switch on the DS to figure them out.


> All in all, thanks a ton for this. We should have written it in the
> first place, but hey, there's only so much you can do :)

well, it's mostly just small changes to your code.



More information about the Featureserver mailing list