@@ -4628,41 +4628,25 @@ void QgsGeometry::transformVertex( QgsWkbPtr &wkbPtr, const QTransform& trans, b
46284628 double x, y, rotated_x, rotated_y;
46294629
46304630 QgsWkbPtr tmp = wkbPtr;
4631-
4632- memcpy ( &x, tmp, sizeof ( double ) );
4633- tmp += sizeof ( double );
4634- memcpy ( &y, tmp, sizeof ( double ) );
4635- tmp += sizeof ( double );
4636-
4631+ tmp >> x >> y;
46374632 trans.map ( x, y, &rotated_x, &rotated_y );
4638-
4639- // x-coordinate
4640- memcpy ( wkbPtr, &rotated_x, sizeof ( double ) );
4641- wkbPtr += sizeof ( double );
4642-
4643- // y-coordinate
4644- memcpy ( wkbPtr, &rotated_y, sizeof ( double ) );
4645- wkbPtr += sizeof ( double );
4633+ wkbPtr << rotated_x << rotated_y;
46464634
46474635 if ( hasZValue )
46484636 wkbPtr += sizeof ( double );
46494637}
46504638
46514639void QgsGeometry::transformVertex ( QgsWkbPtr &wkbPtr, const QgsCoordinateTransform& ct, bool hasZValue )
46524640{
4653- double x, y, z;
4654-
4655- memcpy ( &x, wkbPtr, sizeof ( double ) );
4656- memcpy ( &y, wkbPtr + sizeof ( double ), sizeof ( double ) );
4657- z = 0.0 ; // Ignore Z for now.
4641+ double x, y, z = 0.0 ;
46584642
4643+ QgsWkbPtr tmp = wkbPtr;
4644+ tmp >> x >> y;
46594645 ct.transformInPlace ( x, y, z );
4660-
4661- // new coordinate
46624646 wkbPtr << x << y;
4647+
46634648 if ( hasZValue )
46644649 wkbPtr += sizeof ( double );
4665-
46664650}
46674651
46684652GEOSGeometry* QgsGeometry::linePointDifference ( GEOSGeometry* GEOSsplitPoint )
0 commit comments