2009年7月26日日曜日

東京都の地図 円積図(平成20年版)

東京都の地図 円積図(平成20年版)

人口を円積図で表します。人口によって円の大きさを変えて表示します。

レイヤ部分を記述します。
階級区分のマップファイルのうち、SYMBOLオブジェクトを追加し、gyoseikai2のレイヤを削除、totalpopレイヤを次のように修正します。

MAP
NAME tokyo_pgis_circle.map
---
SCALEBAR
TRANSPARENT TRUE
END

SYMBOL
NAME 'circle'
TYPE ELLIPSE
FILLED TRUE
POINTS
1 1
END
END
---
LAYER
NAME totalpop
GROUP totalpop
TYPE ANNOTATION
STATUS ON
CONNECTIONTYPE POSTGIS
CONNECTION "dbname=tokyo host=localhost user=user password=password"
DATA "the_geom FROM (
SELECT gyoseikai.gid AS gid,
gyoseikai.con AS con,
gyoseikai.cn2 AS cn2,
gyoseikai.aac AS aac,
gyoseikai.the_geom AS the_geom,
population.total AS total,
population.male AS male,
population.female AS female,
population.foreigner AS foreigner
FROM gyoseikai LEFT OUTER JOIN population ON gyoseikai.aac = population.aac)
AS gyosei_pop USING UNIQUE gid USING SRID=-1"
LABELITEM "total"
CLASSITEM "total"
METADATA
"group_title" "人口"
END
CLASS
NAME "50万人以上"
EXPRESSION ([total] >= 500000)
LABEL
SIZE tiny
COLOR 255 204 204
OUTLINECOLOR 102 51 51
POSITION ul
END
STYLE
SYMBOL 'circle'
COLOR 255 0 0
SIZE 20
END
END
CLASS
NAME "40万-50万人"
EXPRESSION ([total] < 500000 AND [total] >= 400000)
LABEL
SIZE tiny
COLOR 255 204 204
OUTLINECOLOR 102 51 51
POSITION ul
END
STYLE
SYMBOL 'circle'
COLOR 255 0 0
SIZE 17
END
END
CLASS
NAME "30万-40万人"
EXPRESSION ([total] < 400000 AND [total] >= 300000)
LABEL
SIZE tiny
COLOR 255 204 204
OUTLINECOLOR 102 51 51
POSITION ul
END
STYLE
SYMBOL 'circle'
COLOR 255 0 0
SIZE 14
END
END
CLASS
NAME "20万-30万人"
EXPRESSION ([total] < 300000 AND [total] >= 200000)
LABEL
SIZE tiny
COLOR 255 204 204
OUTLINECOLOR 102 51 51
POSITION ul
END
STYLE
SYMBOL 'circle'
COLOR 255 0 0
SIZE 11
END
END
CLASS
NAME "10万-20万人"
EXPRESSION ([total] < 200000 AND [total] >= 100000)
LABEL
SIZE tiny
COLOR 255 204 204
OUTLINECOLOR 102 51 51
POSITION ul
END
STYLE
SYMBOL 'circle'
COLOR 255 0 0
SIZE 8
END
END
CLASS
NAME "10万人以下"
EXPRESSION ([total] < 100000)
LABEL
SIZE tiny
COLOR 255 204 204
OUTLINECOLOR 102 51 51
POSITION ul
END
STYLE
SYMBOL 'circle'
COLOR 255 0 0
SIZE 5
END
END
END
---

東京都の地図 グラフ
奥多摩町のグラフも正常に表示されました。
totalpop レイヤを次のように修正しました。

MAP
NAME tokyo_pgis_graph.map
---
SCALEBAR
TRANSPARENT TRUE
END

# SYMBOL
# NAME 'circle'
# TYPE ELLIPSE
# FILLED TRUE
# POINTS
# 1 1
# END
# END
---
LAYER
NAME totalpop
GROUP totalpop
TYPE chart
STATUS ON
CONNECTIONTYPE POSTGIS
CONNECTION "dbname=tokyo host=localhost user=nob61 password=balanced"
DATA "the_geom from (
SELECT gyoseikai.gid AS gid,
gyoseikai.con AS con,
gyoseikai.cn2 AS cn2,
gyoseikai.aac AS aac,
gyoseikai.the_geom AS the_geom,
population.total AS total,
population.male AS male,
population.female AS female,
population.foreigner AS foreigner
FROM gyoseikai LEFT OUTER JOIN population ON gyoseikai.aac = population.aac
)
AS gyosei_pop USING UNIQUE gid USING SRID=-1"
LABELITEM "total"
CLASSITEM "total"
METADATA
"group_title" "人口"
END
CLASS
NAME "男"
STYLE
SIZE [male]
COLOR 51 51 255
END
END
CLASS
NAME "女"
STYLE
SIZE [female]
COLOR 255 51 51
END
END
CLASS
NAME "外国人"
STYLE
SIZE [foreigner]
COLOR 51 255 51
END
END
END
---

0 件のコメント: