GIS Tutorials >> OpenLayers >> Advanced OpenLayers Tutorials >> OpenLayers WFS-T Using a GeoServer Hosted PostGIS Layer

GIS Programming Tutorials

GIS Theoretical Tutorials

GISTutor Newsletter



GISTutor Poll

How did you hear about us?
 

GISTutor Users Online

We have 54 guests online
OpenLayers WFS-T Using a GeoServer Hosted PostGIS Layer
( 19 Votes )

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 also recommend users to install an add-on to Mozilla Firefox called Firebug, as it can be very useful when debugging the XML Posts and Responses sent by GeoServer during the WFS-T calls.

 

Web Feature Services (WFS) can be very useful when building web mapping applications because they allow users to overlay vector spatial data on top of thematic base layers.  This protocol allows users to pan and zoom around existing spatial data, which can be used when developing maps and analyzing data.  However, the WFS protocol is limited in the sense that it is used to fetch and display previously existing data, not allowing additional information to be added or included in the web mapping application.  The WFS-T protocol was designed for that exact reason, as it allows for ‘transactions’ to occur.  A WFS-Transaction can be used to add, remove or modify the features that are loaded, and most importantly allows for the changes to be committed back and saved to the parent source.  For this reason it is important to have your data which you wish to modify to be stored within a spatial database such as PostgreSQL/PostGIS so that the transactions can be managed properly.  Loading data directly from ESRI Shapefiles is not recommended when building a WFS-T web mapping application.

 

Before starting into the technical details, it is valuable to understand the correct flow of processes that will allow the creation of the OpenLayers WFS-T example to go as smooth as possible.  Users will have to complete additional tutorials found within the GISTutor website to complete some of the following items.  The following list illustrates the order of processes required to complete this OpenLayers WFS-T tutorial.

  • Download the sample data for the OpenLayers WFS-T tutorial
  • Import the sample data into a PostGIS enabled PostgreSQL database
  • Publish a new GeoServer layer
  • Configure GeoServer Apache ProxyPass and OpenLayers proxy.cgi
  • Develop the OpenLayers WFS-T web mapping application
  • Debugging / Error Messages

Download the sample data for the OpenLayers WFS-T tutorial

 

To start off you can download the sample data for this tutorial here.  This shapefile contains polygons of the block boundaries found within the core of Vancouver, BC.  It has been georeferenced using the EPSG 26910 projection for NAD 83 / UTM Zone 10N.  Having a projection defined is crucial when building a WFS-T web mapping application, so that GeoServer and PostGIS know the specific area of the earth to display your vector overlay.

 

Import the sample data into a PostGIS enabled PostgreSQL database

 

To import the sample data into your PostGIS database, users should follow along with the instructions described in ‘Importing Shapefile GIS Data into PostgreSQL’.  Make sure to use wfst_test.shp as the shapefile name and also specify the SRID as 26910 when executing your shp2pgsql command to ensure that the projection information is properly included during the import.

 

Publish a new GeoServer layer

 

In order to use the GIS data we have just added to PostGIS in our web mapping application, we must first configure GeoServer to connect to our PostGIS spatial datasets.  Once that connection has been established, you will continue by publishing a new GeoServer layer.  To complete this section of the WFS-T tutorial, users must follow along with the instructions described in ‘How to Connect GeoServer to PostGIS Spatial Datasets’. Again users should be loading the wfst_test geometry from their PostGIS database, and remember to specify the SRID as 26910.  When you have successfully established the connection and published the layer, your GeoServer Layer list should have a record that looks like the following table.

Workspace

Store

Layer Name

Enabled?

Native SRS

cite

PostGIS_Dataset

wfst_test

checked

EPSG: 26910

 

Configure GeoServer Apache ProxyPass and OpenLayers proxy.cgi

 

