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-us...@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"



--
Alexandre Dubé
Mapgears
www.mapgears.com

_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to