Skip to content

Commit e5eb628

Browse files
committed
Fix for the OGR autostyle unit calculation (#5028)
1 parent 5b2c46a commit e5eb628

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mapogr.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,8 @@ static char **msOGRGetValues(layerObj *layer, OGRFeatureH hFeature)
590590
}
591591
/* Setting up the size units according to msOGRLayerGetAutoStyle*/
592592
if (hStylePart && layer->map)
593-
OGR_ST_SetUnit(hStylePart, OGRSTUPixel, layer->map->cellsize*72.0*39.37);
593+
OGR_ST_SetUnit(hStylePart, OGRSTUPixel,
594+
layer->map->cellsize*layer->map->resolution/layer->map->defresolution*72.0*39.37);
594595
}
595596
}
596597
int bDefault;
@@ -2997,7 +2998,8 @@ static int msOGRUpdateStyle(OGRStyleMgrH hStyleMgr, mapObj *map, layerObj *layer
29972998
// as long as use the same assumptions everywhere)
29982999
// That gives scale = cellsize*72*39.37
29993000

3000-
OGR_ST_SetUnit(hStylePart, OGRSTUPixel, map->cellsize*72.0*39.37);
3001+
OGR_ST_SetUnit(hStylePart, OGRSTUPixel,
3002+
map->cellsize*map->resolution/map->defresolution*72.0*39.37);
30013003

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

0 commit comments

Comments
 (0)