Changeset 7554 in josm


Ignore:
Timestamp:
2014-09-17T23:02:27+02:00 (5 years ago)
Author:
bastiK
Message:

see #10512 - one more option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/taginfoextract.groovy

    r7553 r7554  
    99
    1010import java.io.BufferedReader
    11 //import java.util.ArrayList
    1211import java.awt.image.BufferedImage
    1312import javax.imageio.ImageIO
     
    109108            renderer.getSettings(false)
    110109            elem_style.paintPrimitive(osm, MapPaintSettings.INSTANCE, renderer, false, false)
    111             def image_url = "${image_dir}/${type}_${tag[0]}=${tag[1]}.png"
    112             ImageIO.write(img, "png", new File(image_url))
    113             return image_url
     110            def base_url = options.imgurlprefix ? options.imgurlprefix : image_dir
     111            def image_name = "${type}_${tag[0]}=${tag[1]}.png"
     112            ImageIO.write(img, "png", new File("${image_dir}/${image_name}"))
     113            return "${base_url}/${image_name}"
    114114        }
    115115
     
    209209        cli._(longOpt:'imgdir', args:1, argName:"directory", "directory to put the generated images in (default: ./taginfo-img)")
    210210        cli._(longOpt:'svnweb', 'fetch revision of the repository http://svn.openstreetmap.org/ from web and not from the local repository')
     211        cli._(longOpt:'imgurlprefix', args:1, argName:'prefix', 'image URLs prefix for generated image files')
    211212        cli.h(longOpt:'help', "show this help")
    212213        options = cli.parse(args)
Note: See TracChangeset for help on using the changeset viewer.