diff --git a/process_subways.py b/process_subways.py index 4066933..c41b6c0 100755 --- a/process_subways.py +++ b/process_subways.py @@ -82,9 +82,9 @@ if __name__ == '__main__': parser.add_argument('-o', '--output', type=argparse.FileType('w', encoding='utf-8'), help='Processed metro systems output') parser.add_argument('--cache', help='Cache file name for processed data') - parser.add_argument('--recovery-path', help='Cache file name for error recovery') + parser.add_argument('-r', '--recovery-path', help='Cache file name for error recovery') parser.add_argument('-d', '--dump', help='Make a YAML file for a city data') - parser.add_argument('-j', '--json', help='Make a GeoJSON file for a city data') + parser.add_argument('-j', '--geojson', help='Make a GeoJSON file for a city data') parser.add_argument('--crude', action='store_true', help='Do not use OSM railway geometry for GeoJSON') options = parser.parse_args() @@ -180,17 +180,17 @@ if __name__ == '__main__': else: logging.error('Cannot dump %s cities at once', len(cities)) - if options.json: - if os.path.isdir(options.json): + if options.geojson: + if os.path.isdir(options.geojson): for c in cities: - with open(os.path.join(options.dump, slugify(c.name) + '.geojson'), + with open(os.path.join(options.geojson, slugify(c.name) + '.geojson'), 'w', encoding='utf-8') as f: json.dump(make_geojson(c, not options.crude), f) elif len(cities) == 1: - with open(options.json, 'w', encoding='utf-8') as f: + with open(options.geojson, 'w', encoding='utf-8') as f: json.dump(make_geojson(cities[0], not options.crude), f) else: - logging.error('Cannot make a json of %s cities at once', len(cities)) + logging.error('Cannot make a geojson of %s cities at once', len(cities)) if options.log: res = [] diff --git a/scripts/process_subways.sh b/scripts/process_subways.sh index 63530a4..3700d93 100755 --- a/scripts/process_subways.sh +++ b/scripts/process_subways.sh @@ -72,8 +72,9 @@ QNODES="railway=station station=subway =light_rail =monorail railway=subway_entr VALIDATION="$TMPDIR/validation.json" "$PYTHON" "$SUBWAYS_PATH/process_subways.py" -q -x "$FILTERED_DATA" -l "$VALIDATION" ${MAPSME+-o "$MAPSME"}\ - ${CITY+-c "$CITY"} ${DUMP+-d "$DUMP"} ${JSON+-j "$JSON"}\ - ${ELEMENTS_CACHE+-i "$ELEMENTS_CACHE"} ${CITY_CACHE+--cache "$CITY_CACHE"} + ${CITY+-c "$CITY"} ${DUMP+-d "$DUMP"} ${GEOJSON+-j "$GEOJSON"}\ + ${ELEMENTS_CACHE+-i "$ELEMENTS_CACHE"} ${CITY_CACHE+--cache "$CITY_CACHE"}\ + ${RECOVERY_PATH+-r "$RECOVERY_PATH"} rm "$FILTERED_DATA" # Preparing HTML files