@@ -105,52 +105,54 @@ check-javascript:
105105# ROUTE MUNGING
106106# ##########################################################################
107107
108- # normalize individual GPX files
108+ # normalize individual raw GPX route files
109109routes/gpx/% .gpx : _bin/normalize_gpx.py routes/_gpx/% .gpx
110- @mkdir -p $( @D )
110+ @mkdir -p routes/gpx
111111 uv run python3 $< \
112112 --input routes/_gpx/$* .gpx \
113113 --output routes/gpx/$* .gpx
114114
115- # convert individual GPX files to GeoJSON
115+ # batch normalize all raw GPX route files (used in Github Actions)
116+ .PHONY : normalize-routes
117+ normalize-routes : _bin/normalize_gpx.py
118+ @mkdir -p routes/gpx
119+ uv run python3 $< \
120+ --input $(foreach raw, $(ROUTES_RAW_GPX ) , $(raw ) ) \
121+ --output $(foreach raw, $(ROUTES_RAW_GPX ) , $(patsubst routes/_gpx/% , routes/gpx/% , $(raw ) ) )
122+
123+ # convert individual raw GPX route files to GeoJSON
116124routes/geojson/% .geojson : _bin/gpx_to_geojson.py routes/_gpx/% .gpx
117- @mkdir -p $( @D )
125+ @mkdir -p routes/geojson
118126 uv run python3 $< \
119- --input routes/_gpx/$* .gpx \
120- --output $@
127+ --input routes/_gpx/$* .gpx \
128+ --output routes/geojson/ $* .geojson
121129
122- # batch convert all raw GPX routes to GeoJSON (used in Github Actions)
130+ # batch convert all raw GPX route files to GeoJSON (used in Github Actions)
123131.PHONY : convert-routes
124- convert-routes :
132+ convert-routes : _bin/gpx_to_geojson.py
125133 @mkdir -p routes/geojson
126- uv run python3 _bin/gpx_to_geojson.py \
127- --input $(foreach raw, $(ROUTES_RAW_GPX ) ,$(raw ) ) \
128- --output $(foreach raw, $(ROUTES_RAW_GPX ) ,$(patsubst % .gpx, routes/geojson/% .geojson, $(notdir $(raw ) ) ) )
129-
130- # batch normalize all raw GPX routes (used in Github Actions)
131- .PHONY : normalize-routes
132- normalize-routes :
133- @mkdir -p routes/gpx
134- uv run python3 _bin/normalize_gpx.py \
135- --input $(foreach raw, $(ROUTES_RAW_GPX ) ,$(raw ) ) \
136- --output $(foreach raw, $(ROUTES_RAW_GPX ) ,$(patsubst routes/_gpx/% , routes/gpx/% ,$(raw ) ) )
134+ uv run python3 $< \
135+ --input $(foreach raw, $(ROUTES_RAW_GPX ) , $(raw ) ) \
136+ --output $(foreach raw, $(ROUTES_RAW_GPX ) , $(patsubst % .gpx, routes/geojson/% .geojson, $(notdir $(raw ) ) ) )
137137
138138# All routes in one file
139139$(ALL_ROUTES_GEOJSON ) : _bin/merge_geojson.py $(ROUTES_GEOJSON )
140- uv run python3 $< $(ROUTES_GEOJSON ) $@
140+ @mkdir -p routes/geojson
141+ uv run python3 $< \
142+ $(ROUTES_GEOJSON ) \
143+ $@
141144
142145# Use this to standardize format when adding a new route or updating an existing one
143- normalize-routes-in-place :
144- @mkdir -p routes/gpx
145- uv run python3 _bin/normalize_gpx.py \
146- --input $(foreach raw, $(ROUTES_RAW_GPX ) ,$(raw ) ) \
147- --output $(foreach raw, $(ROUTES_RAW_GPX ) ,$(raw ) )
146+ normalize-routes-in-place : _bin/normalize_gpx.py
147+ uv run python3 $< \
148+ --input $(foreach raw, $(ROUTES_RAW_GPX ) , $(raw ) ) \
149+ --output $(foreach raw, $(ROUTES_RAW_GPX ) , $(raw ) )
148150
149151# Use this when adding a new GPX that doesn't have elevation data
150- replace-route-elevations :
151- uv run python3 _bin/replace_route_elevations.py \
152- --input $(foreach raw, $(ROUTES_RAW_GPX ) ,$(raw ) ) \
153- --output $(foreach raw, $(ROUTES_RAW_GPX ) ,$(raw ) )
152+ replace-route-elevations : _bin/replace_route_elevations.py
153+ uv run python3 $< \
154+ --input $(foreach raw, $(ROUTES_RAW_GPX ) , $(raw ) ) \
155+ --output $(foreach raw, $(ROUTES_RAW_GPX ) , $(raw ) )
154156
155157
156158# ##########################################################################
0 commit comments