Closed ranchodeluxe closed 2 months ago
still unsure if number 2 above is international date line issues but even when trying to render the source data in a notebook we quickly end up in this situation:
from fireatlas import FireIO, preprocess, postprocess
import branca.colormap as cm
import folium
import pandas as pd
tst = [2024, 8, 5, "AM"]
ted = [2024, 8, 6, "AM"]
region = ("RussiaEast", [97.16172779881556, 46.1226744036175, 168.70469654881543, 77.81982396998427])
region = preprocess.read_region(region, location="s3")
# df = postprocess.read_allpixels(tst, ted, region, location="s3")
gdf = postprocess.read_allfires_gdf(tst, ted, region, location="s3").reset_index()
gdf.head(3)
gdf[gdf['t'].dt.date == pd.to_datetime('2024-08-02').date()].head(3)
gdf.crs
mymap = folium.Map(zoom_start=12)
color = 'blue'
data = gdf
# put the region on the map
folium.GeoJson(
region[1],
style_function=lambda x: {'fillColor': 'pink', 'color': 'red', 'weight': 2}
).add_to(mymap)
folium.GeoJson(
data["hull"],
name=f"perimeter",
color=color,
fill_opacity=0.2,
weight=3,
).add_to(mymap)
mymap
Still on the international date line hunch and rerunning all of RussiaEast with a new bbox to test the theory. About three hours out from that being finished
It was the international date line. I win 🎖️
Problem
Russia presents a couple problems:
NaN
and cause internal server errors during serialization:SELECT primarykey from eis_fire_snapshot_perimeter_nrt where NOT ST_IsValid(geometry);
This statement above can help identify them (and delete them) but we need to find the core issue