Ignore:
Timestamp:
2008-02-14T07:06:04+01:00 (16 years ago)
Author:
jrreid
Message:

Update lakewalker plugin to automatically break ways up into sections of length as specified in preferences

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/lakewalker/Lakewalker/lakewalker.py

    r6789 r6874  
    8585def download_landsat(c1, c2, width, height, fname):
    8686    layer = "global_mosaic_base"
     87    #style = "IR1"
    8788    style = options.wmslayer
    8889
     
    356357    # n lat lon - A node
    357358    # x - End of data
     359    countnodes = 0
     360   
    358361    print "s %s" % len(lakelist)
    359362    for nodelist in lakelist:
     
    361364        for node in nodelist:
    362365            print "n %.7f %.7f" % (node[0], node[1])
     366           
     367            countnodes = countnodes + 1
     368            if options.MAXLEN == countnodes:
     369              print "x"
     370              print "t %s" % len(nodelist)
     371              print "n %.7f %.7f" % (node[0], node[1])
     372              countnodes = 0
     373             
    363374    print "x"
    364375
     
    432443    parser.add_option("--threshold", "-t", type="int", default="35", metavar="VALUE", help="Maximum gray value to accept as water (based on Landsat IR-1 data). Can be in the range 0-255. Defaults to 35.")
    433444    parser.add_option("--maxnodes", type="int", default="50000", metavar="N", help="Maximum number of nodes to generate before bailing out. Defaults to 50000.")
    434     parser.add_option("--waylength", type="int", default=250, metavar="MAXLEN", help="Maximum nuber of nodes allowed in one way. Defaults to 250.")
     445    parser.add_option("--waylength", type="int", dest="MAXLEN", default=500, metavar="MAXLEN", help="Maximum nuber of nodes allowed in one way. Defaults to 250.")
    435446    parser.add_option("--landsat-res", type="int", default=4000, dest="resolution", metavar="RES", help="Resolution of Landsat tiles, measured in pixels per degree. Defaults to 4000.")
    436447    parser.add_option("--tilesize", type="int", default=2000, help="Size of one landsat tile, measured in pixels. Defaults to 2000.")
Note: See TracChangeset for help on using the changeset viewer.