Skip to content

Commit

Permalink
Merge pull request #36 from open-AIMS/fix-tile-cache
Browse files Browse the repository at this point in the history
Fix tile cache filename
  • Loading branch information
ConnectedSystems authored Oct 13, 2024
2 parents 29fc1ab + cca95a6 commit 439334a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
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

0 comments on commit 439334a

Please sign in to comment.