<div dir="ltr">I am also unable to get tinyows to work using a map file, even with the example map file from the documentation. I have both the example and my own layer working with an XML file, so I believe there is either a bug with map file support or something missing from the documentation. <div><br></div><div>Regardless of whether I have a valid or invalid map file tinyows always returns:<div><div>   <Exception exceptionCode='LayerNotDefined' locator='typename'></div><div>      <ExceptionText>Unknown layer name</ExceptionText></div><div>   </Exception></div></div><div>I've tested with both an OpenLayers web interface and with QGIS. I built 1.1.1 from source on Ubuntu 14.04.</div><div><br></div><div>Can anyone suggests steps that I should take to narrow down the problem more?</div><div><br></div><div>Thanks,</div><div>Rich</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 12, 2015 at 4:26 AM, Balajee R.C <span dir="ltr"><<a href="mailto:balajee@vizexperts.com" target="_blank">balajee@vizexperts.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Am trying to expose a vector layer (loaded from shape file into PostGIS) as a WFS layer using tinyows.<br><div class="gmail_quote"><div dir="ltr"><div><div><br>Following the instructions in the mapserver/tinyows documentation, here is the .map file I have come up with so far:<br><br>    MAP<br>        NAME "world"<br>        CONFIG "MS_ERRORFILE" "/home/balajeerc/Projects/Build_Dir/myproject/data/logs/mapservice_errors.log"<br>        EXTENT -180.000 -90.000 180.000 90.000<br>    <br>        WEB    <br>            METADATA<br>                "tinyows_schema_dir" "/home/balajeerc/Projects/Build_Dir/myproject/deps/mygis-services-0.1/data/schema"<br>                "tinyows_onlineresource" "<a href="http://192.168.43.164:19090/vectors/world/wfs" target="_blank">http://192.168.43.164:19090/vectors/world/wfs</a>?"<br>                "wfs_title" "MyGIS Feature Service: World"<br>                "wfs_contact" "<a href="mailto:support@giscompany.com" target="_blank">support@giscompany.com</a>"<br>                "wms_title" "MyGIS Feature Service: World"<br>                "wms_srs" "epsg:4326"<br>                "wms_enable_request" "*"<br>                "log_level" "15"<br>                "log" "/home/balajeerc/Projects/Build_Dir/myproject/deps/mygis-services-0.1/data/logs/wfs_world.log"<br>                "ows_contactorganization" "MyCompany"<br>                "ows_contactelectronicmailaddress" "<a href="mailto:contact@giscompany.com" target="_blank">contact@giscompany.com</a>"<br>                "ows_contactperson" "Balajee.R.C"<br>            END<br>        END<br>    <br>        PROJECTION<br>            "init=epsg:4326"<br>        END<br>    <br>        LAYER<br>            NAME 'world_boundaries'<br>            CONNECTIONTYPE postgis<br>            CONNECTION "host=localhost user=mygis password=asdf123 dbname=mygis port=19095"<br>            DATA "geom from world_boundaries"<br>            TYPE POLYGON<br>            METADATA<br>                'wfs_title' 'world_boundaries'<br>                'wfs_namespace_prefix' 'tows'<br>                'wfs_namespace_uri' '<a href="http://www.giscompany.com/" target="_blank">http://www.giscompany.com/</a>'<br>                'wfs_srs' 'epsg:4326'<br>                'wms_srs' 'epsg:4326'<br>                'wms_title' 'world_boundaries'<br>                'tinyows_table'  'world_boundaries'<br>                'tinyows_writable' '1'<br>                'tinyows_retrievable' '1'<br>            END<br>            CLASS<br>                STYLE<br>                    COLOR 128 128 128<br>                    ANTIALIAS true<br>                END<br>            END<br>            PROJECTION<br>              "init=epsg:4326"<br>            END<br>            DUMP TRUE<br>        END<br>    END<br><br>This .map file works fine with mapserver, i.e. I am able to render the feature layer as a WMS service using QGIS as a client.<br><br>However, the WFS service (served by tinyows) using the same file (set using `TINYOWS_MAPFILE` environment variable seems to show no layers in GetCapabilities (and hence QGIS is not able to load any).<br><br>The output from `tinyows --check` is as follows:<br><br>    balajeerc@Balajee:~/Projects/tinyows-1.1.1$ ./tinyows --check<br>    TinyOWS version:   1.1.0<br>    FCGI support:      Yes<br>    Config File Path:  /home/balajeerc/Projects/Build_Dir/myproject/data/service_data/data/wfs/world.map (Mapfile)<br>    PostGIS Version:   2.1.8<br>    PostGIS dsn:       host=localhost user=mygis password=asdf123 dbname=mygis port=19095<br>    Output Encoding:   UTF-8<br>    Database Encoding: UTF8<br>    Schema dir:        /home/balajeerc/Projects/Build_Dir/myproject/deps/mygis-services-0.1/data/schema<br>    Display bbox:      Yes<br>    Estimated extent:  No<br>    Check schema:      Yes<br>    Check valid geoms: Yes<br>    Available layers:<br>    balajeerc@Balajee:~/Projects/tinyows-1.1.1$ <br><br>Note that even though I am using a 1.1.1 version of tinyows, it prints tinyows version as 1.1.0. Also note that it prints no layers.<br><br>Wondering what is going wrong, I decided to step into the code. I recompiled code after turning off (`-O2`) optimizations and with debugging (`-g`) enabled.<br><br>I am only able to get so far as the `ows_parse_config` method in `src/ows/ows_config.c`. I am, for some reason not able to step into `ows_parse_config_map` in `src/mapfile/mapfile.c`. This probably has something to do with the fact that `mapfile.c` is generated by flex using `src/map/mapfile.l`.<br><br>At this point I am completely stuck and at a brick wall as to what might be going wrong. Can someone here please help?<br><br></div><div>TinyOWS version: 1.1.1 (<a href="https://github.com/mapserver/tinyows/releases/tag/v.1.1.1" target="_blank">Release</a>)<br></div><div><br></div>Regards,<br></div>Balajee.R.C<br></div>
</div><br></div>
<br>_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Richard W. Greenwood, PLS<br><a href="http://www.greenwoodmap.com" target="_blank">www.greenwoodmap.com</a></div></div>
</div>