HTML ファイルを準備します。
a 「App Exploler」ペインの「ol015-nippon_bmi_akiruno_pgis.html」を右クリックし「コピー」をクリックします。
b 「App Exploler」ペイン上で右クリックし「貼り付け」をクリックします。
c 「名前の競合」ウィンドウで「ol016-nippon_bmi_akiruno_pgis.html」と入力し「OK」ボタンをクリックします。
d 「App Exploler」ペインの「ol016-nippon_bmi_akiruno_pgis.html」をダブルクリックして開きます。
e Development Examples の「WFS Transaction Example(http://openlayers.org/dev/examples/wfs-protocol- transaction.html)」サイトの「wfs-protocol-transactions.js source」リンクをクリックしてコードを表示します。
f 次のように内容の一部をコピーして「ol016-nippon_bmi_akiruno_pgis.html」に貼り付け、修正します。
---
OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url="; // 追加
function init(){
--- var saveStrategy = new OpenLayers.Strategy.Save(); // 追加
// ここから修正
vectors = new OpenLayers.Layer.Vector("Akiruno Polygon", {
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
projection: new OpenLayers.Projection("EPSG:2451"),
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
srsName: "EPSG:2451",
url: "http://192.168.1.200:8080/geoserver/wfs",
featureNS : "http://www.myhome.net/npn",
featureType: "akiruno_polygon",
geometryName: "the_geom",
schema: "http://192.168.1.200:8080/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=npn:akiruno_polygon"
})
});
// ここまで
map = new OpenLayers.Map('map', {
--- panelControl = [
new OpenLayers.Control.Navigation(
{
title: "Navigation"
}),
/* ここから削除
new OpenLayers.Control.DrawFeature(
vectors,
OpenLayers.Handler.Point,
{
title: "Draw Point",
displayClass: 'olControlDrawFeaturePoint',
multi: true
}),
new OpenLayers.Control.DrawFeature(
vectors,
OpenLayers.Handler.Path,
{
title: "Draw Line",
displayClass: 'olControlDrawFeaturePath',
multi: true
}),
ここまで */
new OpenLayers.Control.DrawFeature(
vectors,
OpenLayers.Handler.Polygon,
{
title: "Draw Polygon",
displayClass: 'olControlDrawFeaturePolygon',
multi: true
}),
---// ここから追加
new OpenLayers.Control.Button({
title: "Save Changes",
trigger: function() {
saveStrategy.save();
},
displayClass: "olControlSaveFeatures"
})
];
// ここまでpanel.addControls(panelControl); map.addControl(panel); map.zoomToMaxExtent(); }---
user@debian7-vmw:~$ psql nippon_bmi
psql (9.1.11)
"help" でヘルプを表示します.
nippon_bmi=> \dt リレーションの一覧 スキーマ | 名前 | 型 | 所有者 ----------+---------------------+----------+-------- public | akiruno_polygon | テーブル | user (21 行) (stdin):q
nippon_bmi=> \d akiruno_polygon
テーブル "public.akiruno_polygon"
カラム | 型 | 修飾語
----------+----------+-------------------------------------------------------
fid | integer | not null default nextval('akiruno_polygon_fid_seq'::regclass)
the_geom | geometry |
インデックス:
"akiruno_polygon_pkey" PRIMARY KEY, btree (fid)
"spatial_akiruno_polygon_the_geom" gist (the_geom)
CHECK 制約:
"enforce_dims_the_geom" CHECK (st_ndims(the_geom) = 2)
"enforce_geotype_the_geom" CHECK (geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL)
"enforce_srid_the_geom" CHECK (st_srid(the_geom) = 2451)
(stdin):q
nippon_bmi=> select * from akiruno_polygon;fid |
the_geom
-----+--------------------------------------------------------------------------
--------------------------------------------------------------------------------
----------------------------
1 | 0106000020930900000100000001030000000100000004000000C57FFEFE122FEDC04F000
22C99F3DCC0C57FFEFEAA3DECC04F00022CF783DAC0C57FFEFEBA9CEBC04F00022CE425DDC0C57FF
EFE122FEDC04F00022C99F3DCC0
(1 行)





0 件のコメント:
コメントを投稿