Block Model Functions: CalculateVolumeReport

The BlockModelFunctions knowledge package generates a report of a volume calculation in a CSV file. The CalculateVolumeReport function enables the computation of a volume between evolving terrains or between a terrain and a nominated surface.

This page discusses:

Signature

CalculateVolumeReport(iJsonParameters : String, oErrorCode : Integer) : String

Arguments

Name Input/Output Required? Type Comment
iJsonParameters In String For more information, see list of parameters specific to iJsonParameters in the table.
oErrorCode Out Integer For more information, see Diagnosing Computation Incidents.

The table below describes the parameters specific to iJsonParameters.

Keyword Description Required? Comment
FolderPath A directory path where to store results. Use preferably slash ‘/’ for the json parser. Otherwise double backslash ‘\\’.
FileName A CATUnicodeString used to name the CSV file containing the results.
PLMIdSurfaceSeries

List of PLM identifiers corresponding to the point cloud terrains or polyhedral surfaces to use for the Volume Calculation operation. For example, with a terrain and a surface:

Couple composed of the terrain Identifier 1 and the timestamp.
Identifier of the Polyhedral geometry.
Note: You can list as many terrains and surfaces as required.

For example:

["PLMIdGeomTerrain1","TimeStampGeomTerrain1"]
["PLMIdGeomCATPoly2"]

Leave timestamp blank for latest version, otherwise use the UTC time: yyyy-mm-dd hh:mm:ss.
A minimum of two surfaces is required.

PLMIdBlockModel An STPM (short-term production modeling) block model that is a feature of type OutOfCorePointCloud: VPMPointCloudRepReference entered as Block Model. If specified, it returns the volume between two terrains, two surfaces, or terrain and surface and constrained within the block model. A more detailed report (csv format file) relative to the block model is returned. For more information, see Additional Details.
PLMIdGradeBlockouts A List of PLMId objects. These closed surfaces can represent any solid for which you want to create a volume report.

"PLMId of GradeBlockout 1"

"PLMId of GradeBlockout 2"

"PLMId of GradeBlockout n"

Note: If specified, the calculations are constrained inside the blockouts.
Attributes:{…} Outer parameter group indicator for Select and GroupBy parameters.
  • Select Lets you select block model attributes to include in the report.
  • GroupBy Lets you group and summarize the results by specified block model attributes.
Note: The parameter list must contain Select or GroupBy or both. For example:
  • "Attributes": { "Select": [ "attrib1", "attrib2", "attrib3"…]} or
  • "Attributes": {"GroupBy": [ "attrib1", “attrib2”]} or
  • "Attributes": { "Select": ["attrib1", "attrib3" ], "GroupBy": [ "attrib3", “attrib4”]}
Attributes can only be used when PLMIdBlockModel is present.
Note: Attribute names must match those present in the block model.
  • if GroupBy is specified, then Select must be of type [float or double] and magnitude must be [mass, density, volume, or dimensionless].

  • If GroupBy is specified, then only total volumes are shown for each group. Must be an attribute name present in the block model.
ZoneOfInterest

The bounding area to consider expressed in: "BoundingArea":["MinX","MinY","MaxX","MaxY"]

  • The bounding area to consider expressed in: "BoundingArea":["MinX","MinY","MaxX","MaxY"]
  • PLMId of the product that contains the closed surface; that is, the volume used to limit the working area. It is expressed in "PLMIdLimitingGeometry":["PLMIdGeom"]

Only the volume inside the specified volume is considered during volume calculation

Note: The parameter list must contain BoundingArea or PLMIdLimitingGeometry or both.

RasterSize The resolution of the grid used to divide each block model cell for the calculation, specified in m. If not specified, the default resolution is to divide each cell in the block model into a 10 x 10 grid.
MaximumRadius The maximum radius points can cover. When several points land in the same cell, an average height is assigned, for sparser areas, points have a maximum radius they can cover.
ReportOptions You can customize the volume calculation report using the following parameters, separately or combined: ["ShowFillVolume", "ShowInputData"]
  • ShowFillVolume: Both Cut volume and Fill volume are calculated and both values are store in the results file.
  • ShowInputData: The results file includes information related to the input data that were selected such as block model, terrains, and surfaces.

ReturnType

String

Additional Details

Earth engineers must regularly update the shape of the terrain. They scan the surface of the mine several times each day to get a track of the production evolution. From those terrain scans, they can extract information such as:

  • The volume representing the evolution of the production between two terrains at two different dates (expressed by the timestamp value)
  • The volume representing the extraction already done on a specific area containing an interesting concentration of ore (grade blockout)

