±È¶Ô 2006-03-28 10:22:30 ºÍ 2006-03-28 10:19:32
ÐÂÔöÄÚÈÝ
×ÊÁϱà¼/ÕªÒë: »ð¼ýÈË rocketmangw at gmail dot com
ÔÎijö´¦
¡¡¡¡Ã÷ÄáËÕ´ïµÄ
MapServerÊÇÒ»¸ö·ûºÏ
OpenGIS? Web Mapping Server¹æ¸ñÒªÇóµÄ»¥ÁªÍøÂçµØͼ·þÎñÈí¼þ¡£
¡¡¡¡* ÆäÖ÷Ò³µØַλÓÚ
http://mapserver.gis.umn.edu ¡£
¡¡¡¡*
OpenGIS? Web MapµÄ¶¨ÒåλÓÚ
http://www.opengis.org/techno/specs/01-047r2.pdf ¡£
4.7.1. »ù±¾Ê¹Ó÷½·¨
¡¡¡¡Óë
MapServerÅäºÏʹÓÃ
PostGIS£¬ÄãÐèÒªÖªµÀÈçºÎÅäÖÃ
MapServer£¬µ±È»Õâ¸öÒѾ³¬ö±¾ÎÄÒªÌÖÂ۵ķ¶Î§¡£±¾½Ú½«ÌÖÂÛ
PostGISµÄÅäÖÃÐÅÏ¢¡£
¡¡¡¡Óë
MapServerÅäºÏʹÓÃ
PostGIS£¬ÄãÐèÒª£º
¡¡¡¡* °æ±¾ÖÁÉÙΪ0.6»òÕ߸üеÄ
PostGIS¡£
¡¡¡¡* °æ±¾ÖÁÉÙΪ3.5»òÕ߸üеÄMapserver¡£
¡¡¡¡
MapServerÏóÆäËûµÄPostgresql¿Í»§¶ËÒ»ÑùʹÓÃlibpqÀ´»ñÈ¡
PostGIS/PostgresqlÊý¾Ý¡£ÕâÒâζ×Å
MapServer¿ÉÒÔ×°ÔÚÈÎÒâµÄ»úÆ÷ÉÏ£¬Ö»ÒªÕą̂»úÆ÷ͨ¹ýÍøÂç¿ÉÒÔ·ÃÎʵ½
PostGIS·þÎñÆ÷£¬ÈçͬÈκεÄlibpdµÄÊý¾Ý¿â¿Í»§¶ËÄÇÑù¡£
¡¡¡¡1. ±àÒë²¢ÇÒ°²×°
MapServer£¬ÔÚÄã×Ô¼ºµÄÅäÖòÎÊýÏ£¬Ìí¼Ó "--with-postgis" ÅäÖÃÐÅÏ¢¡£
¡¡¡¡2. ÔÚÄãµÄ
MapServerµÄmapÎļþÖУ¬Ìí¼Ó
PostGISͼ²ã¡£ÀýÈ磺
LAYER
CONNECTIONTYPE postgis
NAME "widehighways"
# Á¬½Óµ½Ò»¸öÔ¶³ÌµÄ¿Õ¼äÊý¾Ý¿â
CONNECTION "user=dbuser dbname=gisdatabase host=bigserver"
# ´Óroads±íÖлñµÃgeomÊý¾ÝÁÐ
DATA "geom from roads"
STATUS ON
TYPE LINE
# ÔÚËùÓеÄÏßÌõÖУ¬½ö¶Ô¸ßËÙ¹«Â·½øÐÐ×ÅÉ«
FILTER "type = 'highway' and numlanes >= 4"
CLASS
# È󬼶¸ßËÙ¹«Â·ÑÕÉ«ÏÊÁÁ²¢ÇÒ2¸öÏñËØ¿í
EXPRESSION ([numlanes] >= 6)
COLOR 255 22 22
SYMBOL "solid"
SIZE 2
END
CLASS
# ÆäËû²¿·ÖÑÕÉ«°µµ²¢ÇÒ1ÏñËØ¿í
EXPRESSION ([numlanes] < 6)
COLOR 205 92 82
END
ɾ³ýÄÚÈÝ
×ÊÁÏÕªÒë
ÓëMapserverÒ»ÆðʹÓÃ
PostGIS
ÔÎijö´¦
4.7. ʹÓÃMapserver
¡¡¡¡Ã÷ÄáËÕ´ïµÄmapserverÊÇÒ»¸ö·ûºÏ
OpenGIS? Web Mapping Server¹æ¸ñÒªÇóµÄ»¥ÁªÍøÂçµØͼ·þÎñÈí¼þ¡£
¡¡¡¡* ÆäÖ÷Ò³µØַλÓÚ[[http://mapserver.gis.umn.edu ]] ¡£
¡¡¡¡*
OpenGIS? Web MapµÄ¶¨ÒåλÓÚ[[http://www.opengis.org/techno/specs/01-047r2.pdf ]]¡£
4.7.1. »ù±¾Ê¹Ó÷½·¨
¡¡¡¡ÓëMapserverÅäºÏʹÓÃ
PostGIS£¬ÄãÐèÒªÖªµÀÈçºÎÅäÖÃMapserver£¬µ±È»Õâ¸öÒѾ³¬³ö±¾ÎÄÒªÌÖÂ۵ķ¶Î§¡£±¾½Ú½«ÌÖÂÛ
PostGISµÄÅäÖÃÐÅÏ¢¡£
¡¡¡¡ÓëMapserverÅäºÏʹÓÃ
PostGIS£¬ÄãÐèÒª£º
¡¡¡¡* °æ±¾ÖÁÉÙΪ0.6»òÕ߸üеÄ
PostGIS¡£
¡¡¡¡* °æ±¾ÖÁÉÙΪ3.5»òÕ߸üеÄMapserver¡£
¡¡¡¡MapserverÏóÆäËûµÄPostgresql¿Í»§¶ËÒ»ÑùʹÓÃlibpqÀ´»ñÈ¡
PostGIS/PostgresqlÊý¾Ý¡£ÕâÒâζ×ÅMapserver¿ÉÒÔ×°ÔÚÈÎÒâµÄ»úÆ÷ÉÏ£¬Ö»ÒªÕą̂»úÆ÷ͨ¹ýÍøÂç¿ÉÒÔ·ÃÎʵ½
PostGIS·þÎñÆ÷£¬ÈçͬÈκεÄlibpdµÄÊý¾Ý¿â¿Í»§¶ËÄÇÑù¡£
¡¡¡¡1. ±àÒë²¢ÇÒ°²×°Mapserver£¬ÔÚÄã×Ô¼ºµÄÅäÖòÎÊýÏ£¬Ìí¼Ó "--with-postgis" ÅäÖÃÐÅÏ¢¡£
¡¡¡¡2. ÔÚÄãµÄMapserverµÄmapÎļþÖУ¬Ìí¼Ó
PostGISͼ²ã¡£ÀýÈ磺
LAYER
CONNECTIONTYPE postgis
NAME "widehighways"
# Á¬½Óµ½Ò»¸öÔ¶³ÌµÄ¿Õ¼äÊý¾Ý¿â
CONNECTION "user=dbuser dbname=gisdatabase host=bigserver"
# ´Óroads±íÖлñµÃgeomÊý¾ÝÁÐ
DATA "geom from roads"
STATUS ON
TYPE LINE
# ÔÚËùÓеÄÏßÌõÖУ¬½ö¶Ô¸ßËÙ¹«Â·½øÐÐ×ÅÉ«
FILTER "type = 'highway' and numlanes >= 4"
CLASS
# È󬼶¸ßËÙ¹«Â·ÑÕÉ«ÏÊÁÁ²¢ÇÒ2¸öÏñËØ¿í
EXPRESSION ([numlanes] >= 6)
COLOR 255 22 22
SYMBOL "solid"
SIZE 2
END
CLASS
# ÆäËû²¿·ÖÑÕÉ«°µµ²¢ÇÒ1ÏñËØ¿í
EXPRESSION ([numlanes] < 6)
COLOR 205 92 82
END