User:Kodapan/Mapnik map XML editor

From OpenStreetMap Wiki
Jump to navigation Jump to search

This is old stuff, it's silly and has no use. Kept only for historic reasons.


This is my attempt an a map style editor for the Mapnik map xml.

What it does

  • First loads a template osm.xml XML to a DOM bound to java beans mainly using XPath.
  • Then it normalize all use of colors in XML to hex RGB.
  • Then it extracts facet values from the XML.
  • User find matching symbolizers by selecting facet values.
  • Matching symbolizers are drawn in a new map to really show what they are.

Currently there is no edit function at user level! Programmatically it's something I already do, eg when rendering the map with matching symbolizers.

Code

It's implemented in Java using Vaadin.

https://github.com/karlwettin/osm-xml-editor

Screenshots

1

https://github.com/karlwettin/osm-xml-editor/raw/master/documentation/screenshots/1-open%20screen.png

Initial screen. In behalf of rendering a map with matching symbolizers all matching symbolizers is the same as no matching symbolizers

2

https://github.com/karlwettin/osm-xml-editor/raw/master/documentation/screenshots/2-selected%20highway.png

Clicked on filter key facet value for [highway]

Matching symbolizers map rendered. An obvious bug is that water, text and a bit of other stuff still is rendered even though they are not selected. Why no streets are rendered at this point, that I do not know yet. They are supposed to.

3

https://github.com/karlwettin/osm-xml-editor/raw/master/documentation/screenshots/3-select%20not%20tunnel.png

Clicked on filter key value pair facet value for [tunnel] = 'true'

Now highways are displayed in rendered map for some reason.

Notice in filters that it is "and not [tunnel] = 'true'", so the facet values should at least also include prefixed logic to make more sense.


Ideas

Ideas for future when bugs are fixed include

  • To be able to click on a pixel in the map to order colors by distance from selected color. (Perhaps gamma made it change in map compared to definition.)
  • Text style facets
  • Shield facets and perhaps even a small icon editor or something

Your comments and ideas

Please leave them here!