Changeset 1551 in josm


Ignore:
Timestamp:
2009-04-22T07:20:00+02:00 (16 years ago)
Author:
ulfl
Message:

if mappaint "real width" is used, have a look at "width" / "est_width" tags and use them

fixes #2366

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java

    r1523 r1551  
    267267            int tmpWidth = (int) (100 /  (float) (circum / realWidth));
    268268            if (tmpWidth > width) width = tmpWidth;
     269           
     270            /* if we have a "width" tag, try use it */
     271            /* (this might be slow and could be improved by caching the value in the Way, on the other hand only used if "real width" is enabled) */
     272            String widthTag = w.get("width");
     273            if(widthTag == null) {
     274                widthTag = w.get("est_width");
     275            }
     276            if(widthTag != null) {
     277                try {
     278                    width = Integer.parseInt(widthTag);
     279                }
     280                catch(NumberFormatException nfe) {
     281                }
     282            }
    269283        }
    270284
Note: See TracChangeset for help on using the changeset viewer.