[mapserver-users] No Layers when configuring TinyOWS with a Mapserver (.map) File

Richard Greenwood richard.greenwood at gmail.com
Tue Oct 27 06:09:46 PDT 2015


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.

Regardless of whether I have a valid or invalid map file tinyows always
returns:
   <Exception exceptionCode='LayerNotDefined' locator='typename'>
      <ExceptionText>Unknown layer name</ExceptionText>
   </Exception>
I've tested with both an OpenLayers web interface and with QGIS. I built
1.1.1 from source on Ubuntu 14.04.

Can anyone suggests steps that I should take to narrow down the problem
more?

Thanks,
Rich


On Mon, Oct 12, 2015 at 4:26 AM, Balajee R.C <balajee at vizexperts.com> wrote:

> Am trying to expose a vector layer (loaded from shape file into PostGIS)
> as a WFS layer using tinyows.
>
> Following the instructions in the mapserver/tinyows documentation, here is
> the .map file I have come up with so far:
>
>     MAP
>         NAME "world"
>         CONFIG "MS_ERRORFILE"
> "/home/balajeerc/Projects/Build_Dir/myproject/data/logs/mapservice_errors.log"
>         EXTENT -180.000 -90.000 180.000 90.000
>
>         WEB
>             METADATA
>                 "tinyows_schema_dir"
> "/home/balajeerc/Projects/Build_Dir/myproject/deps/mygis-services-0.1/data/schema"
>                 "tinyows_onlineresource" "
> http://192.168.43.164:19090/vectors/world/wfs?"
>                 "wfs_title" "MyGIS Feature Service: World"
>                 "wfs_contact" "support at giscompany.com"
>                 "wms_title" "MyGIS Feature Service: World"
>                 "wms_srs" "epsg:4326"
>                 "wms_enable_request" "*"
>                 "log_level" "15"
>                 "log"
> "/home/balajeerc/Projects/Build_Dir/myproject/deps/mygis-services-0.1/data/logs/wfs_world.log"
>                 "ows_contactorganization" "MyCompany"
>                 "ows_contactelectronicmailaddress" "contact at giscompany.com
> "
>                 "ows_contactperson" "Balajee.R.C"
>             END
>         END
>
>         PROJECTION
>             "init=epsg:4326"
>         END
>
>         LAYER
>             NAME 'world_boundaries'
>             CONNECTIONTYPE postgis
>             CONNECTION "host=localhost user=mygis password=asdf123
> dbname=mygis port=19095"
>             DATA "geom from world_boundaries"
>             TYPE POLYGON
>             METADATA
>                 'wfs_title' 'world_boundaries'
>                 'wfs_namespace_prefix' 'tows'
>                 'wfs_namespace_uri' 'http://www.giscompany.com/'
>                 'wfs_srs' 'epsg:4326'
>                 'wms_srs' 'epsg:4326'
>                 'wms_title' 'world_boundaries'
>                 'tinyows_table'  'world_boundaries'
>                 'tinyows_writable' '1'
>                 'tinyows_retrievable' '1'
>             END
>             CLASS
>                 STYLE
>                     COLOR 128 128 128
>                     ANTIALIAS true
>                 END
>             END
>             PROJECTION
>               "init=epsg:4326"
>             END
>             DUMP TRUE
>         END
>     END
>
> 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.
>
> 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).
>
> The output from `tinyows --check` is as follows:
>
>     balajeerc at Balajee:~/Projects/tinyows-1.1.1$ ./tinyows --check
>     TinyOWS version:   1.1.0
>     FCGI support:      Yes
>     Config File Path:
> /home/balajeerc/Projects/Build_Dir/myproject/data/service_data/data/wfs/world.map
> (Mapfile)
>     PostGIS Version:   2.1.8
>     PostGIS dsn:       host=localhost user=mygis password=asdf123
> dbname=mygis port=19095
>     Output Encoding:   UTF-8
>     Database Encoding: UTF8
>     Schema dir:
> /home/balajeerc/Projects/Build_Dir/myproject/deps/mygis-services-0.1/data/schema
>     Display bbox:      Yes
>     Estimated extent:  No
>     Check schema:      Yes
>     Check valid geoms: Yes
>     Available layers:
>     balajeerc at Balajee:~/Projects/tinyows-1.1.1$
>
> 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.
>
> 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.
>
> 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`.
>
> At this point I am completely stuck and at a brick wall as to what might
> be going wrong. Can someone here please help?
>
> TinyOWS version: 1.1.1 (Release
> <https://github.com/mapserver/tinyows/releases/tag/v.1.1.1>)
>
> Regards,
> Balajee.R.C
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>



-- 
Richard W. Greenwood, PLS
www.greenwoodmap.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20151027/dadaebb9/attachment.htm>


More information about the MapServer-users mailing list