Update app.py
Browse files
app.py
CHANGED
|
@@ -2,25 +2,6 @@
|
|
| 2 |
import gradio
|
| 3 |
import geopandas as gpd
|
| 4 |
|
| 5 |
-
# Sample DataFrame acording to actual structure (use your own data)
|
| 6 |
-
data = {'GID_1': ['DEU.1_1','DEU.2_1'],
|
| 7 |
-
'GID_0': ['DEU', 'DEU'],
|
| 8 |
-
'COUNTRY': ['Germany', 'Germany'],
|
| 9 |
-
'NAME_1': ['Baden-Würtenberg', 'Bayern'],
|
| 10 |
-
'VARNAME_1': ['NA','Bavaria'],
|
| 11 |
-
'NL_NAME_1': ['NA', 'NA'],
|
| 12 |
-
'TYPE_1': ['Land', 'Freistaat'],
|
| 13 |
-
'ENGTYPE_1': ['State', 'Freestate'],
|
| 14 |
-
'CC_1': ['08','09'],
|
| 15 |
-
'HASC_1': ['DE.BW', 'DE.BY'], # Extra for subnational countys (https://de.wikipedia.org/wiki/Hierarchical_administrative_subdivision_codes)
|
| 16 |
-
'ISO_1': ['NA', 'DE-BY'], # International Order --> Check First (https://de.wikipedia.org/wiki/ISO_3166)
|
| 17 |
-
'geometry': [0,1]
|
| 18 |
-
}
|
| 19 |
-
gdf = gpd.GeoDataFrame(data)
|
| 20 |
-
|
| 21 |
-
# function to generate output
|
| 22 |
-
# Land should be a line from the geojson-table
|
| 23 |
-
# Currently only works for NUTS-1 areas!!!
|
| 24 |
|
| 25 |
def getCountrycode(land, level):
|
| 26 |
iso = 'ISO_'+ str(level)
|
|
@@ -32,7 +13,6 @@ def getCountrycode(land, level):
|
|
| 32 |
else:
|
| 33 |
return False
|
| 34 |
|
| 35 |
-
blub = gdf.iloc[0]
|
| 36 |
|
| 37 |
import pandas as pd
|
| 38 |
def getLand(landnr):
|
|
|
|
| 2 |
import gradio
|
| 3 |
import geopandas as gpd
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
def getCountrycode(land, level):
|
| 7 |
iso = 'ISO_'+ str(level)
|
|
|
|
| 13 |
else:
|
| 14 |
return False
|
| 15 |
|
|
|
|
| 16 |
|
| 17 |
import pandas as pd
|
| 18 |
def getLand(landnr):
|