Select to view content in your preferred language

Making Maps in Jupyter Lab with LOCAL Data

1462
1
Jump to solution
10-14-2020 02:44 PM
NilsRatnaweera1
Occasional Contributor

Is there a way to use the ArcGIS API for python to create a map with LOCAL data? All I see on the website are examples with data hosted on ArcGIS Online.

0 Kudos
1 Solution

Accepted Solutions
MehdiPira1
Esri Contributor

Hi Nils Ratnaweera‌,

Yes, you can.

By using Pandas, GeoAccessor and GeoSeriesAccessor DataFrame Accessors you can access local shapefiles and gdb feature classes,...

from arcgis.features import GeoAccessor, GeoSeriesAccessor
import pandas as pd

Then these feature classes can be plotted as spatial data frames to a web map in this instance.

The following links give more insights:

https://community.esri.com/message/958657-re-jupyter-lab-spatialplot-local-gdb-multiple-feature-clas... 

Introduction to the Spatially Enabled DataFrame | ArcGIS for Developers 

or use

mp.add_layer(layer_item)

to add layers to the web map, then web map can be saved in Portal or AGOL.

Here's an example of how to set up item properties of a web map and save it:

webmap_properties = {'title':'Web Map Sample','snippet': 'Jupyter notebook saved as a web map','tags':['automation', 'python']}
mp.save(item_properties = webmap_properties, mode=None, thumbnail=None, metadata=None, owner=None, folder=None,)

View solution in original post

1 Reply
MehdiPira1
Esri Contributor

Hi Nils Ratnaweera‌,

Yes, you can.

By using Pandas, GeoAccessor and GeoSeriesAccessor DataFrame Accessors you can access local shapefiles and gdb feature classes,...

from arcgis.features import GeoAccessor, GeoSeriesAccessor
import pandas as pd

Then these feature classes can be plotted as spatial data frames to a web map in this instance.

The following links give more insights:

https://community.esri.com/message/958657-re-jupyter-lab-spatialplot-local-gdb-multiple-feature-clas... 

Introduction to the Spatially Enabled DataFrame | ArcGIS for Developers 

or use

mp.add_layer(layer_item)

to add layers to the web map, then web map can be saved in Portal or AGOL.

Here's an example of how to set up item properties of a web map and save it:

webmap_properties = {'title':'Web Map Sample','snippet': 'Jupyter notebook saved as a web map','tags':['automation', 'python']}
mp.save(item_properties = webmap_properties, mode=None, thumbnail=None, metadata=None, owner=None, folder=None,)