Vector
In [1]:
Copied!
#!pip install geotask
#!pip install geotask
In [2]:
Copied!
import geotask
import geotask
In [3]:
Copied!
from geotask import Map
from geotask import Map
In [4]:
Copied!
m = geotask.Map()
m.add_basemap("OpenTopoMap")
m.add_geojson("europe_110.geo.json") #using file_path
m
m = geotask.Map()
m.add_basemap("OpenTopoMap")
m.add_geojson("europe_110.geo.json") #using file_path
m
Out[4]:
In [5]:
Copied!
m.add_geojson("https://github.com/jupyter-widgets/ipyleaflet/raw/master/examples/europe_110.geo.json") # using URL
m
m.add_geojson("https://github.com/jupyter-widgets/ipyleaflet/raw/master/examples/europe_110.geo.json") # using URL
m
Out[5]:
In [6]:
Copied!
m.add_shp("countries.shp", name = "Countries")
m.add_layers_control()
m
m.add_shp("countries.shp", name = "Countries")
m.add_layers_control()
m
Out[6]:
In [7]:
Copied!
m.add_vector('europe_110.geo.json')
m
m.add_vector('europe_110.geo.json')
m
Out[7]:
In [8]:
Copied!
import geopandas as gpd
from ipyleaflet import GeoData, Polyline
from shapely.geometry import Point, LineString
# Create two Points
point1 = Point(90.4125, 23.8103) # Dhaka, Bangladesh
point2 = Point(-83.9207, 35.9606) # Knoxville, TN, USA
# Create a Polyline between the two points
line = LineString([point1, point2])
# Create a list of [latitude, longitude] pairs for the Polyline
polyline_locations = [[lat, lon] for lon, lat in line.coords]
# Create the Polyline
polyline = Polyline(locations=polyline_locations, color="blue", name="Distance", fill=False)
# Add the Polyline to the map
m.add_layer(polyline)
# Display the map
m
import geopandas as gpd
from ipyleaflet import GeoData, Polyline
from shapely.geometry import Point, LineString
# Create two Points
point1 = Point(90.4125, 23.8103) # Dhaka, Bangladesh
point2 = Point(-83.9207, 35.9606) # Knoxville, TN, USA
# Create a Polyline between the two points
line = LineString([point1, point2])
# Create a list of [latitude, longitude] pairs for the Polyline
polyline_locations = [[lat, lon] for lon, lat in line.coords]
# Create the Polyline
polyline = Polyline(locations=polyline_locations, color="blue", name="Distance", fill=False)
# Add the Polyline to the map
m.add_layer(polyline)
# Display the map
m
Out[8]: