使用标准 Mapfile 配置tinyows

对tinyows的mapfile配置文件支持

Tinyows支持标准的MapServer Mapfile 作为配置文件。这允许单个文件同时配置mapserver和tinyows。(例如,如果您同时使用两种方法,一种用于WMS,另一种用于WFS-T,可能会很有用)

tinyows不会处理 Mapfile 中的所有参数,但会忽略tinyows中未实现的任何额外参数,而不会出错。

如果愿意,可以使用XML文件配置tinyows( 使用XML文件配置tinyows

要指示 Mapfile 的位置,请使用tinyows binary中的“tinyows_mapfile”环境变量。

以下是单个 Mapfile 的示例:

MAP
    NAME "TinyOWS"

    WEB
         METADATA
                    "tinyows_schema_dir" "/usr/local/share/tinyows/schema/"
                    "tinyows_onlineresource" "127.0.0.1/cgi-bin/tinyows.fcgi"
                    "wfs_title" "TinyOWS service provided by a MapFile"
                    "wfs_contact" "foo@bar.net"
         END
    END

    LAYER
            NAME 'France'
            CONNECTIONTYPE postgis
            CONNECTION "host=127.0.0.1 user=postgres password=postgres dbname=tinyows_demo port=5432"
            METADATA
                    'wfs_title' 'France'
                    'wfs_namespace_prefix' 'tows'
                    'wfs_namespace_uri' 'http://www.mapserver.org/tinyows/'
                    'wfs_srs' 'EPSG:27582'
                    'tinyows_table'  'france'
                    'tinyows_writable' '1'
                    'tinyows_retrievable' '1'
            END
            DUMP TRUE
    END
END

当前概念和局限性:

  • 只有 PostGIS CONNECTIONTYPE 被处理

  • TinyOWS 不支持mapfile中的所有可用WFS参数。但另一方面,你能够用 Mapfile 配置 TinyOWS 的每个部分。

  • 这个 CONNECTION 每个层中的字符串值必须相同。

  • Mapfile PROJECTION 未分析内容,因此请使用显式 wfs_srs .

  • Mapfile LAYERFILTER 未解析。

  • 默认值是tinyows值,即使是tinyows和mapserver共享的公共属性。

  • TinyOWS 不使用 DATA 元素,因此必须使用 tinyows_table (和 tinyows_schema 如果需要的话)在每一层。

  • 如果 DUMP 未设置为 TRUE 在一个层上,该层的读写访问都被禁用。

每个tinyows配置元素的mapfile路径

原始 TinyOWS XML 配置文件

Mapfile 对应项

/tinyows@online_resource

/map/metadata@tinyows_onlineresource

/tinyows@schema_dir

/map/metadata@tinyows_schema_dir

/tinyows@log

/map/metadata@tinyows_log

/tinyows@log_level

/map/metadata@tinyows_log_level

/tinyows@degree_precision

/map/metadata@tinyows_degree_precision

/tinyows@meter_precision

/map/metadata@tinyows_meter_precision

/tinyows@display_bbox

/map/metadata@tinyows_display_bbox

/tinyows@estimated_extent

/map/metadata@tinyows_estimated_extent

/tinyows@check_schema

/map/metadata@tinyows_check_schema

/tinyows@check_valid_geom

/map/metadata@tinyows_check_valid_geom

/tinyows@encoding

/map/metadata@wfs_encoding

/tinyows@db_encoding

/map/metadata@tinyows_db_encoding

/tinyows@expose_pk

/map/metadata@tinyows_expose_pk

/tinyows/limits@features

/map/metadata@wfs_maxfeatures

/tinyows/limits@geobbox

/map/metadata@tinyows_geobbox

/tinyows/pg@host

/map/layer@connection

/tinyows/pg@user

/map/layer@connection

/tinyows/pg@password

/map/layer@connection

/tinyows/pg@dbname

/map/layer@connection

/tinyows/pg@port

/map/layer@connection

/tinyows/pg@encoding

/map/metadata@tinyows_db_encoding

/tinyows/metadata@name

/map@name

/tinyows/metadata@title

/map/metadata@wfs_title

/tinyows/metadata@keywords

/map/metadata@wfs_keywordlist

/tinyows/metadata/abstract

/map/metadata@wfs_abstract

/tinyows/metadata@fees

/map/metadata@wfs_fees

/tinyows/metadata@access_constraints

/map/metadata@wfs_accessconstraints

/tinyows/layer@ns_prefix

/map/layer/metadata@wfs_namespace_prefix或/map/metadata@wfs_namespace_prefix

/tinyows/layer@ns_uri

/map/layer/metadata@wfs_namespace_uri或/map/metadata@wfs_namespace_uri

/tinyows/layer@name

/map/layer@name

/tinyows/layer@title

/map/layer/metadata@wfs_title

/tinyows/layer@retrievable

/map/layer/metadata@tinyows_retrievable 和 /map/layer@dump

/tinyows/layer@writable

/map/layer/metadata@tinyows_writable 和 /map/layer@dump

/tinyows/layer@schema

/map/layer/metadata@tinyows_schema

/tinyows/layer@keywords

/map/layer/metadata@wfs_keywordlist

/tinyows/layer/abstract

/map/layer/metadata@wfs_abstract

/tinyows/layer@srid

/map/metadata@wfs_srs 和 /map/layer/metadata@wfs_srs

/tinyows/layer@geobbox

/map/layer/metadata@tinyows_geobbox

/tinyows/layer@include_items

/map/layer/metadata@include_items

/tinyows/layer@exclude_items

/map/layer/metadata@exclude_items

/tinyows/layer@pkey

/map/layer/metadata@pkey

/tinyows/contact@name

/map/metadata@ows_contactorganization

/tinyows/contact@site

/tinyows/contact@email

/map/metadata@ows_contactelectronicmailaddress

/tinyows/contact@individual_name

/map/metadata@ows_contactperson

/tinyows/contact@position

/map/metadata@ows_contactposition

/tinyows/contact@phone

/map/metadata@ows_contactvoicetelephone

/tinyows/contact@fax

/map/metadata@ows_contactfacsimiletelephone

/tinyows/contact@online_resource

/tinyows/contact@address

/map/metadata@ows_address

/tinyows/contact@city

/map/metadata@ows_city

/tinyows/contact@administrative_area

/tinyows/contact@country

/map/metadata@ows_country

/tinyows/contact@hours_of_service

/tinyows/contact@contact_instructions