[Geomoose-users] Vector editing with WFS-T

Brent Fraser bfraser at geoanalytic.com
Sun Mar 13 13:07:53 PDT 2016


Hey Jeff,

   I've been successful with the Geomoose demo in using WFS-t to delete, 
modify and create "census_city" features, and to save these changes back 
to PostGIS (*Woohoo!*).  I'll have to edit our doc on the configuration 
(and file a couple of issues), but the main points are:

1. Add controls to the Census Cities layer in mapbook.xml:
<layer title="Census Cities"  activate="true" src="census_cities" 
fade="false" unfade="false" metadata="false" legend="false" 
draw-point="false" draw-line="false" draw-polygon="true" 
edit-attributes="true" edit-shape="true" remove-feature="true" 
remove-all-features="true" buffer="true"></layer>

2. Add  "auto:true" to the save strategy in GeoMoose's WFS.js (line 36):
this.save_strategy = new OpenLayers.Strategy.Save(*{auto:true}*);
     - this means that when you unselect the feature after editing the 
changes will be automatically saved

3. Also in WFS.js, change line 44 to be:
projection:*this.srsName*, // new 
OpenLayers.Projection(CONFIGURATION.projection),
and in the mapbook add srs="EPSG:4269" to the mapsource:
   <map-source name="census_cities" type="wfs" active="true" 
*srs="EPSG:4269"*>
     - this causes OpenLayers to re-project the feature's geometry 
before passing it to TinyOWS (I don't think TinyOWS does re-projection).

4.  Set
*check_schema="0*"
in the TinyOWS config.xml file.  There are some schema problems I need 
to track down, but this works for now.

5.  When you create the table in PostGIS using ogr2ogr, make sure it 
creates it with geometry type of POLYGON by including "*-nlt POLYGON*", 
otherwise the type is MULTIPOLYGON and PostGIS complains when TinyOWS 
tries to insert a POLYGON.

And thanks again for your TinyOWS demo; without that to confirm TinyOWS 
does actually work, I think I would have lost my enthusiasm ...

Best Regards,
Brent Fraser

On 3/13/2016 12:25 PM, Jeff McKenna wrote:
> Hi Brent,
>
> In my debugging while setting up this demo, I made sure to examine the 
> full WFS request sent (the example request you gave wasn't the full 
> request, I think you clicked on the wrong tab in developer tools, 
> likely the "Preview" tab by mistake; instead, in your network tab, 
> click on the 'tinyows.exe' request, which you already did, but look at 
> the bottom of the 'Headers' tab, there you can see the full request 
> sent, such as:
>
> <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.xsd http://www.tinyows.org/ 
> http://127.0.0.1/cgi-bin/tinyows.exe?service=wfs&request=DescribeFeatureType&version=1.1.0&typename=tows:frida"><wfs:Insert><feature:frida 
> xmlns:feature="http://www.tinyows.org/"><feature:geom><gml:MultiSurface xmlns:gml="http://www.opengis.net/gml" 
> srsName="EPSG:31467"><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList>3442019.5 
> 5793338.125 3443987.5 5793362.125 3443147.5 5792762.125 3442475.5 
> 5792978.125 3441323.5 5792570.125 3441155.5 5793386.125 3442019.5 
> 5793338.125</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember></gml:MultiSurface></feature:geom></feature:frida></wfs:Insert></wfs:Transaction> 
>
>
>
> -jeff
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20160313/590389be/attachment.html>


More information about the Geomoose-users mailing list