[mapserver-users] tinyows

aho forum.email.a at googlemail.com
Mon Nov 12 07:31:31 PST 2012


Hi Alexandre,

I already reinstalled pyhton and made the configuration of the apache 
server again. At least one thing I can exclude - specially because 
sooner or later I have to include it in another project which needs to 
run on a certain port. Anyhow... I also installed the wget and you are 
right, it helps a lot.
I took the GetFeature xml from chrome and constructed the following line:

wget "http://localhost/cgi-bin/tinyows.exe" --post-data="<wfs:GetF
eature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" 
version="1.0.0" outp
utFormat="application/json" 
xsi:schemaLocation="http://schemas.opengis.net/wfs/1
.0.0/WFS-transaction.xsd" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wfs:Query typeName="feature:frida" 
xmlns:feature="http://127.0.0.1/"><ogc:Filte
r 
xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX><ogc:PropertyName>the_geom</o
gc:PropertyName><gml:Box xmlns:gml="http://www.opengis.net/gml" 
srsName="EPSG:31
467"><gml:coordinates decimal="." cs="," ts=" ">3413084,5782000 
3457916,5806000<
/gml:coordinates></gml:Box></ogc:BBOX></ogc:Filter></wfs:Query></wfs:GetFeature>
" --header="Content-Type: application/xml; charset=UTF-8" -O C:/test.txt

wget returned:

SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\OSGeo4W\GnuWin32/etc/wgetrc
--2012-11-12 16:17:16--  http://localhost/cgi-bin/tinyows.exe
Resolving localhost... 127.0.0.1, ::1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/xml]
Saving to: `C:/test.txt'
     [ <=>                                   ] 503 --.-K/s   in 0s

2012-11-12 16:17:16 (11.4 MB/s) - `C:/test.txt' saved [503]
--2012-11-12 16:17:16-- 
http://%3E3413084,5782000%203457916,5806000%3C/gml:coor
dinates%3E%3C/gml:Box%3E%3C/ogc:BBOX%3E%3C/ogc:Filter%3E%3C/wfs:Query%3E%3C/wfs:
GetFeature%3E
Resolving >3413084,5782000 3457916,5806000<... failed: No data record of 
request
ed type.
wget: unable to resolve host address `>3413084,5782000 3457916,5806000<'
FINISHED --2012-11-12 16:17:17--
Downloaded: 1 files, 503 in 0s (11.4 MB/s)


I have really no idea why it is using the coordinates of the bounding 
box for the host?! I thought it would be a problem of wget and the 
quotation marks... but changing that to ' did not solve the problem.
In my test.txt is still the same response: invalid xml. Nothing else 
unfortunately. I think its a problem in my openlayers configuration - I 
check the spatial reference again; maybe I can also set the bbox or 
something. I will see...

If you or anyone else has an idea I will be very happy!
Anna

Am 11/12/2012 2:42 PM, schrieb Alexandre Dubé:
> Hi Anna,
>
>   While working locally, you don't need to set an 
> OpenLayers.ProxyHost.  Put comments // in front of it for now.
>
>   tinyows-1.0.0-weather-sites.fcgi -> copy your tinyows.exe file 
> giving it the name you want.  In Linux, you could use a symbolic link, 
> like I did.  Here's the apache config for it.  It does 2 things : it 
> enables FastCgi and set the TINYOWS_CONFIG_FILE env variable for this 
> link to use a specific .xml config file.
>
> ###
> FastCgiServer /usr/lib/cgi-bin/tinyows-1.0.0-weather-sites.fcgi 
> -initial-env 
> TINYOWS_CONFIG_FILE=/opt/labs/weather-sites/etc/tinyows/config.xml
> ScriptAlias "/weather-sites-tinyows-1.0.0.fcgi" 
> "/usr/lib/cgi-bin/tinyows-1.0.0-weather-sites.fcgi"
> ###
>
> Once you start using wget, the idea is to edit the xml GetFeature 
> request sent and/or the config.xml file as you try it to quickly see 
> what causes things to not work.  Point to tinyows for now, you your 
> proxy (yet), i.e. make your tinyows work first.
>
> Best regards,
>
> Alexandre
>
>
> On 12-11-12 04:05 AM, aho wrote:
>> Hi Alexandre,
>>
>> thanks for the good hints! This is really great! I think its not my 
>> tinyows.xml or the Openlayers... but the error message tells 
>> something else somehow... :(...  I changed it to the following:
>> xml configuration of tinyows:
>>
>> <tinyows online_resource="http://127.0.0.1/cgi-bin/tinyows.exe"
>>        schema_dir="C:\ms4w\apps\tinyows\schema\"
>>        log="C:\ms4w\Apache\logs\tinows.log" log_level="15">
>> <pg host="127.0.0.1" user="postgres" password="postgres" 
>> dbname="tinyows" port="5432"/>
>> <metadata name="TinyOWS Server"
>>           title="TinyOWS Server - WFS-T Frida Service" />
>> <contact name="TinyOWS Server"
>>          site="http://www.tinyows.org/"
>>          email="tinyows-users at lists.maptools.org" />
>> <layer retrievable="1"
>>         writable="1"
>>        ns_prefix="tows"
>>        ns_uri="http://127.0.0.1/"
>>        name="frida"
>>        title="Frida Parks" />
>> </tinyows>
>>
>> and the OpenLayers code:
>>
>>   map = new OpenLayers.Map('map', {
>>       projection: new OpenLayers.Projection("EPSG:31467"),
>>       units: "m",
>>       maxResolution: "auto",
>>       maxExtent: new OpenLayers.Bounds(3427000,5788000,3444000,5800000),
>>       controls: [
>>           new OpenLayers.Control.PanZoom()
>>       ]
>>   });
>>   var osm = new OpenLayers.Layer.WMS(
>>       "OSM by Omniscale WMS",
>>       "http://osm.omniscale.net/proxy/service",
>>       {layers: 'osm', format: 'image/jpeg'},
>>       {projection:"EPSG:31467",  units: "m", maxResolution: "auto", 
>> maxExtent: new OpenLayers.Bounds(3427000,5788000,3444000,5800000)}
>>   );
>>   var saveStrategy = new OpenLayers.Strategy.Save();
>>   saveStrategy.events.register("success", '', showSuccessMsg);
>>   saveStrategy.events.register("fail", '', showFailureMsg);
>>   var wfs = new OpenLayers.Layer.Vector("Editable Features", {
>>       strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
>>       projection: new OpenLayers.Projection("EPSG:31467"),
>>       protocol: new OpenLayers.Protocol.WFS({
>>             version:"1.1.0",
>>           url: "http://127.0.0.1/cgi-bin/tinyows.exe",
>>           featureType: "frida",
>>           outputformat:"application/json",
>>           readFormat: new OpenLayers.Format.GeoJSON(),
>>           featureNS: "http://127.0.0.1/",
>>           geometryName: "the_geom"
>>       })
>> });
>>   map.addLayers([osm, wfs]);
>>
>>   map.zoomToMaxExtent();
>>
>> The layer is actually in  31467 - I want to get it working for the 
>> frida parks example. I reduced everything else in my javascript file.
>>
>> But I think I have a problem with my configuration. I am setting the 
>> following in OpenLayers: OpenLayers.ProxyHost = 
>> "/cgi-bin/proxy.cgi?url="; and I saw that you were actually refering 
>> to a fcgi file in your config.xml. I thought I could define there the 
>> path to the tinyows.exe like this: 
>> http://127.0.0.1/cgi-bin/tinyows.exe - do I also give the proxy there?
>> Could you send me the content of your 
>> weather-sites-tinyows-1.0.0.fcgi file? I have to say that I can´t 
>> follow your instructions for setting the environment variable - I 
>> made that via the control Panel :) - and the ScriptAlias.
>>
>> I have to install the wget first on windows, but thanks for that hint 
>> - I will try it after the restart now!
>>
>> Thanks in advance,
>> Anna
>>
>>
>>
>>
>>
>> Am 11/9/2012 2:50 PM, schrieb Alexandre Dubé:
>>> ### The apache config used to bind TinyOWS to this config using a 
>>> different url
>>> FastCgiServer /usr/lib/cgi-bin/tinyows-1.0.0-weather-sites.fcgi 
>>> -initial-env 
>>> TINYOWS_CONFIG_FILE=/opt/labs/weather-sites/etc/tinyows/config.xml
>>> ScriptAlias "/weather-sites-tinyows-1.0.0.fcgi" 
>>> "/usr/lib/cgi-bin/tinyows-1.0.0-weather-sites.fcgi" 
>>
>
>



More information about the mapserver-users mailing list