Select to view content in your preferred language

Display raster stored in file geodatabase into Jupyter Notebook (Python API) outside of ArcGIS Pro

1086
7
01-02-2024 08:47 AM
Labels (2)
JadedEarth
Frequent Contributor

I'm using ArcGIS Pro Python API 2.2.0 and ArcGIS Pro version 3.2.1 in Windows 10 64-bit machine.

How do I display a raster image stored in a file geodatabase in my Jupyter notebook using python script?

Thanks for any help.

0 Kudos
7 Replies
BobBooth1
Esri Contributor

Have a look at this notebook tutorial - it is an ArcGIS (Online) Notebook example, but you should be able to use arcpy in a notebook in your local environment much the same way.

https://www.arcgis.com/home/item.html?id=23f64f565faa4e78ac24d17e5e8a9ae8#preview

Also, there are tutorials on viewing and analyzing imagery in notebooks here:

https://learn.arcgis.com/en/paths/analyze-imagery-with-arcgis-notebooks/

 

0 Kudos
JadedEarth
Frequent Contributor

I forgot to mention that my cloned environment is on Drive C while my data are on Drive E.  The code snippet is as follows:

    from arcgis.learn import prepare_data, UnetClassifier, classify_pixels
     

   # Prepare the input raster
data_path = r"E:\NAIP_TX\TX_Counties_aea.gdb\Bell027_aea"

But I get an error "Invalid input path.  Could not find the path specified."

 

0 Kudos
JadedEarth
Frequent Contributor

It would seem that my problem really is how to access data sources in Python/Jupyter notebook.  I really need how to access an ArcGIS Pro catalog path.  Windows doesn't recognize a catalog path (e.g., file geodatabase).  How do I specify a catalog path using Jupyter Notebook in arcgis.learn api?   I hope I'm making sense.

0 Kudos
DanPatterson
MVP Esteemed Contributor

Is it a usb stick/drive?


... sort of retired...
0 Kudos
JadedEarth
Frequent Contributor

No.  It is actually a server but instead of installing a Microsoft Server software, we just installed Microsoft stand-alone desktop operating system for Windows 10.  It has Drives C (for running software) and Drives D and E for data.  Our satellite imagery data are from NAIP (https://nrcs.app.box.com/v/naip).  But we processed these data into png format since the raw data are in Mr.Sid format.  Each US county are huge and in order to process them, we have to store each county in a file geodatabase.  Hence, I need to access them from the data drives D or E.  We are using these satellite imageries for deep learning.

0 Kudos
BobBooth1
Esri Contributor
0 Kudos
BobBooth1
Esri Contributor

Accessing images on another drive seems to work for me (see attached image).

Import arcpy to recognize geodatabase items.

 

0 Kudos