Skip to content

Commit b22b085

Browse files
committed
PROJ6: more context sharing
1 parent 6327340 commit b22b085

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

mapkmlrenderer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,11 +549,12 @@ int KmlRenderer::checkProjection(mapObj *map)
549549
}
550550
strcpy(epsg_string, "epsg:4326" );
551551
msInitProjection(&out);
552+
msProjectionInheritContextFrom(&out, projection);
552553
msLoadProjectionString(&out, epsg_string);
553554

554555
sRect = map->extent;
555556
msProjectRect(projection, &out, &sRect);
556-
msFreeProjection(projection);
557+
msFreeProjectionExceptContext(projection);
557558
msLoadProjectionString(projection, epsg_string);
558559

559560
/*change also units and extents*/

mapogr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ static int msOGRSpatialRef2ProjectionObj(OGRSpatialReferenceH hSRS,
966966
{
967967
#ifdef USE_PROJ
968968
// First flush the "auto" name from the projargs[]...
969-
msFreeProjection( proj );
969+
msFreeProjectionExceptContext( proj );
970970

971971
if (hSRS == NULL || OSRIsLocal( hSRS ) ) {
972972
// Dataset had no set projection or is NonEarth (LOCAL_CS)...
@@ -1288,6 +1288,7 @@ msOGRFileOpen(layerObj *layer, const char *connection )
12881288

12891289
psInfo->nTileId = 0;
12901290
msInitProjection(&(psInfo->sTileProj));
1291+
msProjectionInheritContextFrom(&(psInfo->sTileProj),&(layer->projection));
12911292
psInfo->poCurTile = NULL;
12921293
psInfo->rect_is_defined = false;
12931294
psInfo->rect.minx = psInfo->rect.maxx = 0;

0 commit comments

Comments
 (0)