postexperiments


My PostGIS Projects

http://postexperiments.googlecode.com/svn/trunk/images/postgis_askml.png

PostExperiments is a common place for my personal projects related to PostGIS (geographic objects to the PostgreSQL object-relational database).

You are welcomed to share your ideas, post your comments and patches to improve this functions, or send your suggestions directly to the PostGIS development mailing list.

These are just experiments, some things has been committed to the PostGIS trunk and others will be committed soon.


Materialized Views Support

This is a project sponsored by Google for the Open Source Geospatial Foundation as part of the Summer of Code 2007.

Background

PostGIS geometry processing functions consume machine's CPU resources. This behavior can be avoided creating 'snapshots' of data based on views definitions, making queries more light for clients. This is specially useful for web clients.

Jonathan Gardner have aboard this problem with the concept of Materialized Views. These functions may be improved to support PostGIS functionality when creating, refreshing or deleting views.

Proposal

New functions for: * Add/Modify/Drop simple views * Add/Modify/Drop materialized views * Materialize simple views * Refresh data of materialized views

Milestones

Milestones has been posted on this calendar.


KML output

History

We use PostGIS to store vector data in PostgreSQL databases. This data is exposed in web clients like MapServer or desktop clients like QGIS or uDIG. However, Google Earth have growth as a better desktop client to show this data specially for people who never heard about GIS or maps.

PostGIS lacked of this functionality before version 1.2.1. This feature had been requested for many users but had not been included. At this point is where the magic of Open Source comes. I decided write this piece of code of a function for PostGIS that exposes geometry as KML objects. This code was reviewed by the guys at Refractions and committed on December 2006. Officially, AsKML() appears on 1.2.1 release of PostGIS.

There are many people using this function. Last January I heard of a course implementing this techniques here in Colombia!

AsKML (now ST_AsKML) function do not produce full featured KML documents. It just expose the geometry elements as KML objects to be included in programming interfaces in PHP and other client interfaces supported by PostgreSQL.

Advantages

  • Exposing "live" data for users. Instead of export static ESRI shapefiles
  • We can create feeds of changing data reflecting live events
  • Process to convert vector data to KML geometry is done by database

Usage

  • Python
  • Php

New Features

  • Extrude Tesselate and Altitudemode Support

People using ST_AsKML

Future


Mapserver gedit

Syntax file for highlighting of MapServer .map keywords in the gedit editor

INSTALL

  1. Download the latest version of mapserver.lang:

    http://postexperiments.googlecode.com/svn/trunk/mapserver/gedit/mapserver.lang

  2. Copy mapserver.lang to /usr/share/gtksourceview-2.0/language-specs sudo cp mapserver.lang /usr/share/gtksourceview-2.0/language-specs/
  3. Add mime types to /etc/mime.types sudo echo -e "application/x-mapserver map" | sudo tee -a /etc/mime.types sudo echo -e "application/x-mapserver-sym sym" | sudo tee -a /etc/mime.types
  4. Update mime types sudo update-mime-database /usr/share/mime
  5. Open your mapfile and navigate to View->Syntax Highlighting->Other->MapServer

http://postexperiments.googlecode.com/svn/trunk/images/mapserver_gedit_oblivion.png

Project Information

  • License: GNU GPL v3
  • 12 stars
  • svn-based source control

Labels:
postgis postgresql kml askml st_askml mapserver gedit