[OpenLayers-Users] Request with wrong column name
Luís de Sousa
luis.a.de.sousa at gmail.com
Tue Jan 26 08:56:26 EST 2010
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
More information about the Users
mailing list