Now that we have our wfst_test shapefile data published through our GeoServer and PostGIS connection, it is important to start configuring OpenLayers to handle the creation of our web mapping application.  One of the most common issues when loading GeoServer layers comes from XMLHttpRequest, stating that there is an issue with Access-Control-Allow-Origin.  This is very common if you are trying to load data from another remote server, or if you are trying to load data from localhost.  To complete this section of the tutorial, users must follow along with the instructions describe in ‘Configuring GeoServer Proxy for Public and Remote Data Access’.  Users should only complete the Apache ProxyPass section if you plan on hosting your application outside of the localhost environment, ie http://yourdomain.com/geoserver/web (Recommended).  This style will allow you to build a web mapping application that is available in a public location on the internet.  For other users that plan on running their web mapping application from http://localhost:8080/geoserver/web, you only need to complete to bottom two sections: ‘Changing the Default GeoServer Admin Login and Password Information’ and ‘Configuring an OpenLayers proxy.cgi for Loading Local and Remotely Hosted GeoServer WFS Data’.  By adding in the values of ‘localhost’ and ‘localhost:8080’ to the AllowedHosts variable array in the OpenLayers proxy.cgi, you should be able to prevent the XMLHttpRequest Access-Control-Allow-Origin issue from occurring.  This is beneficial when coding the OpenLayers WFS-T web mapping application as you can specify the path to your GeoServer layer through a localhost url.

Develop the OpenLayers WFS-T web mapping application

 

Now that all the GIS data has been published and all the technology has been configured it is time to start coding the OpenLayers WFS-T web mapping application.  The following script was developed off of the code found in the tutorial ‘How To Set Up An Openlayers Map With Spherical Mercator Base Layers and Custom WFS GIS Data Overlays’.  The code has been modified to include additional controls for displaying the OpenLayers editing toolbar and also includes save strategies used to commit the changes back to the PostGIS database using the WFS-Transaction.

 

In a new blank text document, copy and paste the following code.

<html>
 <head>
 <!-- OpenLayers core js -->
 <script type="text/javascript" 
 src="http://www.openlayers.org/dev/OpenLayers.js">
 </script>
 
 <!-- OpenStreetMap base layer js -->
 <script type="text/javascript" 
 src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js">
 </script>
 
 <!-- Google Maps -->
 <script 
 src="http://maps.google.com/maps/api/js?sensor=false">
 </script>
 <style type="text/css">
 /* Custom editing toolbar */
 .customEditingToolbar {
 float: right;
 right: 0px;
 height: 30px; 
 width: 200px;
 }
 .customEditingToolbar div {
 float: right;
 margin: 5px;
 width: 24px;
 height: 24px;
 }
 .olControlNavigationItemActive { 
 background-image: 
 url("../theme/default/img/editing_tool_bar.png");
 background-repeat: no-repeat;
 background-position: -103px -23px; 
 }
 .olControlNavigationItemInactive { 
 background-image: 
 url("../theme/default/img/editing_tool_bar.png");
 background-repeat: no-repeat;
 background-position: -103px -0px; 
 }
 .olControlDrawFeaturePolygonItemInactive { 
 background-image: 
 url("../theme/default/img/editing_tool_bar.png");
 background-repeat: no-repeat;
 background-position: -26px 0px; 
 }
 .olControlDrawFeaturePolygonItemActive { 
 background-image: 
 url("../theme/default/img/editing_tool_bar.png");
 background-repeat: no-repeat;
 background-position: -26px -23px;                                                             
 }
 .olControlModifyFeatureItemActive { 
 background-image: 
 url(../theme/default/img/move_feature_on.png);
 background-repeat: no-repeat;
 background-position: 0px 1px;
 }
 .olControlModifyFeatureItemInactive { 
 background-image: 
 url(../theme/default/img/move_feature_off.png);
 background-repeat: no-repeat;
 background-position: 0px 1px;
 }
 .olControlDeleteFeatureItemActive { 
 background-image: 
 url(../theme/default/img/remove_point_on.png);
 background-repeat: no-repeat;
 background-position: 0px 1px;
 }
 .olControlDeleteFeatureItemInactive { 
 background-image: 
 url(../theme/default/img/remove_point_off.png);
 background-repeat: no-repeat;
 background-position: 0px 1px;
 }
 </style> 
 <script type="text/javascript">
 OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";
 
 //set up the modification tools
 var DeleteFeature = OpenLayers.Class(OpenLayers.Control, {
 initialize: function(layer, options) {
 OpenLayers.Control.prototype.initialize.apply(this, [options]);
 this.layer = layer;
 this.handler = new OpenLayers.Handler.Feature(
 this, layer, {click: this.clickFeature}
 );
 },
 clickFeature: function(feature) {
 // if feature doesn't have a fid, destroy it
 if(feature.fid == undefined) {
 this.layer.destroyFeatures([feature]);
 } else {
 feature.state = OpenLayers.State.DELETE;
 this.layer.events.triggerEvent("afterfeaturemodified", 
 {feature: feature});
 feature.renderIntent = "select";
 this.layer.drawFeature(feature);
 }
 },
 setMap: function(map) {
 this.handler.setMap(map);
 OpenLayers.Control.prototype.setMap.apply(this, arguments);
 },
 CLASS_NAME: "OpenLayers.Control.DeleteFeature"
 });

 function showMsg(szMessage) {
 document.getElementById("nodelist").innerHTML = szMessage;
 setTimeout(
 "document.getElementById('nodelist').innerHTML = ''",2000);
 }

 function showSuccessMsg(){
 showMsg("Transaction successfully completed");
 };

 function showFailureMsg(){
 showMsg("An error occured while operating the transaction");
 };


 function init() {
 //set up a save strategy
 var saveStrategy = new OpenLayers.Strategy.Save();
 saveStrategy.events.register("success", '', showSuccessMsg);
 saveStrategy.events.register("failure", '', showFailureMsg);

 //set up projections
 // World Geodetic System 1984 projection
 var WGS84 = new OpenLayers.Projection("EPSG:4326");    
 // WGS84 Google Mercator projection
 var WGS84_google_mercator = new OpenLayers.Projection("EPSG:900913");    
 
 //Initialize the map
 //creates a new openlayers map in the <div> html element with id="map"
 var map = new OpenLayers.Map ("map", {    
 controls:[
 //allows the user pan ability
 new OpenLayers.Control.Navigation(),
 //displays the pan/zoom tools                    
 new OpenLayers.Control.PanZoom(),
 //displays a layer switcher
 new OpenLayers.Control.LayerSwitcher(),    
 //displays the mouse position's coordinates in a 
 //<div> html element with id="coordinates"
 new OpenLayers.Control.MousePosition(
 {div:document.getElementById("coordinates")})    
 ],
 //projection: WGS84_google_mercator,
 displayProjection: WGS84
 } );

 // map extent
 var mapextent = 
 new OpenLayers.Bounds(-123.17341, 49.24343, -123.06183, 49.29899).transform(WGS84, WGS84_google_mercator);

 //base layers
 var openstreetmap = new OpenLayers.Layer.OSM();
 var google_maps = new OpenLayers.Layer.Google(
 "Google Maps", {
 numZoomLevels: 20
 }
 );
 var google_satellite = new OpenLayers.Layer.Google(
 "Google Satellite", {
 type: google.maps.MapTypeId.SATELLITE, 
 numZoomLevels: 20
 }
 );
 
 //wfs-t editable overlay
 var wfs_layer = new OpenLayers.Layer.Vector("Editable Features", {
 strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
 //projection: new OpenLayers.Projection("EPSG:26910"),
 protocol: new OpenLayers.Protocol.WFS({
 version: "1.1.0",
 // loading data through localhost url path
 url: "http://localhost/geoserver/wfs",
 featureNS :  "http://www.opengeospatial.net/cite",
 maxExtent: mapextent,
 // layer name
 featureType: "wfst_test",
 // geometry column name
 geometryName: "the_geom",
 schema: "http://localhost/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=cite:wfst_test"
 })
 });

 map.addLayers([openstreetmap, google_maps, google_satellite, wfs_layer]);
 map.zoomToExtent(mapextent);
 
 // add the custom editing toolbar
 var panel = new OpenLayers.Control.Panel(
 {'displayClass': 'customEditingToolbar'}
 );
 
 var navigate = new OpenLayers.Control.Navigation({
 title: "Pan Map"
 });
 
 var draw = new OpenLayers.Control.DrawFeature(
 wfs_layer, OpenLayers.Handler.Polygon,
 {
 title: "Draw Feature",
 displayClass: "olControlDrawFeaturePolygon",
 multi: true
 }
 );
 
 var edit = new OpenLayers.Control.ModifyFeature(wfs_layer, {
 title: "Modify Feature",
 displayClass: "olControlModifyFeature"
 });

 var del = new DeleteFeature(wfs_layer, {title: "Delete Feature"});
 
 var save = new OpenLayers.Control.Button({
 title: "Save Changes",
 trigger: function() {
 if(edit.feature) {
 edit.selectControl.unselectAll();
 }
 saveStrategy.save();
 // alert('saved');
 },
 displayClass: "olControlSaveFeatures"
 });
 
 panel.addControls([navigate, save, del, edit, draw]);
 panel.defaultControl = navigate;
 map.addControl(panel);
 }
 </script>
 </head>
 <body onload="init()">
 <!-- div containers for map, lat/long coordinate output and transaction messages -->
 <div id="map" style="width:500px; height:500px;"></div>
 <div id="coordinates"></div>
 <div id="nodelist"></div>
 </body>
