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
404 stars 108 forks source link

documentation for .omap and xmap format #2182

Closed Msabata closed 1 year ago

Msabata commented 1 year ago

Hi,

is there any documentation regarding the inner workings of .omap and xmap. These are surface object types and their boundary rendering.

<object type="1" symbol="69"><coords count="21">70440 52448 33;70433 52695;70425 52935;70433 53258 1;70433 53408;70485 53543;70628 53558 1;70740 53573;70808 53617;70928 53588 1;71070 53558;71160 53468;71213 53318 1;71325 52995;71385 52762;71453 52508 32;71475 52380 1;71063 52313;70838 52298;70433 52223;70440 52448 50;</coords><pattern rotation="0"><coord x="0" y="0"/></pattern></object>

image

For example this picture how the object is called and how the boundaries are calculated (even in code)?

Thank you very much for your help MSabata

dg0yt commented 1 year ago

In the coords element, you see the sequence of points in the outline of the object, including the control points of the bezier segments. Your text shows the compact omap format. xmap should be more explicit: Each coord is a sequence of x, y, and optionally flags. x and y are measured in 0.001 mm, flags is a combination of bits indicating bezier segments and other special roles.

Msabata commented 1 year ago

Is there a list of individual flags and their roles for both formats?

dg0yt commented 1 year ago

https://github.com/OpenOrienteering/mapper/blob/0359901f51ca7f49b8edae69d66e37658a7a4ae2/src/core/map_coord.h#L44-L95