Showing posts with label Map Server. Show all posts
Showing posts with label Map Server. Show all posts

Using database to store map information, rather than shape file

The ultimate goal is to be more flexible in design, display, and modify tabular data.

Solution:
1. Using the MySQL server
2. Using PostGIS on PostgreSQL server


Which is recomended to use PostGIS in PostgreSQL with the following reasons:
1. Already available template spatial database and its functions, geometry, geography, etc..
2. Already available importers of shape files to PostGIS data.
 


In Map File, data connection that from shapefile should be changed to PostGIS with syntax as follows: 

CONNECTIONTYPE POSTGIS
CONNECTION "host=localhost port=5432 
dbname=db_name user=user_name password=_password" 
PROCESSING "CLOSE_CONNECTION=DEFER" 
DATA "geom FROM table_name using unique gid using srid=4326" 

Please note that the "DATA" in connection above is using geom field as the geometry field. You can use with your own field, as long as the data type is geometry.

As well, the "srid=4326" is EPSG code that represent the UTM zone. Currently, we use this as "default" :) , because so far we still don't understand what is it.

If you want to know about PostGIS, please visit http://www.gdal.org/ogr/drv_pg.html  and http://postgis.refractions.net/documentation/manual-1.4/ch01.html. Generally, It is mandatory to know about PostgreSQL (http://www.postgresql.org/) further more.

Thanks,
Danan

Map File Maker

Map file is one of the main files required by the map server. This file contains a map of how it will be displayed, including information on the color, font, projection, etc..
The need for the appearance of the map is varied and complex requires the creation of this file can be generated automatically from the shape file.

Using Quantum GIS to save map as map file, with the following steps :
1. Open Shape file
2. Edit any information, include legend attribute, color, word text, label, symbology, etc.
3. Save as qgs file.
4. Save as map file
5. Edit map file to fulfill any other setting needed, such as path img file.
6. Done, map file is ready to used
Thanks,
Danan