Skip to content

Commit e4ab3f2

Browse files
committed
Merge remote-tracking branch 'rouault/use_geos_reentrant_api'
Conflicts: src/core/pal/layer.cpp src/core/qgsgeometry.cpp src/core/qgspallabeling.cpp
2 parents e46aa62 + 6354dd3 commit e4ab3f2

File tree

14 files changed

+468
-503
lines changed

14 files changed

+468
-503
lines changed

cmake/FindGEOS.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ ELSE(WIN32)
8484
STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" GEOS_VERSION_MAJOR "${GEOS_VERSION}")
8585
STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" GEOS_VERSION_MINOR "${GEOS_VERSION}")
8686

87-
IF (GEOS_VERSION_MAJOR LESS 3)
88-
MESSAGE (FATAL_ERROR "GEOS version is too old (${GEOS_VERSION}). Use 3.0.0 or higher.")
89-
ENDIF (GEOS_VERSION_MAJOR LESS 3)
87+
IF (GEOS_VERSION_MAJOR LESS 3 OR (GEOS_VERSION_MAJOR EQUAL 3 AND GEOS_VERSION_MINOR LESS 1) )
88+
MESSAGE (FATAL_ERROR "GEOS version is too old (${GEOS_VERSION}). Use 3.1.0 or higher.")
89+
ENDIF (GEOS_VERSION_MAJOR LESS 3 OR (GEOS_VERSION_MAJOR EQUAL 3 AND GEOS_VERSION_MINOR LESS 1) )
9090

