Export training data sample codes in python

595
1
Jump to solution
10-13-2022 06:44 AM
Labels (1)
JadedEarth
Occasional Contributor

I'm using ArcGIS Jupyter Notebook interface for the first time in ArcGIS Pro version 2.9.  I can't find specific guidelines on how to run the Export Training Data for Deep Learning tool in arcgis.learn when you're using local data.  Here's what I'm trying to do in Notebook:

Sample code from Land Cover Classification using Satellite Imagery and Deep Learning | ArcGIS API for Python:

import arcgis
from arcgis import learn
arcgis.env.verbose = True

export = learn.export_training_data(input_raster = world_imagery_layer,
     output_location = samplefolder,
     input_class_data = label_layer.url,
     chip_format = "PNG",
     tile_size = {"x":400,"y":400},
     stride_size = {"x":0,"y":0},
     metadata_format = "Classified_Tiles",
     context = {"startIndex": 0, "exportAllTiles": False, "cellSize": 2},
     context = context,
     gis = ent_gis)

Questions:

1.  For input raster, my data is located on a file geodatabase.  How do I code the path to the geodatabase?

2.  Output location:  what is the format for path to the destination folder?

3.  Input class data:  my class data is again on a file geodatabase on my computer.  How do I code the path?

4.  On context parameter: 

          - Why does the cell size = 2?  My data has 1-meter resolution.  What's the appropriate cell size I should specify?

          - What does "exportAllTiles" mean?

5.  On "gis = ent_gis":  What does this line mean?

 

Appreciate any help.

 

0 Kudos
1 Solution

Accepted Solutions
JadedEarth
Occasional Contributor

Hi,

Never mind.  Found the answers:

1.  On paths:  Just use double backslash to format them.

2.  On cell size:  Use the input raster's cell size (in my case was 0.6)

3.  "exportAllTiles":  Set the value to False so it would only create data that matches the classes.

4.  "gis = ent_gis":  I think this is for ArcGIS Online; not needed if your data are local.

View solution in original post

0 Kudos
1 Reply
JadedEarth
Occasional Contributor

Hi,

Never mind.  Found the answers:

1.  On paths:  Just use double backslash to format them.

2.  On cell size:  Use the input raster's cell size (in my case was 0.6)

3.  "exportAllTiles":  Set the value to False so it would only create data that matches the classes.

4.  "gis = ent_gis":  I think this is for ArcGIS Online; not needed if your data are local.

0 Kudos