PostgreSQL User Map

From MapbenderWiki

Jump to: navigation, search

Notice
This map is not being used currently and only serves as a demo. If you see a login prompt enter "mb" as user and password. If you see a list with links click on <postgresql_user_s>. The other interface is too large for this iframe.

Contents

English

Introduction

Several mails have been posted to several lists discussing the implementation of a PostgreSQL User Map. One result of these dicussions is an OGC based services oriented Open Source architecture with Mapbender PHP-based frontend. Hence this short description. It can be seen on the Mapbender Portal.

Using the Map

Open the Map with the following link:

http://wms1.ccgis.de/mapbender22/frames/login.php?name=mb&password=mb&mb_user_myGui=postgresql_user_s

Get more Information about a Location

Use the buttons to zoom-in and out, etc. To get more information about a PG user first click on the i-button and then onto the colored point (maybe somebody can provide nicer images like flags, pins or something?). The result of the query pops up in a new window (it could also be tunneled to a frame if the pop-ups bother). Anybody can edit the information and store it Wiki style.

Add a new User

To add a new user first zoom to the place that you want to add the new location. Then click on the button with the blue flag and after that into the map. A new window will pop up where you can enter the information of this site. Click the save button and close the window. To see the new location simply pan the map or zoom in or out to refresh the screen.

How does it Work?

The link above contains the credentials name=mb and password=mb that way the interface is open to everybody Wiki-style. In a later version individual credentials could be used for access control. After authentication the HTML interface elements (zoom button, mapframe, overview, select box, etc.) are read from the PostgreSQL database like a CMS would do. Additionally a set of Online Resources (URLs) of the map services are read from the database.

Where do the maps come from?

The maps are requested directly by the browser (you) from several servers around the world. One of these servers shows a map with the locations of the PostgreSQL users. This map is rendered by a UMN MapServer which reads the coordinates from the PostgreSQL PostGIS database. Any client that implements the OGC WMS specification can also query maps from this service. It is the professional version of the GoogleEarth hack and uses official consensus standards only.

The PostgreSQL User WMS Capabilities URL currently points to a server hosted by CCGIS. This service being a PotsgreSQL community thingy it should eventually move to their homepages and servers. We will update the metadata and the next time a client queries for this information it will automatically be available with the new Online resource.

There is another interface with some additional functionality and more maps. All map interfaces can be put together using a web based administration to arange elements, layout, colors, etc. Have a look at the Mapbender Gallery to get an idea of what can be done.

Technical description

The PostgreSQL database makes use of the PostGIS spatial data model and operations to handle spatial data. All information about user sites (name, type, organisation) are stored in a feature table which includes a field of type geometry. This field contains a coordinate tuple (essentially a simple point) which is coded in the spatial reference system WGS 84 (World Geodetic System 1984) which expresses the position on the earth in decimal degrees. The data is requested by UMN MapServer with SQL, the result is rendered as a map image. The image is returned to the client by the web server running the PHP-based front end Mapbender which manages this sandwich of maps. You eat.

All maps are requested using the standard OGC WMS (Web Map Service) specification. Any map server implementing this specification can be included into the map sandwich.

Read a short introduction to Spatial Data Management with PostgreSQL and PostGIS, it is also available for download as SXW or PDF.

Basic Installation

The following software components have been used to implement the solution:

  • FreeBSD operating system
  • PostgreSQL
  • PostGIS
  • UMN MapServer
  • Apache httpd Server
  • PHP
  • Mapbender

All components are licensed as Open Source and can be run on most operating systems.

To be Done

  • Refresh map automatically after adding new location --> is done
  • Add tooltip text imagemap from WFS GML
  • Change the name displayed in the user list (vertical tabs) to the same field that is used in the map for labeling --> is done

Nice to have

  • Hide EPSG code --> is done
  • Validate coordinates (-180 < x < 180 AND -90 < y < 90) --> is done

Layout

The layout can be modified using the PG User Map Administration Interface. Check out another GUI with more functionality and maps.

Personal tools