2008年9月9日火曜日

OpenLayers 8b国土数値地図でWFSを試す

情報をもとに、マップファイルを作成します。

MAP
NAME kanagawa_mlit_shp_map
STATUS ON
SIZE 600 300
EXTENT 138.91 35.12 139.84 35.68
UNITS DD
IMAGECOLOR 255 255 255
IMAGETYPE png
PROJECTION
"init=epsg:4612" #修正 OpenLayers 10 参照
END

WEB
IMAGEPATH "/home/user/ka-map/htdocs/tmp/kacache/"
IMAGEURL "/ka-map/tmp/kacache/"
METADATA
"wms_title" "Kamakura mlit Map WMS Server"
"wms_srs" "EPSG:2451 EPSG:4612" #修正 OpenLayers 10 参照
"wfs_title" "Kamakura mlit Map WFS Server"
"wfs_srs" "EPSG:2451 EPSG:4612" #修正 OpenLayers 10 参照
END
END

LEGEND
TRANSPARENT TRUE
END

SCALEBAR
TRANSPARENT TRUE
END

SYMBOL
NAME 'circle'
TYPE ELLIPSE
FILLED TRUE
POINTS
1 1
END
END

LAYER
NAME gyoseikai
GROUP gyoseikai
TYPE POLYGON
STATUS ON
DATA "../mapdata/kanagawa_mlit/N03-071001_14_EC01.shp"
LABELITEM "CN2"
METADATA
"group_title" "行政界"
"wms_title" "Kanagawa mlit Map WMS Gyoseikai Layer"
"layer_encoding" "SJIS"
"searchfield" "CN2"
"fields" "CON:郡政令,CN2:市区町村"
END
CLASS
NAME "行政界"
STYLE
OUTLINECOLOR 153 153 153
END
LABEL
MINFEATURESIZE 40
TYPE TRUETYPE
FONT vl-gothic
ENCODING SJIS
SIZE 8
END
END
TEMPLATE temp_tokyo_shp.html
END

LAYER
NAME gun_seirei
GROUP gun_seirei
TYPE ANNOTATION
STATUS ON
DATA "../mapdata/kanagawa_mlit/N03-071001_14_EC01.shp"
LABELITEM "CON"
METADATA
"group_title" "郡政令"
"layer_encoding" "SJIS"
"queryable" "true"
"searchfield" "CON"
"fields" "CON:郡政令,CN2:市区町村"
END
CLASS
NAME "郡政令"
LABEL
MINFEATURESIZE 40
TYPE TRUETYPE
FONT vl-gothic
ENCODING SJIS
SIZE 8
POSITION uc
END
END
TEMPLATE temp_tokyo_shp.html
END

LAYER
NAME railroad
GROUP railroad
TYPE line
STATUS ON
DATA "../mapdata/railroad_mlit/N02-07_EB02.shp"
LABELITEM "LIN"
METADATA
"group_title" "鉄道"
"wfs_title" "Railroad Map WFS Layer"
"layer_encoding" "SJIS"
"searchfield" "LIN"
"fields" "LIN:鉄道,OPC:会社"
END
CLASS
NAME "鉄道"
STYLE
COLOR 102 204 204
END
LABEL
MINFEATURESIZE 40
TYPE TRUETYPE
FONT vl-gothic
ENCODING SJIS
SIZE 8
POSITION uc
END
END
TEMPLATE temp_railroad.html
END

LAYER
NAME public_facilities
GROUP public_facilities
TYPE POINT
STATUS ON
DATA "../mapdata/kanagawa_mlit/P02-06_14_FB01.shp"
MAXSCALEDENOM 100000
LABELITEM "NA0"
METADATA
"group_title" "公共施設"
"wfs_title" "Public Facilities Kanagawa mlit Map WFS Layer"
"layer_encoding" "SJIS"
"searchfield" "NA0"
"fields" "NA0:公共施設,ADS:住所"
END
CLASS
NAME "公共施設"
STYLE
SYMBOL 'circle'
COLOR 102 255 102
SIZE 5
END
LABEL
MINFEATURESIZE 40
TYPE TRUETYPE
FONT vl-gothic
ENCODING SJIS
SIZE 8
POSITION uc
END
END
TEMPLATE temp_facilities.html
END

END #MAP END

shp2imgで地図を確認します。

~/mapfile$shp2img -m kanagawa_mlit_shp.map -o kanagawa_mlit_shp.png

ka-Mapのconfig.phpに次のように追加します。

---
$aszKanagawamlit1 = array (
'title' => 'Kanagawamlit1',
'path' => '/home/user/mapfile/kanagawa_mlit_shp.map',
'scales' => array( 500000, 250000, 100000, 50000, 10000 ),
'format' =>'PNG'
);

$aszMapFiles = array( /* 'gmap' => $aszGMap */
---
'kanagawamlit1' => $aszKanagawamlit1

/* Add more elements to this array to offer multiple mapfiles */

);
---

ka-Mapを表示して、kanagawamlit1を選択します。


0 件のコメント: