Hello Luis,
If you are using a vector layer with a WFS protocol you can use the property
'geometryName' to set the name of the geometry column. Default is 'the_geom'[1]
You can see an example of the WFS protocol usage at OpenLayers examples page [2]
[1]
http://dev.openlayers.org/docs/files/OpenLayers/Protocol/WFS/v1-js.html#OpenLayers.Protocol.WFS.v1.geometryName
[2] http://openlayers.org/dev/examples/wfs-protocol-transactions.html
Best regards,
Gabriel Nolasco
Message: 6
Date: Tue, 26 Jan 2010 13:56:26 +0000
From: Lu?s de Sousa <[email protected]>
Subject: [OpenLayers-Users] Request with wrong column name
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Hello,
I'm using the transaction example provided by OpenGeo to create new
features with an Oracle database (through GeoServer):
http://workshops.opengeo.org/openlayers-intro/vector.html
The OpenLayers code to add the new feature is this:
draw.featureAdded = function(feature) {
feature.state = OpenLayers.State.INSERT;
commit = OpenLayers.Function.bind(wfs.commit, wfs);
commit();
add();
$("requestRow").style.visibility = "visible";
}
And it is generating the following request to the server:
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs"
version="1.0.0" service="WFS">
<wfs:Insert>
<feature:M_TANQUE xmlns:feature="http://insaar.inag.pt">
<feature:the_geom>
<gml:Point xmlns:gml="http://www.opengis.net/gml">
<gml:coordinates decimal="." cs="," ts="
">233823.57226563,280409.89264062</gml:coordinates>
</gml:Point> </feature:the_geom>
</feature:M_TANQUE>
</wfs:Insert>
</wfs:Transaction>
This inserts a new data row in the data base, but with a null
geometry. After asking for help at Geoserver's list the problem was
identifed, the above request is using the wrong columns name
"the_geom", when in the database and to Geoserver this should be
"shape". Here's the result of a DescribeFeatureType request:
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://insaar.inag.pt">
<xsd:import namespace="http://www.opengis.net/gml"
schemaLocation="http://localhost:8080/geoserver/schemas/gml/3.1.1/base/gml.xsd"/>
<xsd:complexType name="M_TANQUEType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="SHAPE"
nillable="true" type="gml:GeometryPropertyType"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="M_TANQUE" substitutionGroup="gml:_Feature"
type="insaar:M_TANQUEType"/>
</xsd:schema>
What's wrong with the code? Can the column name be set prior to the commit?
Thank you,
Lu?s
P.S.: The discussion at the Geoserver list can be accessed here:
http://old.nabble.com/Inserting-geometries-into-Oracle-database-td27309510.html
____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users