|
26 | 26 | # from find_areas import find_areas
|
27 | 27 | from desCartes import desCartes
|
28 | 28 | from coloured_roads import coloured_roads
|
| 29 | +from realign_1950s_to_1890s import realign_1950s_to_1890s |
29 | 30 | import json
|
30 | 31 |
|
31 | 32 | #####################
|
|
35 | 36 | # A simple way to get the extent coordinates is to open a Google map in a browser,
|
36 | 37 | # then right-click on the south-west corner of the area of interest. Then click on
|
37 | 38 | # the displayed coordinates and then paste them below. Repeat for the north-east corner.
|
38 |
| -EXTENT_SOUTHWEST_LAT, EXTENT_SOUTHWEST_LNG = 52.567900, -1.990716 |
39 |
| -EXTENT_NORTHEAST_LAT, EXTENT_NORTHEAST_LNG = 52.588912, -1.957963 |
40 | 39 |
|
41 |
| -EXTENT_SOUTHWEST_LNG, EXTENT_SOUTHWEST_LAT, EXTENT_NORTHEAST_LNG, EXTENT_NORTHEAST_LAT = -1.935997009277344,52.56137658013496,-1.898918151855469,52.58339467314521 |
| 40 | +EXTENT_SOUTHWEST_LAT, EXTENT_SOUTHWEST_LNG = 51.50349919463678, -2.3478318403222653 |
| 41 | +EXTENT_NORTHEAST_LAT, EXTENT_NORTHEAST_LNG = 51.511351738991365, -2.332338484447449 |
| 42 | +LOCATION_NAME = 'tormarton' |
| 43 | + |
| 44 | +# EXTENT_SOUTHWEST_LAT, EXTENT_SOUTHWEST_LNG = 52.567939367463715, -1.992658440245488 |
| 45 | +# EXTENT_NORTHEAST_LAT, EXTENT_NORTHEAST_LNG = 52.591446281961645, -1.9622368833162331 |
| 46 | +# LOCATION_NAME = 'walsall' |
| 47 | + |
| 48 | +# EXTENT_SOUTHWEST_LNG, EXTENT_SOUTHWEST_LAT, EXTENT_NORTHEAST_LNG, EXTENT_NORTHEAST_LAT = -1.935997009277344,52.56137658013496,-1.898918151855469,52.58339467314521 |
| 49 | +# LOCATION_NAME = 'great_barr' |
42 | 50 |
|
43 | 51 | ## The location name will be used to name the directory where files are stored.
|
44 | 52 | ## If a geotiff already exist in this directory, it will be re-used, and the coordinates given above ignored.
|
45 |
| -LOCATION_NAME = 'test3' |
| 53 | +# LOCATION_NAME = 'test5' |
46 | 54 | # LOCATION_NAME = 'test2'
|
47 |
| -# LOCATION_NAME = 'tormarton' |
48 |
| -# LOCATION_NAME = 'walsall' |
49 | 55 | # LOCATION_NAME = 'sutton_coldfield'
|
50 | 56 |
|
51 | 57 | ## Uncomment one of these methods, or create your own in the IMAGE PROCESSING CALLS section.
|
52 | 58 | ## Any name you type here will be used in creating a filename, so avoid funky characters.
|
53 | 59 | # METHOD = 'road_contours'
|
54 | 60 | # METHOD = 'progressive'
|
55 | 61 | # METHOD = 'development'
|
56 |
| -METHOD = 'colour' |
| 62 | +# METHOD = 'colour' |
| 63 | +METHOD = '1950s_to_1890s' |
57 | 64 |
|
58 |
| -# RASTER_TILE_KEY = 'ySlCyGP2kmmfm9Dgtiqj' # TO USE THE URL GIVEN BELOW, GET YOUR OWN KEY FROM https://cloud.maptiler.com/account/keys/ |
59 |
| -# RASTER_TILE_URL = 'https://api.maptiler.com/tiles/uk-osgb10k1888/{z}/{x}/{y}.jpg?key=' + RASTER_TILE_KEY |
60 |
| -RASTER_TILE_URL = 'https://api.maptiler.com/tiles/uk-osgb63k1955/{z}/{x}/{y}.jpg?key=ySlCyGP2kmmfm9Dgtiqj' |
61 |
| -# RASTER_TILE_ZOOM = 17 |
62 | 65 | # RASTER_TILE_URL = 'https://overlays.humap.site/layersoflondon/os_drawings/{z}/{x}/{y}.png'
|
63 |
| -RASTER_TILE_ZOOM = 15 |
| 66 | +# RASTER_TILE_ZOOM = 15 |
| 67 | + |
| 68 | +RASTER_TILE_KEY = 'ySlCyGP2kmmfm9Dgtiqj' # TO USE THE URL GIVEN BELOW, GET YOUR OWN KEY FROM https://cloud.maptiler.com/account/keys/ |
| 69 | +RASTER_TILE_URL = 'https://api.maptiler.com/tiles/uk-osgb10k1888/{z}/{x}/{y}.jpg?key=' + RASTER_TILE_KEY |
| 70 | +RASTER_TILE_ZOOM = 17 |
| 71 | + |
| 72 | +# RASTER_TILE_URL = 'https://api.maptiler.com/tiles/uk-osgb63k1955/{z}/{x}/{y}.jpg?key=ySlCyGP2kmmfm9Dgtiqj' |
| 73 | +# RASTER_TILE_ZOOM = 15 |
64 | 74 |
|
65 | 75 | ## The ROADFILE must contain LineStrings only, reprojected if necessary to EPSG:4326 (WGS84)
|
66 | 76 | ## It should be placed in the DATADIR defined below.
|
|
371 | 381 | # result_binary, _ = erase_areas(result_binary, raster_image_gray, 2000, closed = True, SHOW_IMAGES = SHOW_IMAGES, OUTPUTDIR = OUTPUTDIR) # Erase white shapes
|
372 | 382 | # result_binary, _ = erase_areas(result_binary, raster_image_gray, 3, contours = False, SHOW_IMAGES = SHOW_IMAGES, OUTPUTDIR = OUTPUTDIR) # Erase white noise
|
373 | 383 |
|
| 384 | + case '1950s_to_1890s': |
| 385 | + realign_1950s_to_1890s( |
| 386 | + map_directory = f"./output/{LOCATION_NAME}/", |
| 387 | + extent = { |
| 388 | + "sw_lng": EXTENT_SOUTHWEST_LNG, |
| 389 | + "sw_lat": EXTENT_SOUTHWEST_LAT, |
| 390 | + "ne_lng": EXTENT_NORTHEAST_LNG, |
| 391 | + "ne_lat": EXTENT_NORTHEAST_LAT |
| 392 | + } |
| 393 | + ) |
| 394 | + |
| 395 | + |
374 | 396 | case _: # Default
|
375 | 397 | contours, skeleton, result_images, message = desCartes(OUTPUTDIR, template_dir = './../data/templates', show_images = True, shape_filter = False, MAX_ROAD_WIDTH = 40)
|
376 | 398 |
|
|
0 commit comments