Adding spatial extension to SQLite

06Dec07

I am starting a small project that aims in adding spatial functionality to SQLite. SQLite is an in-process SQL database, meaning that there are no clients or servers involved, thus no IPC overheads, no administrations. I just figured, a spatial extension for in-process database would be good to have around when you are going to write a GIS app or CADs.

The first step I have to take is to extend the SQL supported by SQLite command parsers to include (basic) syntaxes that are being defined in OpenGIS simple feature for SQL spec. A not-so-eazy undertaking, I know, but hey I have to start somewhere. So I fetched the SQLite source code and skim around. Turns out, SQLite uses Lemon, a pargen (parser-generator), to generate C code necessary to handle SQL commands. Following the breadcrumb, I download Lemon, compiled it and play around with it. I only got as far as building very simple grammar. Later I shall write that.

I’m not targeting much for the first phase of this work. Just a working parser that doesn’t throw parsing error when I do

CREATE TABLE table_with_geom {
  id INTEGER NOT NULL,
  name VARCHAR(20) NOT NULL, 
  loc GEOM NOT NULL  
};

Of course there are other ways to incorporate geometry columns to table (pre-existing or new) but lemme just try this first.

Hope this not going to be another abandoned project.

Advertisements


5 Responses to “Adding spatial extension to SQLite”

  1. Hi Barkah.
    Just tested an SQLite extension by a friend of mine. It will be released (LGPL3) soon, but it’s already very usable.
    Please let me know if you’re interested joining forces.
    All the best.
    Paolo

  2. Somehow i missed the point. Probably lost in translation 🙂 Anyway … nice blog to visit.

    cheers, Extemporaneous!

  3. I love your site! 🙂

    _____________________
    Experiencing a slow PC recently? Fix it now!

  4. Pretty nice post. I just stumbled upon your blog and wanted to say that I have really enjoyed
    surfing around your blog posts. After all I will be subscribing to your
    feed and I hope you write again soon!

  5. Unquestionably believe that which you said.
    Your favorite reason seemed to be on the internet the simplest thing to be aware of.
    I say to you, I certainly get irked while people consider worries that they just do not know about.
    You managed to hit the nail upon the top as
    well as defined out the whole thing without having side-effects ,
    people can take a signal. Will likely be back to get more.
    Thanks


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: