@@ -114,10 +114,12 @@ void TestQgsGeometryImport::pointGeos()
114
114
QFETCH ( double , x );
115
115
QFETCH ( double , y );
116
116
117
- GEOSCoordSequence *coord = GEOSCoordSeq_create ( 1 , 2 );
118
- GEOSCoordSeq_setX ( coord, 0 , x );
119
- GEOSCoordSeq_setY ( coord, 0 , y );
120
- GEOSGeometry* geosPt = GEOSGeom_createPoint ( coord );
117
+ GEOSContextHandle_t geosctxt = QgsGeometry::getGEOSHandler ();
118
+
119
+ GEOSCoordSequence *coord = GEOSCoordSeq_create_r ( geosctxt, 1 , 2 );
120
+ GEOSCoordSeq_setX_r ( geosctxt, coord, 0 , x );
121
+ GEOSCoordSeq_setY_r ( geosctxt, coord, 0 , y );
122
+ GEOSGeometry* geosPt = GEOSGeom_createPoint_r ( geosctxt, coord );
121
123
122
124
QgsGeometry geom;
123
125
geom.fromGeos ( geosPt );
@@ -197,15 +199,17 @@ void TestQgsGeometryImport::linestringGeos()
197
199
{
198
200
QFETCH ( QVariantList, line );
199
201
202
+ GEOSContextHandle_t geosctxt = QgsGeometry::getGEOSHandler ();
203
+
200
204
// create geos coord sequence first
201
- GEOSCoordSequence *coord = GEOSCoordSeq_create ( line.count (), 2 );
205
+ GEOSCoordSequence *coord = GEOSCoordSeq_create_r ( geosctxt, line.count (), 2 );
202
206
for ( int i = 0 ; i < line.count (); i++ )
203
207
{
204
208
QPointF pt = line.at ( i ).toPointF ();
205
- GEOSCoordSeq_setX ( coord, i, pt.x () );
206
- GEOSCoordSeq_setY ( coord, i, pt.y () );
209
+ GEOSCoordSeq_setX_r ( geosctxt, coord, i, pt.x () );
210
+ GEOSCoordSeq_setY_r ( geosctxt, coord, i, pt.y () );
207
211
}
208
- GEOSGeometry* geosLine = GEOSGeom_createLineString ( coord );
212
+ GEOSGeometry* geosLine = GEOSGeom_createLineString_r ( geosctxt, coord );
209
213
QgsGeometry geom;
210
214
geom.fromGeos ( geosLine );
211
215
QVERIFY ( geom.wkbType () == QGis::WKBLineString );
0 commit comments