[TinyOWS-dev] Problems with showing a WFS feature with OpenLayers

Ermond Parllaku erndal02 at hotmail.com
Wed Apr 11 01:17:19 EST 2012


Sorry if I am making any mistakes in posting the problem (haven't used before these lists). When trying to debug the js code with Internet Explorer, I see that no features are returned when creating the WFS layer. If I try this URL: http://127.0.0.1:81/cgi-bin/tinyows?service=wfs&request=DescribeFeatureType&version=1.1.0&typename=tows:GLP_Zone in the browser, it gives me all the attributes (fields) of the table in PostGIS. If I try the URL: http://127.0.0.1:81/cgi-bin/tinyows?service=wfs&request=GetFeature&version=1.1.0&typename=tows:GLP_Zone it shows me the data in the browser (as GML format). So I guess the service is configured correctly. It only should be a matter of JS code I have added or maybe any issues with the versions I am using...

Any help would be much appreciated since I desperately need to find a solution for this issue...

Thanks a lot

From: erndal02 at hotmail.com
To: tinyows-dev at lists.maptools.org
Date: Tue, 10 Apr 2012 18:57:30 +0200
Subject: [TinyOWS-dev] Problems with showing a WFS feature with OpenLayers







Hello to all,

First of all, I would like to say that I am very new with the Open-Source technologies (Apache especially). I have had experience only in MS technologies, so I am sorry for any mistakes in explaining the problems.

I installed MS4W with OpenLayers (in port 81) and I think I finally managed to configure also the TinyOWS (which I need for saving the data in PostGIS db). I configured the file config.xml in this way:

<tinyows online_resource="http://127.0.0.1:81/cgi-bin/tinyows.exe"
  schema_dir="http://127.0.0.1:81/tinyows/schema/"
         log="http://127.0.0.1:81/tinyows/tinyows.log">
  <pg host="localhost" user="postgres" password="olives001" dbname="olives_gis1" port="5432"/>
  <metadata name="TinyOWS Server"
         title="TinyOWS Server - WFS-T Frida Service" />

  <layer retrievable="1"
         writable="1"
         ns_prefix="tows"
         ns_uri="http://127.0.0.1:81/"
         srid="32634"
        prefix="tows"
        server="http://127.0.0.1:81/"
         schema="public"
         name="GLP_Zone"
         title="GLP_Zone" />
</tinyows>


In the html page, I am trying to configure two layers: one WMS layer (raster image) and one WFS layer (the layer for which I want to edit data). The WMS layer works well and is shown in the map viewer. Meanwhile the WFS layer doesn't show any features. The code for configuring the WFS layer is below:

    wfs = new OpenLayers.Layer.Vector("Editable Features", {
        styleMap: styles,
        strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
        projection: new OpenLayers.Projection("EPSG:32634"),
        protocol: new OpenLayers.Protocol.WFS({
            version: "1.1.0",
            srsName: "EPSG:32634",
            url: "http://127.0.0.1:81/cgi-bin/tinyows",
            featureNS: "http://127.0.0.1:81/",
            featureType: "GLP_Zone",
            geometryName: "tows:the_geom",
            schema: "http://127.0.0.1:81/cgi-bin/tinyows?service=wfs&request=DescribeFeatureType&version=1.1.0&typename=tows:GLP_Zone"
        })
    });
    map.addLayer(wfs);

If I try the WFS layer with QGIS it shows correctly (by the URL: http://127.0.0.1:81/cgi-bin/tinyows) and I can even edit data from the QGIS. But from the mapviewer it just doesn't show any features. It looks like the code for configuring the wfs layer within the map viewer is not correct, but I just cannot find what error am I doing (I tried to copy the example from the MapServer page but obviously I am doing something wrong).

I am using MS4W 3.0.4 (with OL included) and tinyows-1.0.0rc3. The database is in PostgreSQL & PostGIS.

Thanks a lot in advance for any help!

Ermond



 		 	   		  

_______________________________________________
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/20120411/45832823/attachment.htm 


More information about the TinyOWS-dev mailing list