XML Mapfiles... are we looking to far?

Steve Lime Steve.Lime at DNR.STATE.MN.US
Wed Jul 19 10:51:28 EDT 2006


I've thought for sometime that using XSL might be a nice bridge as we move in that direction. At least one could manage their configuration in XML than transform as necessary to create a mapfile for run-time use. There were some folks comtemplating developing a configuration schema file as a start a while back but they've disappeared as far as I know. 

I think that would be a nice first step if someone were to take it on: create mapfile XSD and XSL files. Ultimately we probably will have to be able to read a XML config file. I've toyed with using expat in developing a mapfile_xml.c. The underlying C structures would be the same, but a SAX parser would be used instead of Flex to tokenize the config file. Just never had time.

Steve

>>> "Julien, Heryk" <hjulien at NRCAN.GC.CA> 7/18/2006 8:45 AM >>>
Hi Tamas,

I think there are many advantages in using xml. First, XML files are easy to create and schema validation can check document structure while you are writing it. Schema aware editors can also give you hints and do automatic inputs of required tags while writing mapfile document. Yes Mapserver validates mapfiles, but I think the addition of a mapfile structure validator like xsd would facilitate mapfile creation and debugging.

 

Schemas can help newbie's to create there first config files and advanced users and developers visualise, communicate and work on the current mapfile format. I also think that it would be easier to extend the mapfile structure in future Mapserver versions if we where using an xml format... for example adding new OGC tags to mapfiles would be very easy.

 

Plus with all the new xml editing tools out there, schema creation, visualisation and validation has become a child's play (hmmm.... well almost!). 

 

Just as you said earlier, automating map config creation would be another great benefit. And if Mapserver could read non static mapfiles (via URL's), xml would be a great way to create dynamically generated mapfiles. If we consider mapfiles as being a kind of database (or database pointer), wouldn't it be great to be able to easily process it on the fly? XML coupled with xsl, xpath and databases would be one great way to do that kind of manipulation. A little like OGC WMC layers that are pointing to different data layers (wms layers), we could have dynamically generated mapfiles instead of one huge static file containing all data layers.

 

Xml being rapidly more and more widespread, ways for developers to input serialization data into Mapserver would be much greater and flexible. Mapfile management would be more open and greatly enhanced with the use of xml. For example a url fetched xml mapfile would enable us to easily modify a mapfile service according to certain parameter like language. We could thus have an automated multilingual mapfile. Currently we have to save a static mapfile for every language. They all point to the same data but containing language specific titles and metadata.

 

Being an OGC fan, I think there decision to use xml to disseminate data and ease interop has been a good choice. In that same line of thought, I think an xml mapfiles format to serialize Mapserver would be a logical next step.

 

Cheers

Héryk

 

_____________________________

Héryk Julien

Research Officer

Natural Resources Canada

490 rue de la Couronne

Québec, Canada

 



More information about the mapserver-dev mailing list