[TinyOWS-dev] Error when inserting new feature with TinyOWS

Ermond Parllaku erndal02 at hotmail.com
Wed May 9 03:03:00 EST 2012


> You can't have success with WFS 1.1.0 because your geometry is in GML2
> <gml:coordinates
 However, you had some other problem too with the schema location. I 
can't say anything about that. Anyway, be sure to use GML2 with WFS 
1.0.0 and GML3 with WFS 1.1.0.

Thanks for your answer. I wasn't sure if I could use the WFS 1.1.0, so now I am sure that I cannot.

Anyway I still have the same error, but I see in the log files one more error which says:
[ERROR] Element '{http://www.w3.org/2001/XMLSchema}import': Failed to locate a schema at location 'http://localhost:81/cgi-bin/tinyows.exe?service=WFS&request=DescribeFeatureType&version=1.0.0'. Skipping the import.

If I try the URL in the browser it gives me the whole schema for the layer, and it's something like this:

<?xml version='1.0' encoding='UTF-8'?>
<xs:schema targetNamespace='http://www.tinyows.org/' xmlns:tows='http://www.tinyows.org/' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:gml='http://www.opengis.net/gml' elementFormDefault='qualified' version='1.0'>
<xs:import namespace='http://www.opengis.net/gml' schemaLocation='http://schemas.opengis.net/gml/2.1.2/feature.xsd'/>
<xs:element name='olives' type='tows:olivesType' substitutionGroup='gml:_Feature' />
<xs:complexType name='olivesType'>
  <xs:extension base='gml:AbstractFeatureType'>
    <xs:element name ='rrethid' type='int' nillable='true' minOccurs='0' maxOccurs='1'/>

I think the error should be somewhere in the schema folder within tinyows folder that I have (but not sure at all). Anyway if someone could tell me where to get the latest schema folder version of TinyOWS, I can try to replace them, and see if the error is there.

Also, if the error is at the schema, why shouldn't if fire also when editing/deleting a feature?


> From: Jukka.Rahkonen at mmmtike.fi
> To: tinyows-dev at lists.maptools.org
> Date: Tue, 8 May 2012 19:34:43 +0000
> Subject: Re: [TinyOWS-dev] Error when inserting new feature with TinyOWS
> Hi,
> You can't have success with WFS 1.1.0 because your geometry is in GML2
> <gml:coordinates
> However, you had some other problem too with the schema location. I can't say anything about that. Anyway, be sure to use GML2 with WFS 1.0.0 and GML3 with WFS 1.1.0.
> -Jukka Rahkonen-
> Ermond Parllaku wrote:
> > Hi to all,
> > I configured a layer with TinyOWS and MS4W in Windows. I have other layers in the map viewer too, configured with OpenLayers, but the layer that I configured with TinyOWS is supposed to be editable. Anyway, I can edit and delete features from the layer. But unfortunately I haven't managed yet to insert new features.
> In the log of TinyOWS, when I try to insert a new feature, I keep getting an error:
> [ERROR] Element '{http://www.tinyows.org/}olives': This element is not expected. Expected is one of ( {http://www.opengis.net/gml}_Feature, {http://www.opengis.net/wfs}FeatureCollection )
> Just before the error, in the log file I see this query:
> <wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/WFS-transaction.xsd">
>   <wfs:Insert>
>     <feature:olives xmlns:feature="http://www.tinyows.org/">
>       <feature:geometry>
>         <gml:MultiPolygon xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:32634">
>           <gml:polygonMember>
>             <gml:Polygon>
>               <gml:outerBoundaryIs>
>                 <gml:LinearRing>
>                   <gml:coordinates decimal="." cs="," ts=" ">381781.25,4509578.125 381875,4509031.25 382656.25,4509734.375 381781.25,4509578.125</gml:coordinates>
>                 </gml:LinearRing>
>               </gml:outerBoundaryIs>
>             </gml:Polygon>
>           </gml:polygonMember>
>         </gml:MultiPolygon>
>       </feature:geometry>
>     </feature:olives>
>   </wfs:Insert>
> </wfs:Transaction>
> The config.xml is like this:
> <tinyows online_resource="http://localhost:81/cgi-bin/tinyows.exe"
>   schema_dir="C:/ms4w/apps/tinyows/schema/"
>          log="C:/ms4w/apps/tinyows/tinyows.log"
>          log_level="15">
>   <pg host="" user="postgres" password="***" dbname="olives_gis1" port="5432"/>
>   <metadata name="Olives WFST Server"
>          title="WFST Olives" />
>   <layer retrievable="1"
>          writable="1"
>          ns_prefix="tows"
>          ns_uri="http://www.tinyows.org/"
>          //srid="EPSG:32634"
>          name="olives"
>          title="olives"/>
> </tinyows>
> I thought the error might happen because in the database the geometry of the table olives is declared as POLYGON, so I changed it to MULTIPOLYGON, but I still got the same error. I also changed the WFS schema to 1.0.0, but still the same error.
> I have declared a DrawFeature variable like this, to draw the feature that will be saved in the database:
>     var draw = new OpenLayers.Control.DrawFeature(
>       wfs, OpenLayers.Handler.Polygon,
>       {
>           title: "Add olives",
>           displayClass: "olControlDrawFeaturePolygon",
>           multi: "true",
>           id: "draw"
>       }
>   );
> I would like to mention again that the editing and deleting of existing features work very well.
> I am using MS4W 3.0.4 (with OL included) and tinyows-1.0.0rc3. The database is in PostgreSQL & PostGIS.
> Since I don't have much experience with these technologies (more than 1 month) I might have made some stupid error, but I cannot find it anyway...
> Thanks a lot in advance for your help
> _______________________________________________
> TinyOWS-dev mailing list
> TinyOWS-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/tinyows-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/tinyows-dev/attachments/20120509/a024930e/attachment.htm 

More information about the TinyOWS-dev mailing list