The automated volume calculation lets you identify any partial block with a volume delimited by a solid (polyhedral surface) and between two terrains. For each block identified, a partial volume is calculated which can be used further, for example to generate detailed reports for reserving or during mine design.

Diagnosing Computation Incidents

During the BlockModelFunctions execution, a return code can be raised to help you understand computation incidents. The table below lists the possible return code numbers that can be raised and provides a detailed description of each incident.

Return Code Number Description
0 Calculation successful.
1 Invalid JSON format for input parameters
2 Output folder does not exist.
3 No write access to output folder.
4 Output CSV file already exists.
5 Invalid input terrain specification (expected ID1, timestamp1 [, ID2, timestamp2]).
6 One or more terrains does not exist.
7 One or more blockouts does not exist.
8 Invalid blockout geometry.
9 Block model does not exist
10 Block model does not contain cell size info.
11 Could not retrieve terrain versions.
12 Could not find a terrain version for the specified date.
13 Could not attach repository. Repository may be locked.
14 Could not specify terrain version.
15 Surface does not exist.
16 Invalid surface geometry.
17 A top terrain is required.
18 A bottom terrain or surface is required.
19 Zone of interest requires four numeric values.
20 Non-numeric value in zone of interest.
21 Zone of Interest maximum must be greater than minimum.
22 Invalid numeric value for Raster size.
23 Raster size must be > 0.
24 Invalid numeric value for maximum radius.
25 Maximum radius must be > 0.
26 Invalid numeric value for Gaussian mask size.
27 Gaussian mask size must be > 0.
28 Block model attribute not found.
29 Block model attribute type not supported.
30 Block model attribute magnitude not supported.
31 Parent for output surface does not exist.
32 Invalid report option
33 A surface in the surface series has the incorrect number of entries. 2 entries for terrains, 1 for polygonal surfaces.
34 No volume calculation method specified. One of surface series, domain definition, or surface plus terrain needs to be defined.
35 More than one Volume Calculation specified. Only one of Surface Series, Domain Definition, or Surface plus Terrain should be defined.
36 Invalid Boolean for Domain Definition.
40 Unexpected Key in JSON.
41 Error when trying to calculate vertex count or triangle count for input file metadata.
42 Error when trying to calculate volume from polyhedral for input file metadata.
43 Error when trying to calculate surface area from enclosed polyhedral for input file metadata.
45 One polyhedral has unexpected closure.
48 Failure in tentative to retrieve the limits of Block Model - Limits box is empty.
100 Unable to calculate volume.
101 CSV output error.

Typical Example of a JSON Structure

{
	"FolderPath":"\\MyComputer\\MyFolder",
	"FileName":"MyFileName",
	"PLMIdBlockModel":"PLMIdMyBlockModel",
	"PLMIdSurfaceSeries":
	[
		["PLMIdGeomTerrain1","TimeStampGeomTerrain1"],
		["PLMIdGeomCatPoly2"],
		...
		["PLMIdGeomN"]
	],
	"ZoneOfInterest"
	{
		"BoundingArea" : [ "MinX", "MinY", "MaxX", "MaxY" ],
		"PLMIdLimitingGeometry" : [ "PLMIdGeom" ]
	},
	"PLMIdGradeBlockouts":
	[
		"PLMIdGradeBlockout-1",
		"PLMIdGradeBlockout-2",
		"PLMIdGradeBlockout-n"
	],
	"Attributes":
	{
		"Select": ["attrib1","attrib2"],
		"GroupBy": ["attrib3"]
	},
	"RasterSize":"RasterValue",
	"MaximumRadius":"RadiusValue",
	"ReportOptions":["ShowFillVolume", "ShowInputData"]
}

The string used as input parameter is specified as a continuous string of characters, in a single line:

{"FolderPath":"\\MyComputer\\MyFolder","FileName":"MyFileName","PLMIdBlockModel":"PLMIdOfMyBlockModel","PLMIdSurfaceSeries":"[["PLMIdGeomTerrain-1","TimeStampGeomTerrain-1"],["PLMIdGeomCATPoly-2"],...,["PLMIdGeomTerrain-n",""]]","PLMIdGradeBlockouts":["PLMIdGradeBlockout-1","PLMIdGradeBlockout-2",...,"PLMIdGradeBlockout-n"],"ReportOptions":["ShowFillVolume", "ShowInputData"]}