Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Layers when configuring TinyOWS with a Mapserver (.map) File #80

Open
balajeerc opened this issue Oct 21, 2015 · 1 comment
Open

Comments

@balajeerc
Copy link

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" "[email protected]"
            "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" "GeorbisServer"
            "ows_contactelectronicmailaddress" "[email protected]"
            "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@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@Balajee:~/Projects/tinyows-1.1.1$ 

Note that even though I am using a 1.1.1 (release) 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.

After asking in the mailing lists (mapserver-users) and not getting any response, I suspect that this is a bug. Can someone please confirm this?

@balajeerc
Copy link
Author

Have posted a bug bounty for this bug here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant