Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am wondering if there are open source applications that make extensive uses of the special functions (the ST_* stored procedures) provided by PostGIS? I found many apps that support storing map data in PostGIS, but they seem to just fetch and store data from PostGIS and then operate on them in application code. I would like to learn about how to use those special functions as part of the queries by looking at sample applications. Thanks!

share|improve this question
up vote 6 down vote accepted

What you are talking about is not stored procedures but spatial inbuilt functions.

Those functions are very powerful and you can do most of the things that you do in a desktop gis directly in the database. It is often faster and more effective, especially when handling huge data sets.

The source that introduced me to the PostGIS functionality was An almost idiot guide at part 1
part 2
part 3

From the same authors a great book including almost everything you need to know about PostGIS: PostGIS in Action

If you just want to test playing around some with queries you can test
especially the
postgis tutorial is a site I wrote a few years ago to make it easy to discover the beauty of PostGIS online without installing anything. But the site is in quite bad shape and needs a complete makeover. It is mostly working, but have had some downtime lately. Hopefully a new version will be released some day.



share|improve this answer
Thanks for the links. If you know of some real-world applications that use those spatial inbuilt functions extensively please let me know. – JRR Feb 10 '13 at 15:30
@JRR The functionality is very powerful for processing and analyzing spatial data because of its flexibility. Building that into some UI always locks you up even if it is just a visual query builder. So, I guess the most used application using PostGIS spatial functions is just psql, pgadmin (not the query-bulder part) and maybe phppgadmin. – Nicklas Avén Feb 10 '13 at 23:06

QuantumGIS is one candidate. Check out for example the explicit uses in the sqlanywhere plugin and provider, eg. src/providers/sqlanywhere/qgssqlanywhereprovider.cpp. As a user you can of course enter any query, but this is transparent in the code. Pretty much all fixed uses that I could find are about reading or writing though, not any of the analysis functions (besides one ST_Intersects and ST_Force2D). That is because it uses GEOS internally (just like PostGIS) and doesn't bother with constructing query strings. This should be true for any sane C/C++ application.

So, if your application won't be in either language (GEOS has no other bindings), try taking a look at some scripting language GIS projects. Shapely has no PostGIS support, and like OGR, it also uses GEOS directly; other projects don't come to mind. Geoserver's GSS module is using PostGIS, but I haven't found how (do check).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.