Skip to content

Commit

Permalink
PROJ6: more context sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Oct 1, 2019
1 parent 6327340 commit b22b085
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mapkmlrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,11 +549,12 @@ int KmlRenderer::checkProjection(mapObj *map)
}
strcpy(epsg_string, "epsg:4326" );
msInitProjection(&out);
msProjectionInheritContextFrom(&out, projection);
msLoadProjectionString(&out, epsg_string);

sRect = map->extent;
msProjectRect(projection, &out, &sRect);
msFreeProjection(projection);
msFreeProjectionExceptContext(projection);
msLoadProjectionString(projection, epsg_string);

/*change also units and extents*/
Expand Down
3 changes: 2 additions & 1 deletion mapogr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ static int msOGRSpatialRef2ProjectionObj(OGRSpatialReferenceH hSRS,
{
#ifdef USE_PROJ
// First flush the "auto" name from the projargs[]...
msFreeProjection( proj );
msFreeProjectionExceptContext( proj );

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

psInfo->nTileId = 0;
msInitProjection(&(psInfo->sTileProj));
msProjectionInheritContextFrom(&(psInfo->sTileProj),&(layer->projection));
psInfo->poCurTile = NULL;
psInfo->rect_is_defined = false;
psInfo->rect.minx = psInfo->rect.maxx = 0;
Expand Down

0 comments on commit b22b085

Please sign in to comment.