Python/XML styling property inconsistencies #1427

Closed
springmeyer opened this Issue Aug 21, 2012 · 4 comments

Comments

Projects
None yet
2 participants
Owner

springmeyer commented Aug 21, 2012

We need to clean up inconsistencies between XML and Python. Since 2.1 strives to be a backward compatible release, we can start softening any future changes by exposing in Python the XML styling syntax to prepare for likely renaming in Python (or more rarely in XML) at 3.x.

Map

  • background/background-color (fixed in 3e4d579 - in 2.1)

Layer

  • status/active (fixed in 8c8cf71 - in 2.1)

Stroke

  • line_join/linejoin (xml matches svg spec) (fixed in ab5ce64 - in 2.1)
  • line_cap/linecap (xml matches svg spec) (fixed in ab5ce64 - in 2.1)
  • dash_offset/dashoffset (xml matches svg spec) (fixed in ab5ce64- in 2.1)
  • {not in python, instead add_dash/get_dashs}/dasharray (fixed in ab5ce64 - in 2.1)

All Symbolizers using images/svg

  • filename/file

MarkersSymbolizer

  • marker-type: unclear future in XML, but still in 2.1 and not officially deprecated so we should add back to python to keep back-compatibility (fixed up in e8101a0 - in 2.1)

TextSymbolizer

NOTE: also need to review Shield Symbolizer

@springmeyer springmeyer pushed a commit that referenced this issue Aug 21, 2012

Dane Springmeyer python: add wrap_character alias to wrap_char - refs #1427 6a0df52

@springmeyer springmeyer pushed a commit that referenced this issue Aug 21, 2012

Dane Springmeyer xml: support 'label-spacing' as alias to 'spacing' - refs #1427 d1d7822
Owner

springmeyer commented Aug 21, 2012

Some fixes pushed into master before 2.1 tag, but I will study and attempt to fix more afterword - likely in 2.1.1 or later.

@springmeyer springmeyer pushed a commit that referenced this issue Aug 21, 2012

Dane Springmeyer partially repair backward compatibility in python for 'marker-type' -…
… refs #1427 and #1285
e8101a0
Owner

springmeyer commented Aug 22, 2012

using this test script (https://gist.github.com/3410845) with Mapnik at bf559f9:

I now get only failures for text/shield symbolizers:

Text -->

'size' not a valid property of Text
'opacity' not a valid property of Text
'spacing' not a valid property of Text
'dx' not a valid property of Text
'dy' not a valid property of Text
'max_char_angle_delta' not a valid property of Text
'placement' not a valid property of Text
'name' not a valid property of Text
'placement_type' not a valid property of Text
(allow_overlap|avoid_edges|character_spacing|clip|comp_op|displacement|face_name|fill|fontset|force_odd_labels|format|halo_fill|halo_radius|horizontal_alignment|justify_alignment|label_placement|label_position_tolerance|label_spacing|line_spacing|maximum_angle_char_delta|minimum_distance|minimum_padding|minimum_path_length|orientation|placements|properties|symbol|text_opacity|text_ratio|text_size|text_transform|vertical_alignment|wrap_before|wrap_char|wrap_character|wrap_width)


Shield -->

'size' not a valid property of Shield
'shield_dy' not a valid property of Shield
'shield_dx' not a valid property of Shield
'spacing' not a valid property of Shield
'dx' not a valid property of Shield
'dy' not a valid property of Shield
'placement' not a valid property of Shield
(allow_overlap|avoid_edges|character_spacing|clip|comp_op|displacement|face_name|filename|fill|fontset|force_odd_labels|format|halo_fill|halo_radius|horizontal_alignment|justify_alignment|label_placement|label_position_tolerance|label_spacing|line_spacing|max_char_angle_delta|maximum_angle_char_delta|minimum_distance|minimum_padding|minimum_path_length|name|opacity|orientation|placements|properties|shield_displacement|symbol|text_opacity|text_ratio|text_size|text_transform|transform|unlock_image|vertical_alignment|wrap_before|wrap_char|wrap_character|wrap_width)

TOTAL FAILS: 16
Contributor

nvkelso commented Sep 13, 2012

Thank you for thinking about this future and backward proofing.

I think I've run into the max-angle-delta bug before, but I was like huh, probably user error ;)

@springmeyer springmeyer modified the milestone: Mapnik 2.1.1, Mapnik 3.x Aug 4, 2014

Owner

springmeyer commented Aug 19, 2014

nothing more actionable here, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment