Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tile cache filename #36

Merged
merged 3 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Middleware.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const CORS_HEADERS = [
# https://juliaweb.github.io/HTTP.jl/stable/examples/#Cors-Server
function CorsMiddleware(handler)
return function (req::HTTP.Request)
@debug "CORS middleware"
# determine if this is a pre-flight request from the browser
if HTTP.method(req) == "OPTIONS"
return HTTP.Response(200, CORS_HEADERS)
Expand Down
2 changes: 1 addition & 1 deletion src/criteria_assessment/tiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function setup_tile_routes(config, auth)
# http://127.0.0.1:8000/tile/8/231/139?region=Cairns-Cooktown&rtype=slopes&Depth=-9.0:0.0&Slope=0.0:40.0&Rugosity=0.0:3.0

qp = queryparams(req)
mask_path = cache_filename(qp, config, "", "png")
mask_path = cache_filename(qp, config, "tile-zxy_$(z)_$(x)_$(y)", "png")
if isfile(mask_path)
return file(mask_path; headers=TILE_HEADERS)
end
Expand Down
8 changes: 6 additions & 2 deletions src/site_assessment/common_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,13 @@ Writes out GeoJSON file to a target directory. Output file will be located at lo
- `destination_path` : File path to write geojson file to.
- `df` : DataFrame intended for writing to geojson file.
"""
function output_geojson(destination_path::String, df::DataFrame; output_crs=EPSG(4326))::Nothing
function output_geojson(
destination_path::String, df::DataFrame; output_crs=EPSG(4326)
)::Nothing
out_df = copy(df)
out_df.geometry = GO.reproject(out_df.geometry, GI.crs(first(out_df.geometry)), output_crs)
out_df.geometry = GO.reproject(
out_df.geometry, GI.crs(first(out_df.geometry)), output_crs
)

GDF.write(destination_path, out_df; crs=GI.crs(first(out_df.geometry)))

Expand Down
Loading