Geojson tutorial
In [1]:
Copied!
import geodemora
import geodemora
In [2]:
Copied!
m = geodemora.Map()
m
m = geodemora.Map()
m
In [3]:
Copied!
in_geojson = "./data/countries.json"
in_geojson = "./data/countries.json"
In [4]:
Copied!
style = {
"stroke": True,
"color": "#ff0000",
"weight": 2,
"opacity": 1,
"fill": True,
"fillColor": "#0000ff",
"fillOpacity": 0.4,
}
style = {
"stroke": True,
"color": "#ff0000",
"weight": 2,
"opacity": 1,
"fill": True,
"fillColor": "#0000ff",
"fillOpacity": 0.4,
}
In [5]:
Copied!
style
style
Out[5]:
{'stroke': True, 'color': '#ff0000', 'weight': 2, 'opacity': 1, 'fill': True, 'fillColor': '#0000ff', 'fillOpacity': 0.4}
In [6]:
Copied!
m.add_geojson(in_geojson, style = style, layer_name="GeoJSON")
m.add_geojson(in_geojson, style = style, layer_name="GeoJSON")
--------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) Input In [6], in <cell line: 1>() ----> 1 m.add_geojson(in_geojson, style = style, layer_name="GeoJSON") File ~/.local/lib/python3.9/site-packages/geodemora/geodemora.py:84, in Map.add_geojson(self, in_geojson, style, layer_name) 81 if isinstance(in_geojson, str): 83 if not os.path.exists(in_geojson): ---> 84 raise FileNotFoundError("The provided GeoJSON file could not be found.") 86 with open(in_geojson) as f: 87 data = json.load(f) FileNotFoundError: The provided GeoJSON file could not be found.
In [ ]:
Copied!
Last update:
2022-06-06