Skip to content

Commit

Permalink
final changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ines Elmufti authored and Ines Elmufti committed Feb 9, 2025
1 parent d5293d9 commit 9b440ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
13 changes: 2 additions & 11 deletions instageo/apps/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import matplotlib.cm
from pathlib import Path
from pyproj import CRS, Transformer
from instageo.apps.viz import create_map_with_geotiff_tiles
from viz import create_map_with_geotiff_tiles

# Initialize Dash App
app = dash.Dash(__name__)
Expand Down Expand Up @@ -43,9 +43,6 @@ def load_tile_metadata(json_path: str) -> list:
with open(json_path, "r") as f:
return json.load(f)




# Layout with Sidebar
app.layout = html.Div([
dcc.Store(id="stored-viewport", data=default_viewport),
Expand Down Expand Up @@ -111,7 +108,7 @@ def load_tile_metadata(json_path: str) -> list:

],style={'display':'flex','height':'100vh'})

tile_metadata_path = "instageo/apps/tile_metadata.json"
tile_metadata_path = "tile_metadata.json"
tile_metadata = load_tile_metadata(tile_metadata_path)


Expand Down Expand Up @@ -173,11 +170,5 @@ def update_map(relayout_data, directory, year, month, current_viewport,dimension
new_viewport = current_viewport
return create_map_with_geotiff_tiles(tile_metadata, new_viewport, zoom, base_dir)







if __name__ == "__main__":
app.run_server(debug=True)
4 changes: 2 additions & 2 deletions instageo/apps/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ plotly
rasterio
xarray
datashader==0.16.2
dask==2024.12.1
dask
matplotlib
streamlit==1.31.1
dash
1 change: 0 additions & 1 deletion instageo/apps/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ def read_geotiff_to_xarray(filepath: str) -> tuple[xr.Dataset, CRS]:
def zoom_to_scale(zoom: float):
zoom_dict = {1:0.1,2:0.1,3:0.1,4:0.25,5:0.5,6:0.6,7:0.1,8:0.1}
zoom_ceiled = math.ceil(zoom)
print("zoom ciel",zoom_ceiled)
if zoom_ceiled in zoom_dict.keys():
scale = zoom_dict[zoom_ceiled]
else:
Expand Down

0 comments on commit 9b440ab

Please sign in to comment.