GREATWALL : PostGIS

Ê×Ò³ :: Ë÷Òý :: ÐÞ¶©ÀúÊ· :: ×îÐÂÆÀÂÛ :: ´ý½¨Ò³Ãæ :: µÇ½/×¢²á ÄãºÃ,3.147.78.242

PostGIS



×ÊÁϱ༭/ÕªÒë: »ð¼ýÈË rocketmangw at gmail dot com


ÓëMapServerÒ»ÆðʹÓÃPostGIS


External LinkÔ­Îijö´¦

4.7. ʹÓÃMapServer



¡¡¡¡Ã÷ÄáËÕ´ïµÄMapServerÊÇÒ»¸ö·ûºÏOpenGIS? Web Mapping Server¹æ¸ñÒªÇóµÄ»¥ÁªÍøÂçµØͼ·þÎñÈí¼þ¡£

¡¡¡¡* ÆäÖ÷Ò³µØַλÓÚExternal Linkhttp://mapserver.gis.umn.edu ¡£
¡¡¡¡* OpenGIS? Web MapµÄ¶¨ÒåλÓÚExternal Linkhttp://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

END
µ±Ç°Ò³ÃæûÓÐÁôÑÔ. [ÏÔʾÁôÑÔ°å]