Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a web-gis application based on openlayers and geoserver. I need to modify a shape layer. I'm able to show the shape using the OpenLayers.Layer.WMS method. In fact i published the shape in geoserver and called it in the openlayers map file.

My idea is to copy the shape layer in a vector layer. In this way i can modify the vector layer before to save it.

My problem is: how can i copy the shape layer in a vector layer? How can i do that?

share|improve this question
up vote 2 down vote accepted

why dont you use WFS-T in geoserver. you know A transactional Web Feature Service (WFS-T) allows all CRUD Operations as creation, deletion, and updating of features. i know that GeoServer supports WFS-T which they have told in wikipedia as:

In addition, one can edit data via the WFS transactional profile (WFS-T).

and in reference page you can find sth:

The Transaction operation performs edits of actual data that is exposed by the WFS. A transaction can add, modify and remove features. Each transaction consists of zero or more Insert, Update and Delete elements. Each element is performed in order....

and the last thing if you search any tutorial about how can you achieve WFS-T operation, you should read OpenLayers WFS-T Using a GeoServer Hosted PostGIS Layer which realy giving excellent information about what you search...

from that site, maybe this is important before reading :)

This is an advanced OpenLayers tutorial which explains how to setup your own WFS-T example using a combination of GeoServer and PostgreSQL/PostGIS. In order to complete this tutorial, a user must have administrative access to both GeoServer and PostgreSQL running on a server. Users must also have an intermediate understanding of programming OpenLayers for developing web mapping applications.

i hope it helps you...

share|improve this answer

At the end i've found the way to visualize the layer.

The problem was that it seems that i needed to define the bounds of the map. What is not exactly clear is why, once you have defined a starting bounds, if you move the map over the bounds, you still can see the layer.

By the way, it doesn't matter. The important is to have clear how to set a wfs layer.

share|improve this answer

Sorry for the delay of the answer but i wanted to follow everything of what you suggested, included the proxy setting for my webserver. Everything seems to work fine:

I have this code in my map file:

 var options = {
  projection: new OpenLayers.Projection("EPSG:900913"),
  //displayProjection: new OpenLayers.Projection("EPSG:32632"),
  displayProjection: new OpenLayers.Projection("EPSG:23032"),
  units: "m",
  //maxResolution: 156543.0339,
  maxResolution: 99.22366015624993,
  maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34)


    var saveStrategy = new OpenLayers.Strategy.Save();

    v1497_wfs = new OpenLayers.Layer.Vector("Editable Features", {
        strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
        //projection: new OpenLayers.Projection("EPSG:23032"),
        protocol: new OpenLayers.Protocol.WFS({
            version: "1.1.0",
            //srsName: "EPSG:23032",
            url: "http://localhost/geoserver/wfs",
            featureNS :  "",
            featureType: "v1497_db_wfs",
            geometryName: "the_geom",
            maxExtent:  map.maxExtent.left + ',' + map.maxExtent.bottom,
            schema: "http://localhost/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=cite:v1497_db_wfs"


and if i try to navigate on the url:


i have the following response from the browser:

<xsd:schema xmlns:xsd="" xmlns:abcweb="" xmlns:aset="" xmlns:castelli="" xmlns:cite="" xmlns:gml="" xmlns:it.geosolutions="" xmlns:nurc="" xmlns:sde="" xmlns:sf="" xmlns:sitap="http://localhost:8080/geoserver/wfs" xmlns:test_ws="http://test_ws" xmlns:tiger="" xmlns:topp="" elementFormDefault="qualified" targetNamespace="">
<xsd:import namespace="" schemaLocation="http://localhost:80/geoserver/schemas/gml/3.1.1/base/gml.xsd"/>
<xsd:complexType name="v1497_db_wfsType">
<xsd:extension base="gml:AbstractFeatureType">
<xsd:element maxOccurs="1" minOccurs="0" name="codvr" nillable="true" type="xsd:decimal"/>
<xsd:element maxOccurs="1" minOccurs="0" name="uso" nillable="true" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="0" name="objectid" nillable="true" type="xsd:decimal"/>
<xsd:element maxOccurs="1" minOccurs="0" name="area__mq_" nillable="true" type="xsd:double"/>
<xsd:element maxOccurs="1" minOccurs="0" name="perim__m_" nillable="true" type="xsd:double"/>
<xsd:element maxOccurs="1" minOccurs="0" name="the_geom" nillable="true" type="gml:MultiSurfacePropertyType"/>
<xsd:element name="v1497_db_wfs" substitutionGroup="gml:_Feature" type="cite:v1497_db_wfsType"/>

But, even if i can see the checkbox in the layerswitcher, i can't see anything in the map. any idea?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.