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

IofCourseExport: Add 'Map' element #2168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dl3sdo
Copy link
Member

@dl3sdo dl3sdo commented Jul 6, 2023

The 'Map' element is added to the IOF 3.0 compliant xml export of course data.

This commit partly solves #2167, #2166.

@dl3sdo dl3sdo marked this pull request as draft July 6, 2023 08:38
Comment on lines +113 to +128
// IOF.xsd proposes for 'MapPositionTopLeft': "The position of the map's top left corner given in the map's coordinate system, usually (0, 0)."
// However, the real coordinates from the map_extent structure are used below.
// NOTE: templates are considered when determining the map extent.
const auto map_extent = map->calculateExtent(true, true, view);
{
XmlElementWriter map_position_topleft(*xml, QLatin1String("MapPositionTopLeft"));
map_position_topleft.writeAttribute(QLatin1String("x"), QString::number(map_extent.topLeft().x()));
map_position_topleft.writeAttribute(QLatin1String("y"), QString::number(map_extent.topLeft().y()));
map_position_topleft.writeAttribute(QLatin1String("unit"), QLatin1String("mm")); // optional attribute, default is 'mm'
}
{
XmlElementWriter map_position_bottomright(*xml, QLatin1String("MapPositionBottomRight"));
map_position_bottomright.writeAttribute(QLatin1String("x"), QString::number(map_extent.bottomRight().x()));
map_position_bottomright.writeAttribute(QLatin1String("y"), QString::number(map_extent.bottomRight().y()));
map_position_bottomright.writeAttribute(QLatin1String("unit"), QLatin1String("mm")); // optional attribute, default is 'mm'
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the extent information useful at all when not also providing the Image element?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the extent information useful at all when not also providing the Image element?

Good question, but I assume yes, since the 'Image' element is not mandatory and the PR works for the issue reporter due to #2166

The 'Map' element is added to the IOF 3.0 compliant xml export of
course data.
@dl3sdo dl3sdo marked this pull request as ready for review June 12, 2024 13:47
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

Successfully merging this pull request may close these issues.

2 participants