The realitymapping python API allows automating realitymapping tasks in the server environment.
For more information about realitymapping workflows in ArcGIS, please visit the help documentation at Realitymapping in ArcGIS
is_supported
Project
- class arcgis.raster.realitymapping.Project(project: str | Item = None, sensor_type: Enum | str | None = 'Drone', scenario_type: Enum | str | None = 'Drone', settings: dict | None = None, out_sr: SpatialReference | dict | None = None, *, gis: GIS | None = None, **kwargs)
Bases:
objectProject represents an Realitymapping Project Item in the portal.
Usage:
arcgis.raster.Project(project, gis=gis)Parameter
Description
project
Required string or Reality Mapping Project Item
Example:
project = “RM_project”om_item = gis.content.get(“85a54236c6364a88a7c7c2b1a31fd901”)project = rm_itemsensor_type
Optional SensorType or string. The type of sensor used to collect the imagery.
The default value is SensorType.DRONE.
Please refer to
SensorTypefor supported values.scenario_type
Optional ScenarioType or string. The type of scenario for the imagery.
The ScenarioType.AERIAL_NADIR and ScenarioType.AERIAL_OBLIQUE scenarios are only applicable for SensorType.AERIAL_DIGITAL sensor type. The ScenarioType.DRONE scenario is only applicable for SensorType.DRONE. This parameter is ignored if the sensor_type is SensorType.SATELLITE or SensorType.AERIAL_SCANNED.
When the sensor_type is SensorType.DRONE, the default value is ScenarioType.DRONE. When the sensor_type is SensorType.AERIAL_DIGITAL, the default value is set to ScenarioType.AERIAL_NADIR.
Please refer to
ScenarioTypefor supported values.settings
Optional dictionary. The project settings dictionary. The definition mainly contains the template information for adjustSettings, processingStates. See Default settings for more information on the default settings.
out_sr
Optional dictionary or
SpatialReference. The spatial reference to be used for this project.This can be specified as a well-known ID (WKID) and a VCS WKID. For e.g.: {“wkid”: 4326, “vcsWkid”: 4326}
If no spatial reference is specified, it is set to 3857 by default.
gis
Optional
GIS. The GIS on which this tool runs. If not specified, the active GIS is used.# Example Usage project = Project('rm_proj', gis=gis) # Example Usage rm_item = gis.content.get("85a54236c6364a88a7c7c2b1a31fd901") project = Project(rm_item, gis=gis) # Using the SensorType and ScenarioType enums from arcgis.raster.realitymapping import SensorType, ScenarioType project = Project( 'rm_proj', sensor_type=SensorType.AERIAL_DIGITAL, scenario_type=ScenarioType.AERIAL_NADIR, gis=gis )
- create_mission(image_list: list[str | Item] = None, image_collection_name: str | dict[str, str] | None = None, mission_name: str | None = None, raster_type_name: str | None = None, raster_type_params: dict | None = None, out_sr: dict | None = None, settings: dict | None = None, context: dict | None = None, *, gis: GIS | None = None, future: bool | None = False, **kwargs)
Creates a new mission in the realitymapping project. The mission is created with the specified image collection, raster type, and settings.
Parameter
Description
image_list
Required, the list of input images to be added to the image collection being created.
This parameter can be a list of image paths or a path to a folder containing the images.
This can be datastore paths, local paths, or a list of
Itemobjects.The function can create hosted imagery layers on enterprise from local raster datasets by uploading the data to the server.
image_collection_name
Optional string or dictionary. The name of the image collection to be created.
If a string is provided, it will be used as the portal name for the image collection.
If a dictionary is provided, it should contain the keys ‘service_name’ and ‘portal_name’.
The ‘service_name’ must be unique.
For e.g.: {“service_name”: “my_image_service”, “portal_name”: “My Image Collection”}
mission_name
Optional string. The name of the mission to be created.
If a name is not provided, a default name will be generated in the format “mission_<random_id>”.
raster_type_name
Optional string. The name of the raster type used. Refer to
create_image_collection()for supported raster types.raster_type_params
Optional dict. Additional
raster_typespecific parameters.The process of add rasters to the image collection can be controlled by specifying additional raster type arguments.
The raster type parameters argument is a dictionary.
The dictionary can contain the following keys:
productType
processingTemplate
pansharpenType
Filter
pansharpenWeights
ConstantZ
dem
zoffset
CorrectGeoid
ZFactor
StretchType
ScaleFactor
ValidRange
For Supported Raster Types, please refer to the documentation for
create_image_collection()for details about the product types, processing templates, pansharpen weights for each raster type.Possible values for pansharpenType - [“Mean”, “IHS”, “Brovey”, “Esri”, “Mean”, “Gram-Schmidt”]
Possible values for filter - [None, “Sharpen”, “SharpenMore”]
Value for StretchType dictionary can be as follows:
“None”
“MinMax; <min>; <max>”
“PercentMinMax; <MinPercent>; <MaxPercent>”
“StdDev; <NumberOfStandardDeviation>”
Example: {“StretchType”: “MinMax; <min>; <max>”}
ValidRange can be specified as: “<MaskMinValue>, <MaskMaxValue>”
Example: {“ValidRange”: “10, 200”}
Example:
{“productType”:”All”,“processingTemplate”:”Pansharpen”,“pansharpenType”:”Gram-Schmidt”,“filter”:”SharpenMore”,“pansharpenWeights”:”0.85 0.7 0.35 1”,“constantZ”:-9999}out_sr
Optional dictionary. The spatial reference to be used for this mission.
settings
Optional dictionary. The settings for this mission. If not provided, the project settings will be inherited.
A subset of the settings can also be provided but the structure of the settings dictionary must be preserved.
An example is provided below.
For the entire list of settings, please refer to the
context
Optional dict. The context parameter is used to provide additional input parameters.
Syntax: {“image_collection_properties”: {“imageCollectionType”:”Satellite”},”byref”:True}
Use
image_collection_propertieskey to set value for imageCollectionType.Note
The “imageCollectionType” property is important for image collection that will later on be adjusted by orthomapping system service.
Based on the image collection type, the orthomapping system service will choose different algorithm for adjustment.
Therefore, if the image collection is created by reference, the requester should set this property based on the type of images in the image collection using the following keywords.
If the imageCollectionType is not set, it defaults to “UAV/UAS”
If
byrefis set to ‘True’, the data will not be uploaded. If it is not set, the default is ‘False’The context parameter can also be used to specify whether to build overviews, build footprints, to specify pixel value that represents the NoData etc.
Example:
{“buildFootprints”:True,“footprintsArguments”:{“method”:”RADIOMETRY”,”minValue”:1,”maxValue”:5,“shrinkDistance”:50,”skipOverviews”:True,”updateBoundary”:True,“maintainEdge”:False,”simplification”:None,”numVertices”:20,“minThinnessRatio”:0.05,”maxSliverSize”:20,”requestSize”:2000,“minRegionSize”:100},“defineNodata”:True,“noDataArguments”:{“noDataValues”:[500],”numberOfBand”:99,”compositeValue”:True},“buildOverview”:True}The context parameter can be used to add new fields when creating the image collection.
Example:
{“fields”: [{“name”: “cloud_cover”, “type”: “Long”},{“name”: “cloud_shadow_count”, “type”: “Long”}]}gis
Optional
GIS. The GIS on which this tool runs If not specified, the active GIS is used.- Returns:
Mission object
# Example settings dictionary: settings = { "adjustSettings": { "maxResidual": 5.0, "focalLength": False, "locationAccuracy": "LOW" }, "processingSettings": { "dsm": { "dsm": { "format": "TIFF", "outputType": "TILED", "resampling": "BILINEAR" } }, "dtm": { "dtm": { "mask": "", "extent": "", "format": "CRF", "fillDEM": "", "cellsize": "NaN", "lowNoise": 0.25, "highNoise": 100.0, "compression": "NONE", "reuseGround": False } } } }
# Example Usage mission = project.create_mission( image_list=["/path/to/image1.tif", "/path/to/image2.tif"], image_collection_name={"service_name": "my_image_service", "portal_name": "My Image Collection"}, mission_name="My Mission", raster_type_name="UAV/UAS", raster_type_params={ "isAltitudeFlightHeight": "False", "averagezdem": {"url": "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"} }, out_sr={"wkid": 4326} )
- delete()
The
deletemethod deletes the project item from the portal and all the associated products.- Returns:
A boolean indicating whether the deletion was successful or not
- get_mission(name: str)
Returns a Mission object with the name specified using the name parameter.
Parameter
Description
name
Required string. The name of the Mission.
The name of the mission is case sensitive.
- Returns:
The imagery layer url
- property group
The
groupproperty returns the group associated with the project.- Returns:
A
Groupobject representing the group associated with the project
- property item
The
itemproperty returns the portal item associated with the project.- Returns:
A portal item
- merge_missions(missions, output_mission_name: str | None = None, mission_settings: str | None = None, *, gis: GIS | None = None, future: bool | None = False, **kwargs)
Merges multiple missions and creates a new mission in the realitymapping project.
Parameter
Description
missions
Required list of Mission objects. The missions to be merged.
output_mission_name
Optional string. The name of the output mission to be created. If not provided, a default name will be generated in the format “mission_<random_id>”.
mission_settings
Optional dictionary. The settings for the new mission. If not provided, the project settings will be inherited. A subset of the settings can also be provided but the structure of the settings dictionary must be preserved. Refer to the settings property of the Project class for more details on the structure of the settings dictionary.
gis
Optional
GIS. The GIS on which this tool runs. If not provided, the active GIS will be used.- Returns:
A Mission object representing the merged mission.
# Example Usage mission1 = project.get_mission("mission_1") mission2 = project.get_mission("mission_2") merged_mission = project.merge_missions( missions=[mission1, mission2], output_mission_name="Merged Mission", mission_settings={ "adjustSettings": { "maxResidual": 5, "focalLength": False, "locationAccuracy": "LOW" } } )
- property mission_count
The
mission_countproperty returns the number of missions associated with the project- Returns:
An integer representing the number of missions
- property missions
The
missionsproperty returns all the missions associated with the project- Returns:
A list of missions of the realitymapping project
Mission
- class arcgis.raster._realitymapping_mission.Mission(mission_name, mission_id, project)
Bases:
objectMission represents a mission in an Realitymapping Project.
Note
This class is not created by users directly. An instance of this class is returned as output for get_mission() and create_mission() methods or the missions property on the Project class of arcgis.raster.realitymapping module.
Parameter
Description
mission_name
Required string representing the mission name.
Example:
mission_name=’Mission_Yucaipa’
project
Required Project object or an Realitymapping Project portal item. The realitymapping project to which the mission belongs to.
# Example Usage 1 rm_item = gis.content.get("85a54236c6364a88a7c7c2b1a31fd901") project = Project(rm_item, gis=gis) mission_1 = project.add_mission(image_list, mission_name="mission_name", image_collection="img_collection", raster_type_name="UAV/UAS", raster_type_params=raster_type_params) # Example Usage 2 rm_item = gis.content.get("85a54236c6364a88a7c7c2b1a31fd901") project = Project(rm_item, gis=gis) mission_1 = project.get_mission("mission_name")
- add_image(input_rasters: list, raster_type_name: str | None = None, raster_type_params: dict[str, Any] | None = None, context: dict[str, Any] | None = None, *, gis: GIS | None = None, future: bool = False, **kwargs)
Add a collection of images to existing image collection of the mission. It provides provision to specify image collection properties through context parameter.
It can be used when new data is available to be included in the same mission of the realitymapping project. When new data is added to the image collection the entire image collection must be reset to the original state.
Parameter
Description
input_rasters
Required, the list of input images to be added to the image collection being created. This parameter can be a list of image paths or a path to a folder containing the images
The function can create hosted imagery layers on enterprise from local raster datasets by uploading the data to the server.
raster_type_name
Optional string. The name of the raster type to use for adding data to the image collection.
Choice list:
[“Aerial”, “ASTER”, “DMCII”, “DubaiSat-2”, “GeoEye-1”, “GF-1 PMS”, “GF-1 WFV”,“GF-2 PMS”, “GRIB”, “HDF”, “IKONOS”, “Jilin-1”, “KOMPSAT-2”, “KOMPSAT-3”,“Landsat 1-5 MSS”, “Landsat 4-5 TM”, “Landsat 7 ETM+”, “Landsat 8”, “Landsat 9”,“NetCDF”, “PlanetScope”, “Pleiades-1”, “Pleiades NEO”, “QuickBird”, “RapidEye”,“Raster Dataset”, “ScannedAerial”, “Sentinel-2”, “SkySat”, “SPOT 5”, “SPOT 6”,“SPOT 7”, “Superview-1”, “Tiled Imagery Layer”, “UAV/UAS”, “WordView-1”,“WordView-2”, “WordView-3”, “WordView-4”, “ZY3-SASMAC”, “ZY3-CRESDA”]Example:
“QuickBird”
raster_type_params
Optional dict. Additional
raster_typespecific parameters.The process of add rasters to the image collection can be controlled by specifying additional raster type arguments.
The raster type parameters argument is a dictionary.
Syntax:
{“gps”: [[“image1.jpg”, “10”, “2”, “300”], [“image2.jpg”, “10”, “3”, “300”], [“image3.jpg”, “10”, “4”, “300”]], “cameraProperties”: {“Maker”: “Canon”, “Model”: “5D Mark II”, “FocalLength”: 20, “PixelSize”: 10, “x0”: 0, “y0”: 0, “columns”: 4000, “rows”: 3000}, “constantZ”: 300,”isAltitudeFlightHeight”: “True”,”dem”: {“url”:
https://...}The dictionary can contain productType, processingTemplate, pansharpenType, Filter, pansharpenWeights, ConstantZ, dem, zoffset, CorrectGeoid, ZFactor, StretchType, ScaleFactor, ValidRange
Please check the table below (Supported Raster Types), for more details about the product types, processing templates, pansharpen weights for each raster type.
Possible values for pansharpenType - [“Mean”, “IHS”, “Brovey”, “Esri”, “Mean”, “Gram-Schmidt”]
Possible values for filter - [None, “Sharpen”, “SharpenMore”]
Value for StretchType dictionary can be as follows:
“None”
“MinMax; <min>; <max>”
“PercentMinMax; <MinPercent>; <MaxPercent>”
“StdDev; <NumberOfStandardDeviation>”
Example: {“StretchType”: “MinMax; <min>; <max>”} - Value for ValidRange dictionary can be as follows:
“<MaskMinValue>, <MaskMaxValue>”
Example: {“ValidRange”: “10, 200”}
Example:
{“productType”:”All”,”processingTemplate”:”Pansharpen”, “pansharpenType”:”Gram-Schmidt”,”filter”:”SharpenMore”, “pansharpenWeights”:”0.85 0.7 0.35 1”,”constantZ”:-9999}
context
Optional dict. The context parameter is used to provide additional input parameters.
Syntax:
{“image_collection_properties”: {“imageCollectionType”:”Satellite”},”byref”:’True’}
Use
image_collection_propertieskey to set value for imageCollectionType.Note
The “imageCollectionType” property is important for image collection that will later on be adjusted by realitymapping system service. Based on the image collection type, the realitymapping system service will choose different algorithm for adjustment. Therefore, if the image collection is created by reference, the requester should set this property based on the type of images in the image collection using the following keywords. If the imageCollectionType is not set, it defaults to “UAV/UAS”
If byref is set to ‘True’, the data will not be uploaded. If it is not set, the default is ‘False’
- Returns:
The imagery layer url
- alter_processing_states(new_states: dict[str, Any], *, gis: GIS | None = None, future: bool = False, **kwargs)
Alter the processing states of the image collection. The states are stored as key property “Orthomapping”. The content of the state is a dictionary including several properties which can be set based on the process done on the image collection.
Parameter
Description
new_states
Required dictionary. The state to set on the image_collection
This a dictionary of states that should be set on the image collection The new states that can be set on the image collection are: blockadjustment, dem, gcp, seamlines, colorcorrection, adjust_index, imagetype
Example:
{“blockadjustment”: “raw”,“dem”: “Dense_Natual_Neighbor”,“seamlines”:”VORONOI”,“colorcorrection”:”SingleColor”,“imagetype”: “UAV/UAS”,“adjust_index”: 0}gis
Optional
GIS. The GIS on which this tool runs. If not specified, the active GIS is used.- Returns:
The result will be the newly set states dictionary
- compute_control_points(reference_image=None, image_location_accuracy: str = 'High', context: dict[str, Any] | None = None, *, gis: GIS | None = None, future: bool = False, **kwargs)
This service tool is used for computing matching control points between images within an image collection and/or matching control points between the image collection images and the reference image. Compute Control Points
Parameter
Description
reference_image
This is the reference image service that can be used to generate ground control points set with the image service. It can be a portal Item or an image service URL or a URI
image_location_accuracy
Optional string. This option allows you to specify the GPS location accuracy level of the source image. It determines how far the tool will search for neighboring matching images for calculating tie points and block adjustments.
The following are the available options: Low, Medium, High
Low- GPS accuracy of 20 to 50 meters, and the tool uses a maximum of 4 by 12 images.
Medium- GPS accuracy of 10 to 20 meters, and the tool uses a maximum of 4 by 6 images.
High- GPS accuracy of 0 to 10 meters, and the tool uses a maximum of 4 by 3 images.
If the image collection is created from satellite data, it will be automatically switched to use RPC adjustment mode. In this case, the mode need not be explicitly set by the user.
Default is High
context
Optional dictionary. Context contains additional environment settings that affect output control points generation.
Possible keys and their possible values are:
pointSimilarity- Sets LOW, MEDIUM, or HIGH tolerance for computing control points with varying levels of potential error.
LOW tolerance will produce the most control point, but may have a higher level of error.
HIGH tolerance will produce the least number of control point, but each matching pair will have a lower level of error.
MEDIUM tolerance will set the similarity tolerance to medium.
pointDensity- Sets the number of tie points (LOW, MEDIUM, or HIGH), to be created.
LOW point density will create the fewest number of tie points.
MEDIUM point density will create a moderate number of tie points.
HIGH point density will create the highest number of tie points.
pointDistribution- Randomly generates points that are better for overlapping areas with irregular shapes.
RANDOM- will generate points that are better for overlapping areas with irregular shapes.
REGULAR- will generate points based on a fixed pattern and uses the point density to determine how frequently to create points.
Example:
{ “pointSimilarity”:”MEDIUM”, “pointDensity”: “MEDIUM”, “pointDistribution”: “RANDOM” }
gis
Optional
GIS. the GIS on which this tool runs. If not specified, the active GIS is used.- Returns:
The imagery layer url
- compute_sensor_model(mode: str = 'Quick', location_accuracy: str = 'High', context: dict[str, Any] | None = None, *, gis: GIS | None = None, future: bool = False, **kwargs)
compute_sensor_model computes the bundle block adjustment for the image collection and applies the frame xform to the images. It will also generate the control point table, solution table, solution points table and flight path table. These tables will not be published as Portal items.
Parameter
Description
mode
Optional string. the mode to be used for bundle block adjustment Only the following modes are supported:
‘Quick’ : Computes tie points and adjustment at 8x of the source imagery resolution
‘Full’ : adjust the images in Quick mode then at 1x of the source imagery resolution
‘Refine’ : adjust the image at 1x of the source imagery resolution
By default, ‘Quick’ mode is applied to compute the sensor model.
location_accuracy
Optional string. this option allows users to specify the GPS location accuracy level of the source image. It determines how far the underline tool will search for neighboring matching images, then calculate tie points and compute adjustments.
Possible values for location_accuracy are:
‘VeryHigh’: Imagery was collected with a high-accuracy, differential GPS, such as RTK or PPK. This option will hold image locations fixed during block adjustment
‘High’ : GPS accuracy is 0 to 10 meters, and the tool uses a maximum of 4 by 3 images
‘Medium’ : GPS accuracy of 10 to 20 meters, and the tool uses a maximum of 4 by 6 images
‘Low’ : GPS accuracy of 20 to 50 meters, and the tool uses a maximum of 4 by 12 images
‘VeryLow’ : GPS accuracy is more than 50 meters, and the tool uses a maximum of 4 by 20 images
The default location_accuracy is ‘High’
context
Optional dictionary. The context parameter is used to configure additional client settings for block adjustment. The supported configurable parameters are for compute mosaic dataset candidates after the adjustment.
Example:
{ “computeCandidate”: False, “maxoverlap”: 0.6, “maxloss”: 0.05, }
gis
Optional
GIS. The GIS on which this tool runs. If not specified, the active GIS is used.- Returns:
The imagery layer url
- delete()
The
deletemethod deletes the Mission and all the associated products.- Returns:
A boolean indicating whether the deletion was successful or not
- delete_image(where: str, context: dict | None = None, *, gis: GIS | None = None, future: bool = False, estimate: bool | None = False, **kwargs)
delete_imageallows users to remove existing images from the image collection (mosaic dataset) of a mission.Parameter
Description
where
Required string. A SQL
whereclause for selecting the images to be deleted from the image collection- Returns:
The imagery layer url
- edit_control_points(control_points: list[dict[str, Any]], *, gis: GIS | None = None, future: bool = False, **kwargs)
This service can be used to append additional ground control point sets to the image collection’s control points. It is recommended that a ground control point (GCP) set should contain one ground control point and multiple tie points. The service tool can also be used to edit tie point sets. The input control points dictionary will always replace the points in the tie points table if the point IDs already exist.
Parameter
Description
control_points
Required, a list of control point sets objects.
The schema of control points follows the schema of the mosaic dataset control point table.
The control point object should contain the point geometry, pointID, type, status and the imagePoints. (the imagePoints attribute inside the control points object lists the imageIDs)
– pointID (int) - The ID of the point within the control point table.
– type (int) - The type of the control point as determined by its numeric value
1: Tie Point 2: Ground Control Point. 3: Check Point
– status (int) - The status of the point. A value of 0 indicates that the point will not be used in computation. A non-zero value indicates otherwise.
– imageID (int) - Image identification using the ObjectID from the mosaic dataset footprint table.
Example:
[{“status”: 1,“type”: 2,“x”: -117.0926538,“y”: 34.00704253,“z”: 634.2175,“spatialReference”: {“wkid”: 4326}, // default WGS84“imagePointSpatialReference”: {}, // default ICS“pointId”: 1,“xyAccuracy”: “0.008602325”,“zAccuracy”: “0.015”,“imagePoints”: [{“imageID”: 1,“x”: 2986.5435987557084,“y”: -2042.5193648409431,“u”: 3057.4580682832734,“v”: -1909.1506872159698},{“imageID”: 2,“x”: 1838.2814361401108,“y”: -2594.5280063817972,“u”: 3059.4079724863363,“v”: -2961.292545463305},{“imageID”: 12,“x”: 5332.855578204663,“y”: -2533.2805429751907,“u”: 614.2338676573158,“v”: -165.10836768947297},{“imageID”: 13,“x”: 4932.0895715254455,“y”: -1833.8401744114287,“u”: 616.9396928182223,“v”: -1243.1445126959693}]},……]gis
Optional
GIS. The GIS on which this tool runs. If not specified, the active GIS is used.- Returns:
The Imagery layer url
- generate_orthomosaic(out_ortho=None, regen_seamlines: bool = True, recompute_color_correction: bool = True, context: dict[str, Any] | None = None, *, gis: GIS | None = None, future: bool = False, **kwargs)
Function can be used for generating single ortho-rectified mosaicked image from image collection after the block adjustment.
Parameter
Description
out_ortho
Required String or dict. This is the ortho-mosaicked image converted from the image collection after the block adjustment. It can be a url, uri, portal item, or string representing the name of output dem (either existing or to be created.) If passed as a dict, the following keys can be set: - service_name: The name for the output ortho-mosaicked image service. - portal_name: The name for the portal item for this image service. If this product has already been created, the tool will overwrite it instead. Like Raster Analysis services, the service can be an existing multi-tenant service URL.
regen_seamlines
Optional, boolean. Choose whether to apply seamlines before the orthomosaic image generation or not. The seamlines will always be regenerated if this parameter is set to True. The user can set the seamline options through the context parameter. If the seamline generation options are not set, the default will be used.
Default value is True
recompute_color_correction
Optional, boolean. Choose whether to apply color correction settings to the output ortho-image or not. Color correction will always be recomputed if this option is set to True. The user can configure the compute color correction settings through the context parameter. If there is no color collection setting, the default will be used.
Default value is True
context
Optional dictionary. Context contains additional environment settings that affect output image. The supported environment settings for this tool are:
- Output Spatial Reference (outSR)-the output features will
be projected into the output spatial reference.
Extent (extent) - extent that would clip or expand the output image
Cell Size (cellSize) - The output raster will have the resolution specified by cell size.
Compute Seamlines (seamlinesMethod) - Default.
- Clipping Geometry (clippingGeometry) - Clips the orthomosaic image to an area of
interest defined by the geometry.
Orthomosaic As Overview (orthoMosaicAsOvr) - Adds the orthomosaic as an overview of the image collection.
Compute Color Correction (colorcorrectionMethod) — Default.
Example:
{“outSR”: {“wkid”: 3516},“extent”: {“xmin”: 470614.263139,“ymin”: 8872849.409968,“xmax”: 532307.351827,“ymax”: 8920205.372412,“spatialReference”: {“wkid”: 32628}},“clippingGeometry”: {},“orthoMosaicAsOvr”: False,“seamlinesMethod”: “VORONOI”,“minRegionSize”: 100,“pixelSize”: “”,“blendType”: “Both”,“blendWidth”: None,“blendUnit”: “Pixels”,“requestSize”: 1000,“minThinnessRatio”: 0.05,“maxSliverSize”: 20“colorCorrectionMethod”: “DODGING”,“dodgingSurface”: “Single_Color”,“referenceImg”: {“url”: “https://...”},“skipRows”: 10,“skipCols”: 10,“reCalculateSats”: “OVERWRITE”}gis
Optional
GIS. The GIS on which this tool runs. If not specified, the active GIS is used.- Returns:
The Orthomosaicked Imagery layer item
- generate_report(report_format: str = 'PDF', *, gis: GIS | None = None, future: bool = False, **kwargs)
This function is used to generate realitymapping report with image collection that has been block adjusted. The report would contain information about the quality of the adjusted images, the distribution of the control points, etc. The output of this service tool is a downloadable html page.
Parameter
Description
report_format
Type of the format to be generated. Possible PDF, HTML. Default - PDF
gis
Optional
GIS. The GIS on which this tool runs. If not specified, the active GIS is used.- Returns:
The URL of a single html webpage that is a formatted realitymapping report
- get_processing_states(*, gis: GIS | None = None, future: bool = False, **kwargs)
Retrieve the processing states of the image collection
Parameter
Description
gis
Optional
GIS. The GIS on which this tool runs. If not specified, the active GIS is used.- Returns:
The result will be the current states dictionary
- property image_collection
The
image_collectionproperty returns the image collection associated with the mission.- Returns:
image collection item.
- property image_count
The
image_countproperty returns the number of images in the mission.- Returns:
An integer representing the number of images.
- match_control_points(control_points: list[dict[str, Any]], similarity: str = 'High', context: dict[str, Any] | None = None, *, gis: GIS | None = None, future: bool = False, **kwargs)
The match_control_points is a function that takes a collection of ground control points as input (control points to be specified as a list of dictionary objects), and each of the ground control points needs at least one matching tie point in the control point sets. The function will compute the remaining matching tie points for all control point sets.
Parameter
Description
control_points
Required, a list of control point sets objects.
The schema of control points follows the schema of the mosaic dataset control point table.
The control point object should contain the point geometry, pointID, type, status and the imagePoints. (the imagePoints attribute inside the control points object lists the imageIDs)
– pointID (int) - The ID of the point within the control point table.
– type (int) - The type of the control point as determined by its numeric value
1: Tie Point 2: Ground Control Point. 3: Check Point
– status (int) - The status of the point. A value of 0 indicates that the point will not be used in computation. A non-zero value indicates otherwise.
– imageID (int) - Image identification using the ObjectID from the mosaic dataset footprint table.
Example:
[{“status”: 1,“type”: 2,“x”: -117.0926538,“y”: 34.00704253,“z”: 634.2175,“spatialReference”: {“wkid”: 4326}, // default WGS84“imagePointSpatialReference”: {}, // default ICS“pointId”: 1,“xyAccuracy”: “0.008602325”,“zAccuracy”: “0.015”,“imagePoints”: [{“imageID”: 1,“x”: 2986.5435987557084,“y”: -2042.5193648409431,“u”: 3057.4580682832734,“v”: -1909.1506872159698},{“imageID”: 2,“x”: 1838.2814361401108,“y”: -2594.5280063817972,“u”: 3059.4079724863363,“v”: -2961.292545463305},{“imageID”: 12,“x”: 5332.855578204663,“y”: -2533.2805429751907,“u”: 614.2338676573158,“v”: -165.10836768947297},{“imageID”: 13,“x”: 4932.0895715254455,“y”: -1833.8401744114287,“u”: 616.9396928182223,“v”: -1243.1445126959693}]},……]similarity
Optional string. Choose the tolerance level for your control point matching.
Low - The similarity tolerance for finding control points will be low. This option will produce the most control points, but some may have a higher level of error.
Medium - The similarity tolerance for finding control points will be medium.
High - The similarity tolerance for finding control points will be high.
This option will produce the least number of control points, but each matching pair will have a lower level of error. This is the default.
context
Optional dictionary.Additional settings such as the input control points spatial reference can be specified here.
Example:
{“groundControlPointsSpatialReference”: {“wkid”: 3459}, “imagePointSpatialReference”: {“wkid”: 3459}}
Note: The ground control points spatial reference and image point spatial reference spatial reference set in the context parameter is to decide the returned point set’s ground control points spatial reference and image point spatial reference. If these two parameters are not set here, the tool will use the spatial reference defined in the input point set. And if no spatial reference is defined in the point set, then the default ground control points coordinates are in lon/lat and image points coordinates are in image coordinate system.
gis
Optional
GIS. The GIS on which this tool runs. If not specified, the active GIS is used.- Returns:
A list of dictionary objects
- property mission_date
The
mission_dateproperty returns the creation date & time of the mission.- Returns:
A datetime object representing the mission date & time.
- property mission_id
The
mission_idproperty returns the ID of the mission.- Returns:
A string representing the mission ID.
- property products
The
productsproperty returns all the products associated with the mission.- Returns:
A list of products of the mission.
- query_camera_info(*, gis: GIS | None = None, future: bool = False, **kwargs)
This service tool is used to query specific or the entire digital camera database. The digital camera database contains the specs of digital camera sensors that were used to capture drone images.
Parameter
Description
camera_query
Required String. This is a SQL query statement that can be used to filter a portion of the digital camera database. Digital camera database can be queried using the fields Make, Model, Focallength, Columns, Rows, PixelSize.
Example:
“Make=’Rollei’ and Model=’RCP-8325’”
gis
Optional
GIS. The GIS on which this tool runs. If not specified, the active GIS is used.- Returns:
Data Frame representing the camera database
- query_control_points(query: str, *, gis: GIS | None = None, future: bool = False, **kwargs)
Query for control points in an image collection. It allows users to query among certain control point sets that has ground control points inside.
Parameter
Description
query
Required string. a SQL statement used for querying the point
Example:
“pointID > 100”
gis
Optional
GIS. The GIS on which this tool runs. If not specified, the active GIS is used.- Returns:
A dictionary object
- query_exif_info(*, gis: GIS | None = None, future: bool = False, **kwargs)
The query_exif_info reads the Exif header metadata from single or multiple images in shared data store. The Exif metadata is usually stored in drone image files. Some common Exif metadata information are GPS locations, camera model, focal length, and more.
Parameter
Description
input_images
Required String/list of Strings. The input images could be a single image path, list of image paths, or a folder path, or a list of folder paths. The image file paths can also be server data store path.
Eg:
“servernamedroneimagefolderimage_file.jpg”
“/cloudStores/S3DataStore/yvwd13”
“/fileShares/drones/SampleEXIF/YUN_0040.jpg”
[“/fileShares/drones/SampleEXIF/DJI_0002.JPG”, “/fileShares/drones/SampleEXIF/YUN_0040.jpg”]
[“/cloudStores/S3DataStore/yvwd13”, “/cloudStores/S3DataStore/BogotaFarm”]
gis
Optional
GIS. The GIS on which this tool runs. If not specified, the active GIS is used.- Returns:
A dictionary object
- reconstruct_surface(scenario: str | None = 'DRONE', forward_overlap: int | None = None, sideward_overlap: int | None = None, quality: str | None = 'ULTRA', area_of_interest: str | FeatureLayer | None = 'AUTO', waterbody_features: FeatureLayer | None = None, correction_feature: FeatureLayer | None = None, reconstruct_options: str | None = None, output_dsm_name: str | None = None, output_true_ortho_name: str | None = None, output_dsm_mesh_name: str | None = None, output_point_cloud_name: str | None = None, output_mesh_name: str | None = None, output_dtm_name: str | None = None, context: dict[str, Any] | None = None, *, gis: GIS | None = None, future: bool = False, **kwargs)
The reconstruct_surface generates a digital surface model (DSM), true orthos, 2.5D meshes, 3D meshes, and point clouds from adjusted imagery.
Parameter
Description
scenario
Optional String. Specifies the type of imagery that will be used to generate the output products.
DRONE: The input imagery will be defined as having been acquired with drones or terrestrial cameras.
AERIAL_NADIR: The input imagery will be defined as having been acquired with large, photogrammetric camera systems.
AERIAL_OBLIQUE: The input imagery will be defined as having been acquired with oblique camera systems.
SATELLITE: The input imagery will be defined as having been acquired with a satellite.
forward_overlap
Optional Integer. The forward (in-strip) overlap percentage that will be used between the images. The default is 60. This parameter is enabled when the scenario parameter is set to AERIAL_NADIR.
sideward_overlap
Optional Integer. The sideward (cross-strip) overlap percentage that will be used between the images. The default is 30. This parameter is enabled when the scenario parameter is set to AERIAL_NADIR.
quality
Optional String. Specifies the quality of the final product.
ULTRA - Input images will be used at their original (full) resolution.
HIGH - Input images will be downsampled two times.
area_of_interest
Optional
FeatureLayeror String. The area of interest that will be used to select images for processing. The area of interest can be computed automatically or defined using an input feature. If the value contains 3D geometries, the z-component will be ignored. If the value includes overlapping features, the union of these features will be computed.NONE - All images will be used in processing.
AUTO - The processing extent will be calculated automatically. This is the default.
waterbody_features
Optional
FeatureLayer. A polygon that will define the extent of large water bodies. For the best results, use a 3D feature.correction_features
Optional
FeatureLayer. A polygon that will define the extent of all surfaces that are not water bodies. The value must be a 3D feature.reconstruction_options
Optional dict or shared data path (this path must be accessible by the server). This specifies the values for the tool parameters. If this parameter is specified, the properties of the file or dictionary will set the default values for the remaining optional parameters. The list of keywords and an example of this JSON can be found here: Reconstruct Surface tool
output_dsm_name
Optional String. You can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. If this product has already been created, the tool will overwrite it instead.
A RuntimeError is raised if a service by that name already exists.
output_true_ortho_name
Optional String. You can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. If this product has already been created, the tool will overwrite it instead.
A RuntimeError is raised if a service by that name already exists.
output_dsm_mesh_name
Optional String. You can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. If this product has already been created, the tool will overwrite it instead.
A RuntimeError is raised if a service by that name already exists.
output_point_cloud_name
Optional String. You can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. If this product has already been created, the tool will overwrite it instead.
A RuntimeError is raised if a service by that name already exists.
output_mesh_name
Optional String. You can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. If this product has already been created, the tool will overwrite it instead.
A RuntimeError is raised if a service by that name already exists.
output_dtm_name
Optional String. You can pass in the name of the output Image Service that should be created by this method to be used as the output for the tool. If this product has already been created, the tool will overwrite it instead.
A RuntimeError is raised if a service by that name already exists.
context
Context contains additional settings that affect task execution.
context parameter overwrites values set through arcgis.env parameter
This function has the following settings:
Extent (extent): A bounding box that defines the analysis area.
Example:
{“extent”: {“xmin”: -122.68,“ymin”: 45.53,“xmax”: -122.45,“ymax”: 45.6,“spatialReference”: {“wkid”: 4326}}}Cell Size (cellSize): The output raster will have the resolution
specified by cell size.
Example:
{‘cellSize’: 11} or {‘cellSize’: {‘url’: <image_service_url>}} or {‘cellSize’: ‘MaxOfIn’}
Parallel Processing Factor (parallelProcessingFactor): controls
Raster Processing (CPU) service instances.
Example:
Syntax example with a specified number of processing instances:
{“parallelProcessingFactor”: “2”}
Syntax example with a specified percentage of total processing instances:
{“parallelProcessingFactor”: “60%”}
Output DSM product settings: controls
the environment variables for creating the DSM product.
Example:
Syntax example with a specified number of processing instances:
{key: {“outputType”: “Tiled”, “compression”: “JPEG 75”, “resamplingMethod”: “NEAREST”, “cellSize”: 10, “noData”: 0}}
Output True Ortho product settings: controls
the environment variables for creating the DSM product.
Example:
Syntax example with a specified number of processing instances:
{“true_ortho”: {“outputType”: “Mosaic”, “compression”: “JPEG 75”, “resamplingMethod”: “NEAREST”, “cellSize”: 10, “noData”: 0}}
gis
Optional, the GIS on which this tool runs. If not specified, the active GIS is used.
future
Optional boolean. If True, the result will be a GPJob object and results will be returned asynchronously.
- Returns:
Named Tuple
- reset_image_collection(*, gis: GIS | None = None, future: bool = False, **kwargs)
Reset the image collection. It is used to reset the image collection to its original state. The image collection could be adjusted during the orthomapping workflow and if the user is not satisfied with the result, they will be able to clear any existing adjustment settings and revert the images back to un-adjusted state
Parameter
Description
gis
Optional
GIS. The GIS on which this tool runs. If not specified, the active GIS is used.- Returns:
A boolean indicating whether the reset was successful or not
SensorType
ScenarioType
Default settings
Satellite scenario:
{'rasterType': 'Satellite',
'adjustSettings': {'maxResidual': 5.0,
'maskPolygons': '',
'pointDensity': 'MEDIUM',
'adjustTiePoints': False,
'pointSimilarity': 'MEDIUM',
'locationAccuracy': 'MEDIUM',
'generateTiePoints': True,
'pointDistribution': 'RANDOM',
'transformationType': 'RPC'},
'processingSettings': {'dsm': {'dsm': {'format': 'TIFF',
'outputType': 'TILED',
'resampling': 'BILINEAR',
'compression': 'NONE',
'noDataValue': 'NaN',
'lERCMaxError': 0.0,
'pyramidSettings': 'PYRAMIDS -1 BILINEAR DEFAULT 75 NO_SKIP',
'compressionQuality': 75},
'interpolation': {}},
'dtm': {'dtm': {'mask': '',
'extent': '',
'format': 'CRF',
'fillDEM': '',
'cellsize': 'NaN',
'lowNoise': 0.25,
'highNoise': 100.0,
'compression': 'NONE',
'reuseGround': False,
'lERCMaxError': 0.0,
'reuseLowNoise': False,
'cellsizeFactor': 5,
'reuseHighNoise': False,
'pyramidSettings': 'PYRAMIDS -1 BILINEAR DEFAULT 75 NO_SKIP',
'smoothingMethod': 'GAUSS5x5',
'classifyLowNoise': True,
'classifyHighNoise': True,
'useCellsizeFactor': True,
'compressionQuality': 75,
'interpolationMethod': 'IDW',
'groundDetectionMethod': 'Standard'},
'interpolation': {'method': 'IDW'}},
'ortho': {},
'3dMesh': {'format': 'SLPK', 'textureFormat': 'JPG & DDS'},
'dsmMesh': {'format': 'SLPK', 'textureFormat': 'JPG & DDS'},
'Trueortho': {'format': 'TIFF',
'outputType': 'TILED',
'resampling': 'BILINEAR',
'compression': 'NONE',
'noDataValue': 'NaN',
'lERCMaxError': 0.0,
'pyramidSettings': 'PYRAMIDS -1 BILINEAR DEFAULT 75 NO_SKIP',
'compressionQuality': 75},
'generalReconSettings': {'quality': 'ULTRA',
'cellsize': 'NaN',
'autoCellsize': True,
'cellsizeFactor': 1,
'useCellsizeFactor': True},
'advancedReconSettings': {'productBoundary': '',
'processingFolder': '',
'waterbodyFeatures': '',
'correctionFeatures': '',
'exportMapWithStereoModelCountOfFinalPoint': False,
'exportDistanceMapToNextNonInterpolatedPixels': False,
'exportBinaryMaskImageForNonInterpolatedPixels': False}}}
Drone scenario:
{'rasterType': 'UAV/UAS',
'adjustSettings': {'k': True,
'p': True,
'estimateOPK': False,
'focalLength': True,
'maxResidual': 5.0,
'maskPolygons': '',
'principalPoint': True,
'rollingShutter': False,
'adjustTiePoints': False,
'locationAccuracy': 'HIGH',
'cameraCalibration': True,
'processAsRigCamera': False,
'transformationType': 'Frame',
'initPointResolution': 8,
'computeImagePosteriorStd': True,
'computeSolutionPointPosteriorStd': False,
'fixImageLocationForHighAccuracyGPS': False},
'processingSettings': {'dsm': {'dsm': {'format': 'TIFF',
'outputType': 'TILED',
'resampling': 'BILINEAR',
'compression': 'NONE',
'noDataValue': 'NaN',
'lERCMaxError': 0.0,
'pyramidSettings': 'PYRAMIDS -1 BILINEAR DEFAULT 75 NO_SKIP',
'compressionQuality': 75},
'interpolation': {}},
'dtm': {'dtm': {'mask': '',
'extent': '',
'format': 'CRF',
'fillDEM': '',
'cellsize': 'NaN',
'lowNoise': 0.25,
'highNoise': 100.0,
'compression': 'NONE',
'reuseGround': False,
'lERCMaxError': 0.0,
'reuseLowNoise': False,
'cellsizeFactor': 5,
'reuseHighNoise': False,
'pyramidSettings': 'PYRAMIDS -1 BILINEAR DEFAULT 75 NO_SKIP',
'smoothingMethod': 'GAUSS5x5',
'classifyLowNoise': True,
'classifyHighNoise': True,
'useCellsizeFactor': True,
'compressionQuality': 75,
'interpolationMethod': 'IDW',
'groundDetectionMethod': 'Standard'},
'interpolation': {'method': 'IDW'}},
'ortho': {},
'3dMesh': {'format': 'SLPK', 'textureFormat': 'JPG & DDS'},
'dsmMesh': {'format': 'SLPK', 'textureFormat': 'JPG & DDS'},
'Trueortho': {'format': 'TIFF',
'outputType': 'TILED',
'resampling': 'BILINEAR',
'compression': 'NONE',
'noDataValue': 'NaN',
'lERCMaxError': 0.0,
'pyramidSettings': 'PYRAMIDS -1 BILINEAR DEFAULT 75 NO_SKIP',
'compressionQuality': 75},
'generalReconSettings': {'quality': 'HIGH',
'cellsize': 'NaN',
'autoCellsize': True,
'cellsizeFactor': 1,
'useCellsizeFactor': True},
'advancedReconSettings': {'productBoundary': '',
'processingFolder': '',
'waterbodyFeatures': '',
'correctionFeatures': '',
'exportMapWithStereoModelCountOfFinalPoint': False,
'exportDistanceMapToNextNonInterpolatedPixels': False,
'exportBinaryMaskImageForNonInterpolatedPixels': False}}}