Database Reference
In-Depth Information
How it works...
Inthisrecipe,youfirstcreatedapoint PostGIS tableandthenpublisheditasWFS-
T using GeoServer. You then created a basic OpenLayers application using the
WFS-T layer, allowing the user to add features to the underlying PostGIS layer.
InOpenLayers,thecoreobjectneededtoimplementsuchaserviceistheVectorlay-
er,bydefiningaWFSprotocol.WhendefiningtheWFSprotocol,youhavetoprovide
theWFSversiontouse,thespatialreferencesystemofthedataset,theURIofthe
service,thenameofthelayer(forGeoServer,thenameisacombinationofthelayer
workspace, FeaturePrefix , and the layer name, FeatureType ), and the name
of the geometry field that will be modified. You also can pass to the Vector layer
constructor a StyleMap value to define the layer's rendering behavior.
You then tested the application by adding some points to the OpenLayers map
and checked that those points were effectively stored in PostGIS. When adding
the points using the WFS-T layer, with the help of tools such as Firefox Firebug or
Chrome(Chromium)DeveloperTools,youcoulddigindetailtotherequeststhatyou
are making to the WFS-T and its responses.
Search WWH ::




Custom Search