Database Reference
In-Depth Information
Consuming
WFS-T
services
with
OpenLayers
Inthisrecipe,youwillcreatethe Transactional Web Feature Service ( WFS-T )from
aPostGISlayerwiththeGeoServeropen-sourceweb-mappingengine,andthenan
OpenLayers basic application that will be able to use this service.
Thisway,theuseroftheapplicationwillbeabletomanagetransactionsontheremote
PostGISlayer.WFS-Tallowsthecreation,deletion,andupdationoffeatures.Inthis
recipe,youwillallowtheuseronlytoaddfeatures,butthisrecipeshouldputyouon
your way to creating more composite use cases.
IfyouarenewtoGeoServerandOpenLayers,youshouldfirstreadthe Creating WMS
and WFS services with GeoServer and Consuming WMS services with OpenLayers
recipes, and then return to this one.
Getting ready
1. Createtheproxyscriptanddeployittoyourwebserver(thatis,httpdorIIS),
asindicatedinthe Getting ready sectionofthe Consuming WMS services with
OpenLayers recipe.
2. Create the following PostGIS points layer, named sites :
CREATE TABLE chp09.sites
(
gid serial NOT NULL,
the_geom geometry(Point,4326),
CONSTRAINT sites_pkey PRIMARY KEY (gid )
);
CREATE INDEX sites_the_geom_gist ON
chp09.sites
USING gist (the_geom );
3. Now, create a PostGIS layer in GeoServer for the chp09.sites table. For
more information on this, refer to the Creating WMS and WFS services with
GeoServer recipe in this chapter.
Search WWH ::




Custom Search