Spaces:
Running
Running
Update buildings app
Browse files
pages/02_google_buildings.py
CHANGED
|
@@ -9,14 +9,14 @@ center = solara.reactive((20, 0))
|
|
| 9 |
|
| 10 |
|
| 11 |
def get_datasets(m):
|
| 12 |
-
url =
|
| 13 |
-
df = pd.read_csv(url, sep=
|
| 14 |
-
setattr(m,
|
| 15 |
return df
|
| 16 |
|
| 17 |
|
| 18 |
def add_widget(m, position="topright"):
|
| 19 |
-
building_url = "https://
|
| 20 |
country_url = (
|
| 21 |
"https://naciscdn.org/naturalearth/110m/cultural/ne_110m_admin_0_countries.zip"
|
| 22 |
)
|
|
@@ -61,12 +61,13 @@ def add_widget(m, position="topright"):
|
|
| 61 |
|
| 62 |
country.observe(country_changed, names="value")
|
| 63 |
|
| 64 |
-
m.add_ee_layer(
|
| 65 |
|
| 66 |
m.add_widget(country, position=position)
|
| 67 |
|
| 68 |
html = "Source: <a href='https://sites.research.google/open-buildings/' target='_blank'>Google Open Buildings</a>"
|
| 69 |
-
m.add_html(html, position=
|
|
|
|
| 70 |
|
| 71 |
class Map(leafmap.Map):
|
| 72 |
def __init__(self, **kwargs):
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
def get_datasets(m):
|
| 12 |
+
url = "https://raw.githubusercontent.com/opengeos/ee-tile-layers/main/datasets.tsv"
|
| 13 |
+
df = pd.read_csv(url, sep="\t")
|
| 14 |
+
setattr(m, "df", df)
|
| 15 |
return df
|
| 16 |
|
| 17 |
|
| 18 |
def add_widget(m, position="topright"):
|
| 19 |
+
building_url = "https://openbuildings-public-dot-gweb-research.uw.r.appspot.com/public/tiles.geojson"
|
| 20 |
country_url = (
|
| 21 |
"https://naciscdn.org/naturalearth/110m/cultural/ne_110m_admin_0_countries.zip"
|
| 22 |
)
|
|
|
|
| 61 |
|
| 62 |
country.observe(country_changed, names="value")
|
| 63 |
|
| 64 |
+
m.add_ee_layer("GOOGLE/open-buildings", name="Buildings")
|
| 65 |
|
| 66 |
m.add_widget(country, position=position)
|
| 67 |
|
| 68 |
html = "Source: <a href='https://sites.research.google/open-buildings/' target='_blank'>Google Open Buildings</a>"
|
| 69 |
+
m.add_html(html, position="bottomright")
|
| 70 |
+
|
| 71 |
|
| 72 |
class Map(leafmap.Map):
|
| 73 |
def __init__(self, **kwargs):
|