Skip to content

Commit

Permalink
Merge pull request #5031 from szekerest/issue5028
Browse files Browse the repository at this point in the history
Fix for the OGR autostyle unit calculation (#5028)
  • Loading branch information
szekerest committed Nov 6, 2014
2 parents 5b2c46a + e5eb628 commit f5f9670
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mapogr.cpp
Expand Up @@ -590,7 +590,8 @@ static char **msOGRGetValues(layerObj *layer, OGRFeatureH hFeature)
}
/* Setting up the size units according to msOGRLayerGetAutoStyle*/
if (hStylePart && layer->map)
OGR_ST_SetUnit(hStylePart, OGRSTUPixel, layer->map->cellsize*72.0*39.37);
OGR_ST_SetUnit(hStylePart, OGRSTUPixel,
layer->map->cellsize*layer->map->resolution/layer->map->defresolution*72.0*39.37);
}
}
int bDefault;
Expand Down Expand Up @@ -2997,7 +2998,8 @@ static int msOGRUpdateStyle(OGRStyleMgrH hStyleMgr, mapObj *map, layerObj *layer
// as long as use the same assumptions everywhere)
// That gives scale = cellsize*72*39.37

OGR_ST_SetUnit(hStylePart, OGRSTUPixel, map->cellsize*72.0*39.37);
OGR_ST_SetUnit(hStylePart, OGRSTUPixel,
map->cellsize*map->resolution/map->defresolution*72.0*39.37);

if (eStylePartType == OGRSTCLabel) {
int ret = msOGRUpdateStyleParseLabel(map, layer, c, hStylePart);
Expand Down

0 comments on commit f5f9670

Please sign in to comment.