OpenOrienteering / mapper

OpenOrienteering Mapper is a software for creating maps for the orienteering sport.
https://www.openorienteering.org/apps/mapper/
GNU General Public License v3.0
402 stars 106 forks source link

XML File Format #97

Closed dg0yt closed 9 years ago

dg0yt commented 12 years ago

dg0yt reported on Sourceforge [tickets:#97]:

Mapper shall have an XML file format.

There already is an XML file format implementation in Mapper but it is outdated. That is why it is disabled by default. (It can be enable with setting Mapper_XML_FORMAT=1 in CMake.)

dg0yt commented 12 years ago

puzzlepaint posted on Sourceforge:

In current master, there is now a unit test which checks for every file format which supports import and export if maps stay the same when saved in this format and loaded again. The test is not 100% complete (for undo steps, currently only the number of steps is checked), but this will still be useful to test the XML format.

I also changed the importer / exporter interfaces a bit:

dg0yt commented 12 years ago

The current Mapper XML format implementation is based on QDomDocument and friends. "The QDom classes have a few issues of nonconformance with the XML specifications" (Qt 4.8 doc), and are in the deprecated Qt XML module in Qt 5. Mapper XML format shall be reimplemented with QXmlStreamReader and QXmlStreamWriter.

dg0yt commented 12 years ago

A preliminary implementation is now in master. It does not yet export/import all map features, but colors, symbols and objects are complete. This is for first experiments. The format may still receive some incompatible changes.

Enable the format with Mapper_XML_FORMAT=1 when running CMake.

dg0yt commented 12 years ago

The implementation is completed, and the XML file format is no longer marked as lossy. Open issues:

Some minor TODOs have been marked in the source code.

dg0yt commented 12 years ago
dg0yt commented 12 years ago

puzzlepaint posted on Sourceforge:

I did some more manual tests now. Still to investigate: the position of a georeferenced template in my test files is slightly off when loaded from XML. Opening the georef dialog and clicking ok moves it into its correct position (half a meter away or so).

Regarding the format / implementation:

dg0yt commented 12 years ago

puzzlepaint posted on Sourceforge:

Finished with manual checking now. The reason for the georeferenced template being off was that some digits were rounded off in the georeferencing settings because the default output precision of QString::number() is not high enough.

The two questions from the above comment are still open.

dg0yt commented 12 years ago
dg0yt commented 12 years ago

puzzlepaint posted on Sourceforge:

Okay, I changed both. You're right, it's better not to trust the information in the file. However I think that the chance of very high numbers caused by programming errors is much higher than the chance of a maliciously crafted orienteering map ;-)

dg0yt commented 11 years ago
dg0yt commented 11 years ago

Feature stabilizing. Received some fixes after 0.4.0. Closing feature request.

dg0yt commented 11 years ago

Somebody posted on Sourceforge:

(Moved to #182 - Kai.)