[postgis-devel] trying PostGIS online

Marc Jansen jansen at terrestris.de
Tue Dec 15 23:12:01 PST 2009

Hi Nicklas, Hi list,

I love the idea of trying SQLs in a browser and instantly get a spatial 
result! Actually I have built an OpenLayers [1] client for an upcoming 
book of mine [2] that does this. Furthermore I wanted to transform that 
special bit of code (the interactive terminal and the OpenLayers client) 
into an OpenSource application. Actally I recently submitted a talk to 
the german conference FOSSGIS [3] -- organized by the local german 
chapter FOSSGIS [4] of the OSGEO -- that wants to discuss the project 
and further possible development. The talk is not yet accepted.

I took a slightly different appproach (Mainly because the initiual 
application was being developed for the book):

    * One opens the address of the application in the browser
    * You see a world map (an external WMS) in a minimal OpenLayers-Client
    * below the Map there is a terminal where you can enter more or less
      any SQL
    * Upon submission of the form data is sent via AJAX to aserver side
    * that script does some checking and finally queries the database
      and gioves the result back to the client
    * if the result of the  query is a geometry, it gets displayed on
      the map as a vector geometry instantly
    * if the result is a meta-infomation (eg ST_Area, etc.) That Info
      is  displayed in the client.
    * There are some restrictions currently (allowed projections, number
      of returned records and the like)

I have working code for all of the above, but have to wait to publish 
the details until the book is finally there (that would be February 
2010, hopefully). All the code in the book will be released under the 
BSD license.

I see a big potential for an application like that (or the one you 
describe), so please contact me on- or offlist if you see any chance on 
working together on something like this.

Best regards,

PS: Please excuse that I start a new thread because I couldn't reply 
directly to the original email.

[1] http://openlayers.org
[2] german only: 
[3] http://www.fossgis.de/konferenz/wiki/Main_Page
[4] http://www.fossgis.de/

Original email from Nicklas:

I have had an idea about a site where people can try and test postgis 
Working with spatial data in db-environment I think a lot of people 
seems like abstract and maybe suspect and
their picture of analyse spatial data is often tightly connected to some 

So, now I have come up with something as a start.

The basic idea is that a sql-string generates a view or a table that 
mapserver produces a transparent gif-image from.
The idea of working with transparent images is that you can produce many 
(three in the application of today) images that will be put on top of 
each other. The first defines the extent and the others will be showed 
on top.

 From this concept I continued and found a way of easily producing 
The idea is that a tutorial (defined by some objects in a html-file) 
controls 4 objects in the window (see attached picture):
* the text in a describing text -holder to the right in the screen
* the text in the sql-string text area, so the user can just click a 
button to see the result, modify it and try again
* Background map, One of the maps in the dataabse, shown "as is" in full 
extent or in extent defined by Map1
* An image, it is possible to, instead of the map give the url to an 
image. Might b convinient for showing something in the tutorial

 From this tools it should be easy, bith to present all the PostGIS 
functions and explain new things like Geography-type or wkt-raster.

I think it could give many sql-gurus an aha-experiense to see the 
possibilities of analysing spatial data with sql.

I have bought postgisonline.org for the purpose. (Thought it was best 
buying it before discussing it in public :-)
There is also other suggestions but I don't know if that was an option 
for sure or just maybe . I have no opinion in that question.
Does it sound interesting?
I would like it all to be open source. Do I haev to but some special 
text in the files. Do I/we risk anything if I just dump it all to this 

about the attached pictures:
* the artistic example is Reginas example in documentation to 
st_longestline, buffered with 1, 2 respective 5 units on top of eachother
* picture.jpeg is the page 2 of a tutorial shoving what it looks like. 
Not very fancy, but I'm little alergic to heavy fanciness on the web.
 But should maybe be little more good looking with colors and so on.


More information about the postgis-devel mailing list