How can I add all geometries included in a FeatureSet to a web map?
Trying to add geometries (i.e., shapes) to a Jupyter notebook web map (see code sample below).
Adding features from the ArcGIS server is a breeze. But what about adding from third parties?
My geometries are first imported as a .geojson
, which I convert to an arcgis.feature.FeatureSet
.
For each feature in the set, I'd like to use the coordinates of each shape to add that shape to a web map.
Setup: latest anaconda python with arcgis API v.1.4 on a Linux 16.04 box.
import arcgis
from IPython.display import display
import requests
# link build
HI_geo_stem = 'https://opendata.arcgis.com/datasets/'
HI_parcels_json = '1eb5fa03038d49cba930096ea67194e0_5'
parcels_link = ''.join([HI_geo_stem, HI_parcels_json, '.geojson'])
# read in parcel json
raw_parcels_json = requests.get(parcels_link).json()
# convert json to arcgis FeatureSet
hi_arc_parcels = arcgis.features.FeatureSet.from_geojson(raw_parcels_json)
# display a web mapgis = arcgis.GIS("https://www.arcgis.com")
m = gis.map("Hawaii", zoomlevel = 10)
# now display hi_arc_parcels in web map m ??