Hello guys, we have an installed latest geoserver with postgis
database. We use openlayers to display the map and to modify it.

I would like to be able to display a map (WMS), then some polygons
above the map in vector format (WFS), and the ability to modify
and save the polygons.

I was able to write a html code that displays the map, the
corresponding layer javascript is the following:

                var wfslayer = new OpenLayers.Layer.Vector("WFS", {
                                strategies: [new OpenLayers.Strategy.BBOX(), 
saveStrategy],
                                protocol: new OpenLayers.Protocol.WFS({
                                        url:  
"http://localhost:8888/geoserver/wfs";,
                                        featureType: "gis_fence",
                                        featureNS: 
"http://www.opengeospatial.net/cite";,
                                        srsName: "EPSG:4326",
                                        version: "1.1.0"
                                })
                });

I added a save strategy, and everything is displayed correctly.
However, as i press the save button, nothing happens, but in the
response i get the following exception in the
WFS response:

java.lang.RuntimeException: java.io.IOException: Error occured
calculating bounds
java.io.IOException: Error occured calculating bounds
Error occured calculating bounds
ERROR: current transaction is aborted, commands ignored until end of
transaction block</ows:ExceptionText>
    <ows:ExceptionText>Details:</ows:ExceptionText>
    <ows:ExceptionText>org.geoserver.wfs.WFSException:
java.lang.RuntimeException: java.io.IOException: Error occured
calculating bounds&#xd;
        at org.geoserver.wfs.Transaction.transaction(Transaction.java:114)&#xd;
        at 
org.geoserver.wfs.DefaultWebFeatureService.transaction(DefaultWebFeatureService.java:162)&#xd;

....

for full log see http://www.easy-share.com/1913720938/geoserver.zip

The WFS transaction query what openlayer sends is the following:

<wfs:transaction xmlns:wfs="http://www.opengis.net/wfs"; service="WFS"
version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><wfs:update
typeName="feature:gis_fence"
xmlns:feature="http://www.opengeospatial.net/cite";><wfs:property><wfs:name>the_geom</wfs:name><wfs:value><gml:polygon
xmlns:gml="http://www.opengis.net/gml";
srsName="EPSG:4326"><gml:exterior><gml:linearring><gml:poslist>148.82368515625004
-41.059201012073224 149.46089218750004 -41.398250171029446
148.49409531250004 -41.55477518113302 148.82368515625004
-41.059201012073224</gml:poslist></gml:linearring></gml:exterior></gml:polygon></wfs:value></wfs:property><wfs:property><wfs:name>fencetype</wfs:name><wfs:value>1</wfs:value></wfs:property><ogc:filter
xmlns:ogc="http://www.opengis.net/ogc";><ogc:featureid
fid="gis_fence.7"></ogc:featureid></ogc:filter></wfs:update></wfs:transaction>

The SQL query for the fence is the following:

CREATE TABLE gis_fence
(
  id serial NOT NULL,
  fencetype integer,
  fencename character varying,
  the_geom geometry,
  CONSTRAINT pk_fence PRIMARY KEY (id),
  CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2),
  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) =
'POLYGON'::text OR the_geom IS NULL),
  CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 4326)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE gis_fence OWNER TO postgres;

I added the fence to CITE namespace in GeoServer.

Can someone please check whether this is a bug, or i just mistyped something?

Thanks in advance:

 Zsolt Sandor

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to