</html>

Follow along reading the code comments, take particular note to the WFS-T editable overlay section.  Some important things to note are the use of a save strategy which specifies how to execute the transaction calls of the WFS-T web mapping application.  Some other important information is the use of the localhost url paths.  Make sure to match the featureNS to the value of your GeoServer workspace.  Also verify that the correct layer name has been set for the featureType value. The schema statement also includes a variable called typename which should contain the workspace name and layer name, ex. typename=cite:wfst_test.  Once you have setup the script for your server, you should be able to test it out by loading it in Mozilla Firefox.

 

Debugging / Error Messages

 

For this section of the tutorial I will discuss some common error messages and potential fixes.  If you haven’t already you should install the Firebug add-on to Mozilla Firefox.  Once it is installed load up your web site and right click anywhere on the screen, select Inspect Element.  This will open up the Firebug interface along the bottom of your web browser.  Along the top you should see a tab called Net, make sure that it is enabled.  Then it will bring up some additional inner tabs, for debugging the XML Posts and Responses click on the XHR tab inside of the Net area.

 

 

Once the XHR section is active and ready, refresh your website with Ctrl + F5.  You should see a POST entry appear with a url run through your proxy.cgi.  Additional transactions will appear when you try to modify an existing polygon, add a new polygon, or remove a polygon and click the Save Changes button.  For debugging make sure to look at the XML Responses that are sent back.

 

The following section will display some XML error responses found in Firebug and some potential solutions to the issue.

 

Mistyped Layer Name

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport version="1.0.0"
xsi:schemaLocation="
http://www.opengis.net/ows
http://yourdomain.com:80
/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ows="http://www.opengis.net/ows">
<ows:Exception exceptionCode="NoApplicableCode">
Could not locate {http://www.opengeospatial.net/cite}wfs_test in catalog.
</ows:Exception>
</ows:ExceptionReport>

 

Take a look at your WFS-T editable overlay section and confirm that you have spelled your layer name correctly in the featureType value and that typename is setup properly at the end of the schema statement.  This response was sent because the name wfs_test was used instead of wfst_test.

 

Error when adding a new polygon

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/ows
http://yourdomain.com:80
/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ows="http://www.opengis.net/ows">
<ows:Exception exceptionCode="InvalidParameterValue">
<ows:ExceptionText>Error performing insert</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

 

This error usually occurs when you have hosted a PostGIS layer that has an SRID value set to -1.  GeoServer cannot complete the transaction because it cannot convert the real world coordinates of your polygon into an unknown spatial reference.  I suggest creating a new PostGIS table schema with the correct SRID setup, then INSERT the attributes and geometry into the table and publish a new GeoServer layer under the new tablename.

 

Operation on two geometries with different SRIDs

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport version="1.0.0"
xsi:schemaLocation="
http://www.opengis.net/ows
http://yourdomain.com:80
/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ows="http://www.opengis.net/ows">
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>java.lang.RuntimeException: java.io.IOException
java.io.IOException
null
ERROR: Operation on two geometries with different SRIDs</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

  This error has likely occurred because you had a PostGIS layer published in GeoServer with the SRID set to -1, then you tried to alter the SRID in PostGIS using the updategeometrysrid function.  This seems to be a GeoServer issue where it still thinks that the layers SRID started off as -1, even though you have altered it to have a real SRID in PostGIS.  Again my suggested solution for this issue is creating a brand new PostGIS table schema with the correct SRID setup, then INSERT the attributes and geometry into the table and publish a new GeoServer layer under the new tablename.  GeoServer will recognize that it is a different layer, and it will use the SRID you have just setup in PostGIS as the Native SRID.

 

Comments  

 
0 #31 patrick 2013-09-06 10:19
Hello Admin and all,

I"m woking on geoserver and postgis on localhost and followed all your tutorial's instructions.I have a html file script where pasted your WFS-T code but when i click on save button edited features are not saved.I have no messages showing sucess or failure of transaction.
I have the following message in firebug console:NS_ERRO R_DOM_BAD_URI: Access to restricted URI denied.

Coud someone help me to solve saving issues?
Thanks for your help!!
Quote
 
 
0 #30 Rino 2013-05-07 01:24
Quote:
works now - omitted this line in the wfs-t layer definition:
schema: "http://localhost:8080/geoserver/wfs/DescribeFeature Type?version=1.1.0&typename=cite:wfst_test"

best regards,
aksel


Dear Aksel & all,

I am newbie in WebGIS (I am from pure GIS).
I am facing similar problem: my "wfst_test" layer is not displayed. My geoserver (OpenGeo 3.0) works fine, and the "wfst_test" can be layer-previewed in OpenGeo (via OpenLayers, GML, Geojson) with no error.

I also tried Aksel's fix (omitting in the WFS layer definition---> schema: "http://localhost:8080/geoserver/wfs/DescribeFeature Type?version=1.1.0&typename=cite:wfst_test") but does not work (the "wfst_test" layer still not displayed).

Also, in WFS layer definition there is
url: "http://localhost/geoserver/wfs"
I am wondering if it should be with port number like:
url: "http://localhost:8080/geoserver/wfs"

Any help please :)
Quote
 
 
0 #29 Rino 2013-05-03 06:53
Quote:
works now - omitted this line in the wfs-t layer definition:
schema: "http://localhost:8080/geoserver/wfs/DescribeFeature Type?version=1.1.0&typename=cite:wfst_test"

best regards,
aksel


Dear Aksel & all,

I am newbie in WebGIS (am lot more pure GIS).
I am facing similar problem: my "wfst_test" layer is not displayed. My geoserver (OpenGeo 3.0) works fine, and the "wfst_test" can be layer-previewed in OpenGeo (via OpenLayers, GML, Geojson) with no error.

I also tried Aksel's fix (omitting in the WFS layer definition---> schema: "http://localhost:8080/geoserver/wfs/DescribeFeature Type?version=1.1.0&typename=cite:wfst_test") but does not work (the "wfst_test" layer still not displayed).

Any help please :)
Quote
 
 
+2 #28 Anu 2013-03-04 09:06
sir,
I want to know that how we add multiple layer name in
var del = new DeleteFeature(w fs_layer,{title :"Delete Feature"});
or in
var edit = new OpenLayers.Control.ModifyFeature(e fs_layer, {
title: "Modify Feature",
displayClass: "olControlModify Feature"
});
if it not possible to add multiple layer name ,then how can we edit multiple layers using single tool without creating another one .
Quote
 
 
0 #27 Atif 2013-02-05 09:35
Hello Admin,

I have tried to create a building toolbar for editing of maps but the buttons(delete, modify,draw,pan map) etc are invisible. Kindly elaborate your tutorial regarding this problem.I think most user are facing this problem implementing your code.Waiting for positive response from your side.
Quote
 
 
0 #26 ylka 2013-01-14 08:24
Quote:
hello admin,
I have been following the tutorial, thanks for the great work.
However am at the point of displaying my layers, i can see the save button but cant see the other editing tools and when i hover over the positions where they are supposed to be located, i can see their tittles even pick them and use them. But i cannt have them displayed as in the example above. I also followed the advise given to coral about the down load of openlayers and placing them in the webserver directory but in vain. please advise

check if you have the icon images on the following path:
..\OL\theme\defau lt\img
here you should see e.g. editing_tool_ba r.png
if yes, check the path also in the openlayers file, this part:
Quote:
.olControlNaviga tionItemInactiv e {
background-image:
url("../theme/default/img/editing_tool_ba r.png");
background-repeat: no-repeat;
background-position: -103px -0px;
}
Quote
 
 
+8 #25 2012-11-26 21:39
Great tuorial, thanks!!!!
How to edit, or save, polygon attributes(info , name...)?
If I insert new object on map, how to save it with some attributes in Postgis?

Thanks, Marko
Quote
 
 
0 #24 2012-11-26 12:52
hello admin,
I have been following the tutorial, thanks for the great work.
However am at the point of displaying my layers, i can see the save button but cant see the other editing tools and when i hover over the positions where they are supposed to be located, i can see their tittles even pick them and use them. But i cannt have them displayed as in the example above. I also followed the advise given to coral about the down load of openlayers and placing them in the webserver directory but in vain. please advise
Quote
 
 
+3 #23 2012-10-12 07:38
THANKS FOR THIS TUTORIAL!!
Is there a way to also add a desription to the newly drawn polygon? Via Popup and a form, displaying the other colums of the postgis-database? A tutorial or a follow-up on this one would be great, as I am stuck on this problem for weeks now. The examples I found (dev4.mapgears.com/.../... ; gis.ibbeck.de/.../...) are too complex for me to understand without a tutorial! PLEASE HELP, I think there are a lot of people out there interested in this possibility!
Quote
 
 
+3 #22 2012-09-10 11:06
Quoting Briquet:
I get this error message :
"Error performing insert: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry"
And I don't know what to do about it.
I'm trying to create new polygons in a layer where there are only polygons. GeoServer recognizes the native SRS and display correctly the data.
Could someone help me ?
Thanks.

Try these:
1. Use simple polygon features instead of multipolygon (or point or line)
2. Use postgresql 8.4 with postgis 1.5, or with postgis 2.0 you have to install legacy.sql first
Quote
 
 
0 #21 2012-05-29 05:53
I get this error message :
"Error performing insert: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry"
And I don't know what to do about it.
I'm trying to create new polygons in a layer where there are only polygons. GeoServer recognizes the native SRS and display correctly the data.
Could someone help me ?
Thanks.
Quote
 
 
0 #20 2012-05-28 14:02
I can see my vectors from WFS without any problem. But When I want to save my drawings, I fall on this error :
"Error performing insert: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry"
What is it ?
Quote
 
 
0 #19 2012-05-18 08:34
according to above examples,i've added a new Feature record into postgis;but the new feature's "fid" clolumn is null,who meet this problem?
Quote
 
 
0 #18 2012-05-16 09:10
Hi everyone
I am vietnamese.
I want to Configure GeoServer and Openlayers on IIS.
Help me!
Quote
 
 
0 #17 2012-05-11 18:48
Hi, thanks for the post, really excellent, I would like to know if there is a possibility of a WFST for various geometries (polygons, lines and points), and avoid errors and conflicts to be in the same application.any ideas or documentation to talk about it.

regards.
Quote
 
 
+2 #16 2012-03-22 05:48
Hello,
I have followed the instructions and I am hosting and accessing the application from local server. I am able to render the maps from google and openstreetmap but unable to retrieve it from geoserver. Openlayers.js is accessible.
I get this error for this url localhost:8080/geoserver/wfs

Could not determine geoserver request from http request org.geoserver.platform.AdvancedDispatc hFilter$Advance dDispatc hHttpRequest@137a0cf

Where did i go wrong.

Thank you.
Shrieky
Quote
 
 
0 #15 2012-02-16 14:54
works now - omitted this line in the wfs-t layer definition:
schema: "http://localhost:8080/geoserver/wfs/DescribeFeature Type?version=1.1.0&typename=cite:wfst_test"

best regards,
aksel
Quote
 
 
+2 #14 2012-02-14 13:59
Thanks for this tutorial!

Unfortunately, my PostGIS WFS never shows - firebugs shows that the wfs post just waits until timeout (many minutes). Buttons show etc, I can draw, but save doesn't give any result either (nothing in the 'status bar')

The geoserver layer preview looks fine (in every format except GML 3.1 and 3.2)

I think the proxy works - empty parameter list
(localhost/.../...) gives a MissingParamete rValue exception - this wouldn't be the case if the proxy didn't forward the post?

geoserver log (verbose) tells:

INFO [geoserver.wfs] -
Request: getServiceInfo

..then some random lines, then the log ends with this:

DEBUG [geotools.xml] - Found override for www.opengis.net/wfs...

Any hints would be appreciated!

Greetings from Denmark,
Aksel
Quote
 
 
+2 #13 2012-02-11 00:47
For some strange reason my wfs overlay only include a couple of polygons instead of showing the whole set. When I add more polygons to the map, and save it, the changes are registered in the database (the polygons I added are visible when I preview the layer in the geoserver web interface). However, they do not show up in the map if I reload it.

Any suggestions to what the problem might be?
Quote
 
 
0 #12 2011-12-02 18:50
I had problems loading the wfs layer, I found:

comments.gmane.org/.../10077

I change the name os the layer WITHOUT underscore and work find.

Thanks for the tutorial
Quote
 
 
+2 #11 2011-11-11 20:26
Hello! After 1 minute the editable layer loads in IE, but never in Firefox. Running apache, geoserver. Can add, delete, and save changes, but still takes a minute to load. Verified layer changes with uDig. Any suggestions to improve response time?

Thanks, MES
Quote
 
 
0 #10 2011-11-01 23:36
Hi, I really liked this tutorial.
Very good!

I'm with trouble. After get the reply of GeoServer, wfs_layer keep with no features. The attributes feature is a array of null.

Someone knows why is it happenning?

Thank You.
Quote
 
 
+2 #9 2011-10-12 01:22
Hello! After removing all the “../” and adding quotes to every line that had url(“theme/default/img/remove_point_of f.png”), I was able to load the page and see all the editing toolbar elements. I’m using GeoServer 2.0.2 and OpenLayers_2.11. I can view the wfs_test in GeoServer.

I still can’t see the wfs_test layer displayed when I load the page in Firefox. I can draw, modify, and delete new features as well as view OSM and the Google layers.

When I load the page in Firefox I get this message: Failed to load given url. Here is the url: csi.gstatic.com/.../.

Any suggestions?

Thank you!
Quote
 
 
0 #8 2011-10-07 18:32
Hello! I've launched this in IE & Firefox. I get warnings on opacity but no other errors.

It loads with only the save button and the base map choices. Neither the editing toolbar nor the editable layer are displayed. I've verified that the .png file is there and the wfs layer is in the postGIS table. Any suggestions?

Thank you.
Quote
 
 
-3 #7 2011-09-26 02:00
Just found this and I'll try it out tomorrow. My next step is to integrate w/a content management system to provide for anonymous user interactions. Do you have any tutorials on this topic?

Thank you, MES
Quote
 
 
0 #6 2011-09-01 13:46
Hello,

actually, I took this thread in reference : mail-archive.com/.../...

I overcome the problem by creating a brand new layer under postgis.
Quote
 
 
0 #5 2011-09-01 13:44
Quoting gonby:
Hello,

thank you very much for this tutorial. It is very helpfull for the 'reading' part of wfs files, but I'm in trouble with the 'drawing' part.
When a request is sent to geoserver, firebug gives the following error :


Error performing insert: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry



Geoserver, Postgis and Openlayers are installed on the same server. Do you have an idea, by chance, of where the issue could come from ?


hello. Actually I have overcome the problem by creating a brand new layer into postgis. I took reference to this thread for doing this : mail-archive.com/.../...

cheers
Quote
 
 
-1 #4 2011-08-05 08:11
Hello,

thank you very much for this tutorial. It is very helpfull for the 'reading' part of wfs files, but I'm in trouble with the 'drawing' part.
When a request is sent to geoserver, firebug gives the following error :


Error performing insert: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry



Geoserver, Postgis and Openlayers are installed on the same server. Do you have an idea, by chance, of where the issue could come from ?
Quote
 
 
+2 #3 2011-07-25 23:06
Coral,

In terms of the images not showing up, please make sure that you have all the required png image files, which should be located in your website directory under ./theme/default/img.

These images are included with the latest stable release of OpenLayers, which can be downloaded here, openlayers.org/. Download, extract and move the files into the correct location for your server's OpenLayers configuration.

To debug the issues with your transactions I suggest using Firebug and providing us with the exact error message.
Quote
 
 
+2 #2 2011-07-22 23:34
I like how clear this is! But it's not working for me.

I'm not seeing editing buttons except the save button, which doesn't work, and I'm getting an internal server error in response (I think) to my url:"http://localhost:8080/geoserver/web/".

Any ideas would be very much appreciated!

Thanks, Coral
Quote
 
 
0 #1 2011-06-22 15:56
Excelente aporte, es muy dificil encontrar informacion tan clara y precisa en la Web de este tema, yo recientemente he incurcionado con servidores de mapas libres y me parece que son una excelente opcion, yo trabajo bajo Linux y utilizo Geoserver con Postgres.
Saludos,
Quote
 

Add comment


Security code
Refresh