Reselect Sample (Data Reviewer)

Available with Data Reviewer license.

Summary

Reselects a previously generated random selection from a feature layer or table view. This tool applies a selection using the input data based on the SQL query sourced from a .json file that was generated using the Select Random Sample tool.

Usage

  • The Input JSON File parameter value stores the following information:

    • The date and time the tool was run
    • The workspace the input is sourced from
    • The name of the input feature layers or tables
    • The total number of selected records
    • The OIDs of the selected records
    • The SQL expression that was used to make the selection
  • The output .json file from the Select Random Sample tool stores the SQL query that will be applied to the input feature layer or table view.

  • A new selection will be created on the data. Any selection made before running this tool will be cleared or ignored. The Use the selected records toggle button status will not impact the reselection, as the tool will run on all rows in the feature layer or table specified in the Input Rows parameter.

  • The feature layer or table must have an ObjectID field before running this tool.

  • If the Use the selected records toggle button is turned off, the Output File parameter value will record a random selection of features based on the entire dataset. However, if there is a definition query applied, only the features or rows matching the query will be selected in the map frame.

Parameters

LabelExplanationData Type
Input Rows

The feature layer or table view to which the selection will be applied.

Feature Layer; Table View
Input JSON File

The .json file that will be used to reselect records from the input feature layer or table view. This file is generated using the Select Random Sample tool.

File

Derived Output

LabelExplanationData Type
Updated Rows

The updated input with a selection applied.

Feature Layer; Table View

arcpy.Reviewer.ReselectSample(in_layer_or_view, in_file)
NameExplanationData Type
in_layer_or_view

The feature layer or table view to which the selection will be applied.

Feature Layer; Table View
in_file

The .json file that will be used to reselect records from the input feature layer or table view. This file is generated using the Select Random Sample tool.

File

Derived Output

NameExplanationData Type
out_layer_or_view

The updated input with a selection applied.

Feature Layer; Table View

Code sample

ReselectSample example 1 (Python)

The following Python window script demonstrates how to use the ReselectSample function.

import arcpy
arcpy.env.workspace = r"C:\USAData\Data.gdb"
arcpy.ReselectSample_Reviewer("Cities", in_file = "C:\\USAData\\Cities_Sample.json")
ReselectSample example 2 (stand-alone script)

Reselect a random selection of features within the Cities feature layer.

# Name: ReselectSample_Example.py
# Description: Use the ReselectSample tool in ArcGIS Pro to reselect a random sample of features from a feature class.

# Import system modules
import arcpy

# Set environment workspace
arcpy.env.workspace = r"C:\USAData\Data.gdb"

# Set local variables
in_layer_or_view = "Cities"
in_file = r"C:\USAData\Cities_Sample.json"

# Reselect a random sample of features
arcpy.ReselectSample_Reviewer(in_layer_or_view, in_file)

Environments

Licensing information

  • Basic: Requires Data Reviewer
  • Standard: Requires Data Reviewer
  • Advanced: Requires Data Reviewer

Related topics