Open
Description
Steps to reproduce
- Generate DXF file with rotated POINT objects (slope lines, springs, cave, bouldery field etc.)
- Import DXF into new map
- Point objects are not rotated as should, but pointing north
Actual behaviour
Point object rotation angle is defined in DXF file (like below POINT code 50 angle -167.00), but are lost in Import
POINT
8
101.1_slope_line
10
12345.00
20
67890.50
50
-167.00
0
Expected behaviour
Point object rotation angle should be set accordingly (when defined) during file import.
Proposal
I believe DXF file is imported through OGR and POINTs with importPointGeometry function. If so and if original DXF angle is stored into OGR symbol details (which I do not know) the same way as with Text objects, then it could work something like..
Object* OgrFileImport::importPointGeometry(OGRFeatureH feature, OGRGeometryH geometry)
{
...
if (symbol->getType() == Symbol::Point)
{
auto object = new PointObject(symbol);
object->setPosition(toMapCoord(OGR_G_GetX(geometry, 0), OGR_G_GetY(geometry, 0)));
// get rotation angle from symbol details
const auto& description = symbol->getDescription();
auto split = description.indexOf(QLatin1Char(' '));
auto angle = QStringRef(&description, 3, split-3).toDouble(&ok);
if (ok)
{
object->setRotation(qDegreesToRadians(angle));
}
return object;
}
...
Configuration
Mapper Version: 0.9.5
Operating System: All
Metadata
Metadata
Assignees
Labels
No labels