9191
# set INCLUDE_DIR to prefix+include
9292
EXEC_PROGRAM(${GEOS_CONFIG}

src/analysis/vector/qgsgeometryanalyzer.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,36 +1100,37 @@ bool QgsGeometryAnalyzer::createOffsetGeometry( QgsGeometry* geom, QgsGeometry*
11001100

11011101
QList<GEOSGeometry*> outputGeomList;
11021102
QList<QgsGeometry*>::const_iterator inputGeomIt = inputGeomList.constBegin();
1103+
GEOSContextHandle_t geosctxt = QgsGeometry::getGEOSHandler();
11031104
for ( ; inputGeomIt != inputGeomList.constEnd(); ++inputGeomIt )
11041105
{
11051106
if ( geom->type() == QGis::Line )
11061107
{
11071108
//geos 3.3 needed for line offsets
11081109
#if defined(GEOS_VERSION_MAJOR) && defined(GEOS_VERSION_MINOR) && \
11091110
((GEOS_VERSION_MAJOR>3) || ((GEOS_VERSION_MAJOR==3) && (GEOS_VERSION_MINOR>=3)))
1110-
GEOSGeometry* offsetGeom = GEOSOffsetCurve(( *inputGeomIt )->asGeos(), -offset, 8 /*quadSegments*/, 0 /*joinStyle*/, 5.0 /*mitreLimit*/ );
1111-
if ( !offsetGeom || !GEOSisValid( offsetGeom ) )
1111+
GEOSGeometry* offsetGeom = GEOSOffsetCurve_r(geosctxt, ( *inputGeomIt )->asGeos(), -offset, 8 /*quadSegments*/, 0 /*joinStyle*/, 5.0 /*mitreLimit*/ );
1112+
if ( !offsetGeom || !GEOSisValid_r(geosctxt, offsetGeom ) )
11121113
{
11131114
return false;
11141115
}
1115-
if ( !GEOSisValid( offsetGeom ) || GEOSGeomTypeId( offsetGeom ) != GEOS_LINESTRING || GEOSGeomGetNumPoints( offsetGeom ) < 1 )
1116+
if ( !GEOSisValid_r(geosctxt, offsetGeom ) || GEOSGeomTypeId_r(geosctxt, offsetGeom ) != GEOS_LINESTRING || GEOSGeomGetNumPoints_r(geosctxt, offsetGeom ) < 1 )
11161117
{
1117-
GEOSGeom_destroy( offsetGeom );
1118+
GEOSGeom_destroy_r(geosctxt, offsetGeom );
11181119
return false;
11191120
}
11201121
outputGeomList.push_back( offsetGeom );
11211122
#else
1122-
outputGeomList.push_back( GEOSGeom_clone(( *inputGeomIt )->asGeos() ) );
1123+
outputGeomList.push_back( GEOSGeom_clone_r(geosctxt, ( *inputGeomIt )->asGeos() ) );
11231124
#endif
11241125
}
11251126
else if ( geom->type() == QGis::Point )
11261127
{
11271128
QgsPoint p = ( *inputGeomIt )->asPoint();
11281129
p = createPointOffset( p.x(), p.y(), offset, lineGeom );
1129-
GEOSCoordSequence* ptSeq = GEOSCoordSeq_create( 1, 2 );
1130-
GEOSCoordSeq_setX( ptSeq, 0, p.x() );
1131-
GEOSCoordSeq_setY( ptSeq, 0, p.y() );
1132-
GEOSGeometry* geosPt = GEOSGeom_createPoint( ptSeq );
1130+
GEOSCoordSequence* ptSeq = GEOSCoordSeq_create_r(geosctxt, 1, 2 );
1131+
GEOSCoordSeq_setX_r(geosctxt, ptSeq, 0, p.x() );
1132+
GEOSCoordSeq_setY_r(geosctxt, ptSeq, 0, p.y() );
1133+
GEOSGeometry* geosPt = GEOSGeom_createPoint_r(geosctxt, ptSeq );
11331134
outputGeomList.push_back( geosPt );
11341135
}
11351136
}
@@ -1152,11 +1153,11 @@ bool QgsGeometryAnalyzer::createOffsetGeometry( QgsGeometry* geom, QgsGeometry*
11521153
GEOSGeometry* collection = 0;
11531154
if ( geom->type() == QGis::Point )
11541155
{
1155-
collection = GEOSGeom_createCollection( GEOS_MULTIPOINT, geomArray, outputGeomList.size() );
1156+
collection = GEOSGeom_createCollection_r(geosctxt, GEOS_MULTIPOINT, geomArray, outputGeomList.size() );
11561157
}
11571158
else if ( geom->type() == QGis::Line )
11581159
{
1159-
collection = GEOSGeom_createCollection( GEOS_MULTILINESTRING, geomArray, outputGeomList.size() );
1160+
collection = GEOSGeom_createCollection_r(geosctxt, GEOS_MULTILINESTRING, geomArray, outputGeomList.size() );
11601161
}
11611162
geom->fromGeos( collection );
11621163
delete[] geomArray;

src/analysis/vector/qgszonalstatistics.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ void QgsZonalStatistics::statisticsFromMiddlePointTest( void* band, QgsGeometry*
281281
return;
282282
}
283283

284-
const GEOSPreparedGeometry* polyGeosPrepared = GEOSPrepare( poly->asGeos() );
284+
GEOSContextHandle_t geosctxt = QgsGeometry::getGEOSHandler();
285+
const GEOSPreparedGeometry* polyGeosPrepared = GEOSPrepare_r( geosctxt, poly->asGeos() );
285286
if ( !polyGeosPrepared )
286287
{
287288
return;
@@ -300,15 +301,15 @@ void QgsZonalStatistics::statisticsFromMiddlePointTest( void* band, QgsGeometry*
300301
cellCenterX = rasterBBox.xMinimum() + pixelOffsetX * cellSizeX + cellSizeX / 2;
301302
for ( int j = 0; j < nCellsX; ++j )
302303
{
303-
GEOSGeom_destroy( currentCellCenter );
304-
cellCenterCoords = GEOSCoordSeq_create( 1, 2 );
305-
GEOSCoordSeq_setX( cellCenterCoords, 0, cellCenterX );
306-
GEOSCoordSeq_setY( cellCenterCoords, 0, cellCenterY );
307-
currentCellCenter = GEOSGeom_createPoint( cellCenterCoords );
304+
GEOSGeom_destroy_r( geosctxt, currentCellCenter );
305+
cellCenterCoords = GEOSCoordSeq_create_r( geosctxt, 1, 2 );
306+
GEOSCoordSeq_setX_r( geosctxt, cellCenterCoords, 0, cellCenterX );
307+
GEOSCoordSeq_setY_r( geosctxt, cellCenterCoords, 0, cellCenterY );
308+
currentCellCenter = GEOSGeom_createPoint_r( geosctxt, cellCenterCoords );
308309

309310
if ( scanLine[j] != mInputNodataValue ) //don't consider nodata values
310311
{
311-
if ( GEOSPreparedContains( polyGeosPrepared, currentCellCenter ) )
312+
if ( GEOSPreparedContains_r( geosctxt, polyGeosPrepared, currentCellCenter ) )
312313
{
313314
if ( !qIsNaN( scanLine[j] ) )
314315
{
@@ -322,7 +323,7 @@ void QgsZonalStatistics::statisticsFromMiddlePointTest( void* band, QgsGeometry*
322323
cellCenterY -= cellSizeY;
323324
}
324325
CPLFree( scanLine );
325-
GEOSPreparedGeom_destroy( polyGeosPrepared );
326+
GEOSPreparedGeom_destroy_r( geosctxt, polyGeosPrepared );
326327
}
327328

328329
void QgsZonalStatistics::statisticsFromPreciseIntersection( void* band, QgsGeometry* poly, int pixelOffsetX,

src/app/qgsmaptooloffsetcurve.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ void QgsMapToolOffsetCurve::setOffsetForRubberBand( double offset, bool leftSide
367367
int quadSegments = s.value( "/qgis/digitizing/offset_quad_seg", 8 ).toInt();
368368
double mitreLimit = s.value( "/qgis/digitizing/offset_miter_limit", 5.0 ).toDouble();
369369

370-
GEOSGeometry* offsetGeom = GEOSOffsetCurve( geosGeom, leftSide ? offset : -offset, quadSegments, joinStyle, mitreLimit );
370+
GEOSGeometry* offsetGeom = GEOSOffsetCurve_r( QgsGeometry::getGEOSHandler(), geosGeom, leftSide ? offset : -offset, quadSegments, joinStyle, mitreLimit );
371371
if ( !offsetGeom )
372372
{
373373
deleteRubberBandAndGeometry();

src/core/pal/feature.cpp

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#endif
4040

4141
#include <qglobal.h>
42+
#include <qgsgeometry.h>
4243

4344
#include <cmath>
4445
#include <cstring>
@@ -109,7 +110,7 @@ namespace pal
109110

110111
if ( ownsGeom )
111112
{
112-
GEOSGeom_destroy( the_geom );
113+
GEOSGeom_destroy_r( QgsGeometry::getGEOSHandler(), the_geom );
113114
the_geom = NULL;
114115
}
115116
}
@@ -123,36 +124,37 @@ namespace pal
123124
int i, j;
124125

125126
const GEOSCoordSequence *coordSeq;
127+
GEOSContextHandle_t geosctxt = QgsGeometry::getGEOSHandler();
126128

127-
type = GEOSGeomTypeId( geom );
129+
type = GEOSGeomTypeId_r( geosctxt, geom );
128130

129131
if ( type == GEOS_POLYGON )
130132
{
131-
if ( GEOSGetNumInteriorRings( geom ) > 0 )
133+
if ( GEOSGetNumInteriorRings_r( geosctxt, geom ) > 0 )
132134
{
133135
// set nbHoles, holes member variables
134-
nbHoles = GEOSGetNumInteriorRings( geom );
136+
nbHoles = GEOSGetNumInteriorRings_r( geosctxt, geom );
135137
holes = new PointSet*[nbHoles];
136138

137139
for ( i = 0; i < nbHoles; i++ )
138140
{
139141
holes[i] = new PointSet();
140142
holes[i]->holeOf = NULL;
141143

142-
const GEOSGeometry* interior = GEOSGetInteriorRingN( geom, i );
143-
holes[i]->nbPoints = GEOSGetNumCoordinates( interior );
144+
const GEOSGeometry* interior = GEOSGetInteriorRingN_r( geosctxt, geom, i );
145+
holes[i]->nbPoints = GEOSGetNumCoordinates_r( geosctxt, interior );
144146
holes[i]->x = new double[holes[i]->nbPoints];
145147
holes[i]->y = new double[holes[i]->nbPoints];
146148

147149
holes[i]->xmin = holes[i]->ymin = DBL_MAX;
148150
holes[i]->xmax = holes[i]->ymax = -DBL_MAX;
149151

150-
coordSeq = GEOSGeom_getCoordSeq( interior );
152+
coordSeq = GEOSGeom_getCoordSeq_r( geosctxt, interior );
151153

152154
for ( j = 0; j < holes[i]->nbPoints; j++ )
153155
{
154-
GEOSCoordSeq_getX( coordSeq, j, &holes[i]->x[j] );
155-
GEOSCoordSeq_getY( coordSeq, j, &holes[i]->y[j] );
156+
GEOSCoordSeq_getX_r( geosctxt, coordSeq, j, &holes[i]->x[j] );
157+
GEOSCoordSeq_getY_r( geosctxt, coordSeq, j, &holes[i]->y[j] );
156158

157159
holes[i]->xmax = holes[i]->x[j] > holes[i]->xmax ? holes[i]->x[j] : holes[i]->xmax;
158160
holes[i]->xmin = holes[i]->x[j] < holes[i]->xmin ? holes[i]->x[j] : holes[i]->xmin;
@@ -166,7 +168,7 @@ namespace pal
166168
}
167169

168170
// use exterior ring for the extraction of coordinates that follows
169-
geom = GEOSGetExteriorRing( geom );
171+
geom = GEOSGetExteriorRing_r( geosctxt, geom );
170172
}
171173
else
172174
{
@@ -175,8 +177,8 @@ namespace pal
175177
}
176178

177179
// find out number of points
178-
nbPoints = GEOSGetNumCoordinates( geom );
179-
coordSeq = GEOSGeom_getCoordSeq( geom );
180+
nbPoints = GEOSGetNumCoordinates_r( geosctxt, geom );
181+
coordSeq = GEOSGeom_getCoordSeq_r( geosctxt, geom );
180182

181183
// initialize bounding box
182184
xmin = ymin = DBL_MAX;
@@ -188,8 +190,8 @@ namespace pal
188190

189191
for ( i = 0; i < nbPoints; i++ )
190192
{
191-
GEOSCoordSeq_getX( coordSeq, i, &x[i] );
192-
GEOSCoordSeq_getY( coordSeq, i, &y[i] );
193+
GEOSCoordSeq_getX_r( geosctxt, coordSeq, i, &x[i] );
194+
GEOSCoordSeq_getY_r( geosctxt, coordSeq, i, &y[i] );
193195

194196
xmax = x[i] > xmax ? x[i] : xmax;
195197
xmin = x[i] < xmin ? x[i] : xmin;
@@ -1397,13 +1399,14 @@ namespace pal
13971399

13981400
void FeaturePart::addSizePenalty( int nbp, LabelPosition** lPos, double bbx[4], double bby[4] )
13991401
{
1400-
int geomType = GEOSGeomTypeId( the_geom );
1402+
GEOSContextHandle_t ctxt = QgsGeometry::getGEOSHandler();
1403+
int geomType = GEOSGeomTypeId_r( ctxt, the_geom );
14011404

14021405
double sizeCost = 0;
14031406
if ( geomType == GEOS_LINESTRING )
14041407
{
14051408
double length;
1406-
if ( GEOSLength( the_geom, &length ) != 1 )
1409+
if ( GEOSLength_r( ctxt, the_geom, &length ) != 1 )
14071410
return; // failed to calculate length
14081411
double bbox_length = max( bbx[2] - bbx[0], bby[2] - bby[0] );
14091412
if ( length >= bbox_length / 4 )
@@ -1414,7 +1417,7 @@ namespace pal
14141417
else if ( geomType == GEOS_POLYGON )
14151418
{
14161419
double area;
1417-
if ( GEOSArea( the_geom, &area ) != 1 )
1420+
if ( GEOSArea_r( ctxt, the_geom, &area ) != 1 )
14181421
return;
14191422
double bbox_area = ( bbx[2] - bbx[0] ) * ( bby[2] - bby[0] );
14201423
if ( area >= bbox_area / 16 )
@@ -1436,27 +1439,28 @@ namespace pal
14361439

14371440
bool FeaturePart::isConnected( FeaturePart* p2 )
14381441
{
1439-
return ( GEOSTouches( the_geom, p2->the_geom ) == 1 );
1442+
return ( GEOSTouches_r( QgsGeometry::getGEOSHandler(), the_geom, p2->the_geom ) == 1 );
14401443
}
14411444

14421445
bool FeaturePart::mergeWithFeaturePart( FeaturePart* other )
14431446
{
1444-
GEOSGeometry* g1 = GEOSGeom_clone( the_geom );
1445-
GEOSGeometry* g2 = GEOSGeom_clone( other->the_geom );
1447+
GEOSContextHandle_t ctxt = QgsGeometry::getGEOSHandler();
1448+
GEOSGeometry* g1 = GEOSGeom_clone_r( ctxt, the_geom );
1449+
GEOSGeometry* g2 = GEOSGeom_clone_r( ctxt, other->the_geom );
14461450
GEOSGeometry* geoms[2] = { g1, g2 };
1447-
GEOSGeometry* g = GEOSGeom_createCollection( GEOS_MULTILINESTRING, geoms, 2 );
1448-
GEOSGeometry* gTmp = GEOSLineMerge( g );
1449-
GEOSGeom_destroy( g );
1451+
GEOSGeometry* g = GEOSGeom_createCollection_r( ctxt, GEOS_MULTILINESTRING, geoms, 2 );
1452+
GEOSGeometry* gTmp = GEOSLineMerge_r( ctxt, g );
1453+
GEOSGeom_destroy_r( ctxt, g );
14501454

1451-
if ( GEOSGeomTypeId( gTmp ) != GEOS_LINESTRING )
1455+
if ( GEOSGeomTypeId_r( ctxt, gTmp ) != GEOS_LINESTRING )
14521456
{
14531457
// sometimes it's not possible to merge lines (e.g. they don't touch at endpoints)
1454-
GEOSGeom_destroy( gTmp );
1458+
GEOSGeom_destroy_r( ctxt, gTmp );
14551459
return false;
14561460
}
14571461

14581462
if ( ownsGeom ) // delete old geometry if we own it
1459-
GEOSGeom_destroy( the_geom );
1463+
GEOSGeom_destroy_r( ctxt, the_geom );
14601464
// set up new geometry
14611465
the_geom = gTmp;
14621466
ownsGeom = true;

src/core/pal/layer.cpp

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <cmath>
4242
#include <vector>
4343

44+
#include <qgsgeometry.h>
4445

4546
#include <pal/pal.h>
4647
#include <pal/layer.h>
@@ -286,18 +287,20 @@ namespace pal
286287
throw InternalException::UnknownGeometry();
287288
}
288289

290+
GEOSContextHandle_t geosctxt = QgsGeometry::getGEOSHandler();
291+
289292
while ( simpleGeometries->size() > 0 )
290293
{
291294
const GEOSGeometry* geom = simpleGeometries->pop_front();
292295

293296
// ignore invalid geometries (e.g. polygons with self-intersecting rings)
294-
if ( GEOSisValid( geom ) != 1 ) // 0=invalid, 1=valid, 2=exception
297+
if ( GEOSisValid_r( geosctxt, geom ) != 1 ) // 0=invalid, 1=valid, 2=exception
295298
{
296299
std::cerr << "ignoring invalid feature " << geom_id << std::endl;
297300
continue;
298301
}
299302

300-
int type = GEOSGeomTypeId( geom );
303+
int type = GEOSGeomTypeId_r( geosctxt, geom );
301304

302305
if ( type != GEOS_POINT && type != GEOS_LINESTRING && type != GEOS_POLYGON )
303306
{
@@ -325,9 +328,9 @@ namespace pal
325328
if ( mode == LabelPerFeature && ( type == GEOS_POLYGON || type == GEOS_LINESTRING ) )
326329
{
327330
if ( type == GEOS_LINESTRING )
328-
GEOSLength( geom, &geom_size );
331+
GEOSLength_r( geosctxt, geom, &geom_size );
329332
else if ( type == GEOS_POLYGON )
330-
GEOSArea( geom, &geom_size );
333+
GEOSArea_r( geosctxt, geom, &geom_size );
331334

332335
if ( geom_size > biggest_size )
333336
{
@@ -493,30 +496,31 @@ namespace pal
493496

494497
void Layer::chopFeaturesAtRepeatDistance( )
495498
{
499+
GEOSContextHandle_t geosctxt = QgsGeometry::getGEOSHandler();
496500
LinkedList<FeaturePart*> * newFeatureParts = new LinkedList<FeaturePart*>( ptrFeaturePartCompare );
497501
while ( FeaturePart* fpart = featureParts->pop_front() )
498502
{
499503
const GEOSGeometry* geom = fpart->getGeometry();
500504
double chopInterval = fpart->getFeature()->repeatDistance();
501-
if ( chopInterval != 0. && GEOSGeomTypeId( geom ) == GEOS_LINESTRING )
505+
if ( chopInterval != 0. && GEOSGeomTypeId_r( geosctxt, geom ) == GEOS_LINESTRING )
502506
{
503507

504508
double bmin[2], bmax[2];
505509
fpart->getBoundingBox( bmin, bmax );
506510
rtree->Remove( bmin, bmax, fpart );
507511

508-
const GEOSCoordSequence *cs = GEOSGeom_getCoordSeq( geom );
512+
const GEOSCoordSequence *cs = GEOSGeom_getCoordSeq_r( geosctxt, geom );
509513

510514
// get number of points
511515
unsigned int n;
512-
GEOSCoordSeq_getSize( cs, &n );
516+
GEOSCoordSeq_getSize_r( geosctxt, cs, &n );
513517

514518
// Read points
515519
std::vector<Point> points( n );
516520
for ( unsigned int i = 0; i < n; ++i )
517521
{
518-
GEOSCoordSeq_getX( cs, i, &points[i].x );
519-
GEOSCoordSeq_getY( cs, i, &points[i].y );
522+
GEOSCoordSeq_getX_r( geosctxt, cs, i, &points[i].x );
523+
GEOSCoordSeq_getY_r( geosctxt, cs, i, &points[i].y );
520524
}
521525

522526
// Cumulative length vector
@@ -548,14 +552,14 @@ namespace pal
548552
p.x = points[cur - 1].x + c * ( points[cur].x - points[cur - 1].x );
549553
p.y = points[cur - 1].y + c * ( points[cur].y - points[cur - 1].y );
550554
part.push_back( p );
551-
GEOSCoordSequence* cooSeq = GEOSCoordSeq_create( part.size(), 2 );
555+
GEOSCoordSequence* cooSeq = GEOSCoordSeq_create_r( geosctxt, part.size(), 2 );
552556
for ( std::size_t i = 0; i < part.size(); ++i )
553557
{
554-
GEOSCoordSeq_setX( cooSeq, i, part[i].x );
555-
GEOSCoordSeq_setY( cooSeq, i, part[i].y );
558+
GEOSCoordSeq_setX_r( geosctxt, cooSeq, i, part[i].x );
559+
GEOSCoordSeq_setY_r( geosctxt, cooSeq, i, part[i].y );
556560
}
557561

558-
GEOSGeometry* newgeom = GEOSGeom_createLineString( cooSeq );
562+
GEOSGeometry* newgeom = GEOSGeom_createLineString_r( geosctxt, cooSeq );
559563
FeaturePart* newfpart = new FeaturePart( fpart->getFeature(), newgeom );
560564
newFeatureParts->push_back( newfpart );
561565
newfpart->getBoundingBox( bmin, bmax );
@@ -565,14 +569,14 @@ namespace pal
565569
}
566570
// Create final part
567571
part.push_back( points[n - 1] );
568-
GEOSCoordSequence* cooSeq = GEOSCoordSeq_create( part.size(), 2 );
572+
GEOSCoordSequence* cooSeq = GEOSCoordSeq_create_r( geosctxt, part.size(), 2 );
569573
for ( std::size_t i = 0; i < part.size(); ++i )
570574
{
571-
GEOSCoordSeq_setX( cooSeq, i, part[i].x );
572-
GEOSCoordSeq_setY( cooSeq, i, part[i].y );
575+
GEOSCoordSeq_setX_r( geosctxt, cooSeq, i, part[i].x );
576+
GEOSCoordSeq_setY_r( geosctxt, cooSeq, i, part[i].y );
573577
}
574578

575-
GEOSGeometry* newgeom = GEOSGeom_createLineString( cooSeq );
579+
GEOSGeometry* newgeom = GEOSGeom_createLineString_r( geosctxt, cooSeq );
576580
FeaturePart* newfpart = new FeaturePart( fpart->getFeature(), newgeom );
577581
newFeatureParts->push_back( newfpart );
578582
newfpart->getBoundingBox( bmin, bmax );

0 commit comments

Comments
 (0)