Select to view content in your preferred language

Trouble Plotting Points and Polylines from Local GDB in Jupyter Notebook using 'sedf.spatial.plot(map)'

758
1
02-16-2024 12:38 PM
Labels (3)
AK_geosci
New Contributor

I'm currently working in a Jupyter Notebook and attempting to plot feature classes from a local geodatabase. To my surprise, it seems that sedf.spatial.plot(map_widget=map) only works with polygons; it doesn't seem to function properly with points and polylines.

Here's the code snippet I'm working with:

# Creating SEDF objects
f1 = r"VisualPythonAPI\FirePoints.gdb\Counties_Montana"
f2 = r"VisualPythonAPI\FirePoints.gdb\FirePoints_Full"

sedf1 = pd.DataFrame.spatial.from_featureclass(f1)
sedf2 = pd.DataFrame.spatial.from_featureclass(f2)

# Setting up the map
map1 = gis.map('Montana')
map1

# Plot the data to map1
sedf1.spatial.plot(map1)
sedf2.spatial.plot(map1)

#result

AkashDurgapu_0-1708115427474.png

Note:
I also attempted to plot the same feature class in shapefile format, and it was successfully displayed on the map.

0 Kudos
1 Reply
EdMorris
Esri Contributor

Hello

I think this question may have been answered via this Solution; see below:

Solved: Jupyter Lab spatial.plot local gdb multiple featur... - Esri Community

I hope this works.

many thanks ed

0 Kudos