geofabrik / toner

fork of Stamen Toner style to be used with Osm2pgsql
ISC License
3 stars 1 forks source link

Case change in Natural Earth admin borders shape files? #6

Open hholzgra opened 2 years ago

hholzgra commented 2 years ago

Not sure whether this is a problem with attribute name changes in the NE shapefiles themselves, or an issue with mapnik or one of the underlying libraries, but I was recently getting:

Shape Plugin: no attribute 'adm0_a3' in '/home/maposmatic/styles/toner/data/ne_10m_admin_1_states_provinces_lines/ne_10m_admin_1_states_provinces_lines'. Valid attributes are: FEATURECLA,NAME,ADM0_A3,ADM0_NAME,SHAPE_LENG,MAPCOLOR13,MAPCOLOR9,SOV_A3,NAME_L,NAME_R,NAME_ALT_L,NAME_ALT_R,NAME_LOC_L,NAME_LOC_R,NAME_LEN_L,NAME_LEN_R,NOTE,TYPE,MIN_ZOOM,MIN_LABEL,SCALERANK,FCLASS_ISO,FCLASS_US,FCLASS_FR,FCLASS_RU,FCLASS_ES,FCLASS_CN,FCLASS_TW,FCLASS_IN,FCLASS_NP,FCLASS_PK,FCLASS_DE,FCLASS_GB,FCLASS_BR,FCLASS_IL,FCLASS_PS,FCLASS_SA,FCLASS_EG,FCLASS_MA,FCLASS_PT,FCLASS_AR,FCLASS_JP,FCLASS_KO,FCLASS_VN,FCLASS_TR,FCLASS_ID,FCLASS_PL,FCLASS_GR,FCLASS_IT,FCLASS_NL,FCLASS_SE,FCLASS_BD,FCLASS_UA,ne_id,BRK_A3.

After changing adm0_a3, featurecla and scalerank to uppercase ADM0_A3, FEATURECLA and SCALERANK in the style file filter rules rendering succeeded.

It may never have worked for me previously but gone unnoticed as zoom levels at which this shapefile is even used were not even rendered when I only supported max. map sizes of about 20x20km, but now with experimental support for much larger map areas this now happens with large scale maps.

hholzgra commented 7 months ago

Looks as if the problem is actually with Natural Earth changing attribute names between upper and lower case, apparently at random. Right now ne_10m_roads flipped back to lower case "scalerank", while for the rest upper case "SCALERANK" is still needed ...