Satshot-API
[ class tree: Satshot-API ] [ index: Satshot-API ] [ all elements ]

Class: mapcenter_api

Source Location: /mapcenter_api.php

Class Overview

core_api
   |
   --mapcenter_api

Provides services for precision agriculture "Mapcenter" systems.


Methods


Child classes:

clu_mapcenter_api
Provides services for attributed CLUs.

Inherited Methods

Class: core_api

core_api::change_image_zone_color()
Changes the color of one or more zones in analysis or edited image IMAGEHANDLE to given RGB values. COLORZONES is a struct keyed to zone numbers, each of which must be in range 1 .. (number of zones), and with values being RGB structs, as follows:
core_api::classify_multiband_analyses()
Classifies the multiband analyses in MBCLASSOPTS, returning single-band classified analyses. MBCLASSOPTS is a struct keyed to the image handle of the multiband analyses; the image handles passed in as the keys of this top level struct must correspond to multiband analysis images, and not to raw images, classified analyses, or edited images.
core_api::clear_displayed_scene()
Removes scene display layer from the map MAPCONTEXT. It is only necessary to call this method when the user desires to display no scene at all; to change which scene is displayed, it is sufficient to call display_scene() with a new sceneid argument.
core_api::clear_hilites()
Removes all hilited shapes from the user's hilite layers.
core_api::create_hilite_objects_from_wkt()
Creates new hilited objects from the object specification structs in OBJECTS. OBJECTS is a struct keyed to the object names, with values being OGC Well-Known Text geometries. The WKT geometries may be of the following types: POINT, LINESTRING or MULTILINESTRING, or POLYGON or MULTIPOLYGON.
core_api::create_image_display_layer()
Creates a display layer for the image IMAGEHANDLE on the map MAPCONTEXT. IMAGEHANDLE must correspond to an image in the user's temporary files; it is not the ID of a permanently stored image.
core_api::create_multibands_from_extracted_image_set()
Creates multiband-type analysis datasets for each of the raw extracted images in struct HILITEIMAGES. HILITEIMAGES is a struct keyed to the hiliteid of each hilited object to analyze, with values being the corresponding raw image handles, as returned by extract_image_set_around_hilited_shapes().
core_api::create_multiple_image_display_layers()
As create_image_display_layer(), but creates layers for all the image handles in array IMGLIST. TITLES is an optional struct keyed to the image handles in IMGLIST, with values being the alternative "display" name to save for each layer. Titles can be set for all, some, or none of the handles. Similarly, HILITES is an optional struct keyed to the image handles, values being the hilite IDs for each handle's hilite boundary. This information can also be set for all, some, or no handles.
core_api::create_soilmap_vectors_for_boundaries()
Creates a soilmap vector for each hilited boundary whose hiliteid is in array HILITELIST. The hiliteids must identify a hilited boundary which corresponds to a permanent field.
core_api::display_scene()
Adds a display layer for the scene with index SCENEID to the map MAPCONTEXT. SCENEID must be an scene visible within the current extents. The display layer is named "displayimg".
core_api::display_scene_by_item_id()
As display_scene(), but for scenes whose SCENEID is a string identifier rather than an integer
core_api::dissolve_image_regions()
Dissolves regions of the analysis or edited image IMAGEHANDLE which are smaller than MINPIXELS in size into the nearest region larger than MINPIXELS.
core_api::dissolve_image_regions_for_multiple_images()
As dissolve_image_regions(), but performs the dissolve operation on all analyses or edited images in array IMAGEHANDLES.
core_api::download_multiple_saved_geotagged_photos()
As download_saved_geotagged_photo(), but returns a struct of multiple base64-encoded binary photos, keyed to the photo IDs listed in array PHOTOIDS. Values are the binary objects. The photos must be accessible to the user, either saved by the user or tied to objects the user can access.
core_api::download_saved_geotagged_photo()
Returns the base64-encoded binary file for the geotagged photo identified by PHOTOID. The photo must be accessible to the user, either saved by the user or tied to an object the user can access.
core_api::draw_map()
Draws the map given by MAPCONTEXT. Returns the drawn image in the given FORMAT. Available formats are PNG24, JPG, GIF, GTIFF.
core_api::draw_map_for_multiple_display_layers()
Draws the map given by MAPCONTEXT, iterating over each display layer (image or vector) named in LAYERLIST, and returning the images in a struct keyed to the layer name.
core_api::export_image_in_processed_format()
Returns the image IMAGEHANDLE (raw image only) in the format specified by FORMAT (defaults to GeoTIFF), after applying PROCESS to the raw image. The file will be named NAME, which is useful for multi-file formats where the names of the files inside the zip cannot otherwise be controlled. The image will be returned in the projection specified by COORDSYS, which defaults to latlong NAD83.
core_api::export_image_in_simple_format()
Returns the image IMAGEHANDLE (analysis, or edited image) in the format specified by FORMAT (defaults to GeoTIFF). The file will be named NAME, which is useful for multi-file formats where the names of the files inside the zip cannot otherwise be controlled. The image will be returned in the projection specified by COORDSYS, which defaults to latlong NAD83. If COORDSYS is set to an empty string, no reprojection will occur, and the image will be returned in its native projection (Universal Transverse Mercator, with appropriate zone for the location), unless FORMAT is set to "KMZ" (see below).
core_api::export_multiple_images_in_processed_format()
As export_image_in_processed_format(), but returns multiple images with handles specified in IMAGESTRUCT, in the format FORMAT, applying the process PROCESS, projected as specified by COORDSYS, with OPTIONS applied as appropriate.
core_api::extract_image_around_hilited_shape()
Extracts a portion of the scene SCENEID around the extents of the hilited shape given in HILITEID, plus a buffer area. The source scene SCENEID need not already be displayed on the map. HILITEID must be the ID of a hilited shape which corresponds to a permanent boundary, not the permanent boundary id.
core_api::extract_image_set_around_hilited_shapes()
As extract_image_around_hilited_shape(), but extracts an image for each hilited shape in array HILITELIST from scene SCENEID, and returns a struct keyed to the IDs of the hilited shapes, with values being the image handles of the extracted images.
core_api::georeference_extracted_image()
Adjusts the georeferencing of the extracted image IMAGEHANDLE, adding EASTINGCHANGE to the image's easting (longitudinal, x-axis) position, and NORTHINGCHANGE to the northing (latitudinal, y-axis) position. Positive EASTINGCHANGE moves the image to the east, while negative moves it west; similarly, positive NORTHINGCHANGE moves the image north, and negative moves it south.
core_api::georeference_extracted_image_set()
As georeference_extracted_image(), but applies the EASTINGCHANGE and NORTHINGCHANGE arguments to every extracted image in array IMAGELIST. IMAGELIST must be an array of image handles.
core_api::get_analysis_info()
core_api::get_available_colortables()
Returns a struct describing the available colortables for use in classifying analyses. The colortables can be chosen using the COLORTABLE parameter to analyze_extracted_image_set().
core_api::get_available_maps()
Returns a struct describing the available maps for loading. Struct keys are the abbreviations or short names of the regions (states, provinces, or countries) represented by the maps, values are description structs, defined as follows:
core_api::get_available_scenes()
Returns a struct of scene description structs, keyed to the scene index, within the current extents of MAPCONTEXT.
core_api::get_available_scenes_for_extent()
Returns a struct of scene description structs, keyed to the scene index, within the current extents of EXTENTS. EXTENTS is an extents struct (keys are minx, miny, maxx, maxy), with coordinates in the coordinate system COORDSYS. All four coordinate keys in EXTENTS must be set.
core_api::get_available_scenes_for_extent_and_date_range()
Returns a struct of scene description structs, keyed to the scene index, within the extents of EXTENTS, and with scene shooting dates between STARTDATE and ENDDATE, inclusively. EXTENTS is an extents struct (keys are minx, miny, maxx, maxy), with coordinates in the coordinate system COORDSYS. All four coordinate keys in EXTENTS must be set. STARTDATE cannot be equal to or after ENDDATE, or an error is signalled.
core_api::get_available_scenes_for_multiple_extents_and_date_range()
As get_available_scenes_for_extent_and_date_range(), but returns the scene description struct for scenes which intersect the list of extents structs in EXTENTSLIST, and with scene shooting dates between STARTDATE and ENDDATE, inclusively. All extents structs in EXTENTSLIST must be in the coordinate system COORDSYS.
core_api::get_available_scene_years()
Returns an array of years in which the database has scenes available, in reverse chronological order.
core_api::get_available_stac_scenes_for_extent_and_date_range()
Searches for scenes directly against the Element84 STAC API (Earth Search), rather than the legacy
core_api::get_displayed_scene()
Returns the sceneid of the currently displayed scene in the map MAPCONTEXT, or false if there is no scene currently displayed.
core_api::get_hilites()
Returns a structure containing currently hilited shapes. Struct keys are the GID of the hilite shapes; these are used for uniquely identifying the hilite shape, and do not correspond to permanently stored objects. The struct values are attribute structs describing each hilite shape.
core_api::get_hilite_extents()
Returns the extents of currently hilited shapes as an extents struct, or false if no hilites present.
core_api::get_hilite_ids_within_scene()
Returns an array of SHPIDs of currently hilited objects which lie within the scene SCENEID. Objects which are partially or completely outside of the scene will not be listed. If there are no hilited objects within the scene, or no hilited objects, returns false.
core_api::get_image_info()
core_api::get_map_centroid()
Returns the centroid of the current map extents in latlong. This is a struct with two fields, LAT and LONG.
core_api::get_map_info()
Returns basic info about the given map context MAPCONTEXT as a struct. MAPCONTEXT may be a string naming a single map context, or an array of map context strings.
core_api::get_map_layers()
Returns a list of the available layers for the map context MAPCONTEXT. Layers are given in order of drawing (lower layers first).
core_api::get_map_public_locations()
core_api::get_multiple_analyses_info()
core_api::get_multiple_images_info()
core_api::get_multiple_scenes_info()
As get_scene_info(), but returns info structs for each scene ID given in array SCENEIDS.
core_api::get_my_login_sessions()
Returns a struct describing the current user's logged in sessions. Struct keys are the session tokens (as returned by login()), with values being session structs as follows:
core_api::get_rasters_info()
Returns a struct keyed to each analyzed image or edited image in IMAGEHANDLES, with values being raster description structs for the given images.
core_api::get_scene_info()
Returns info struct about the scene identified by SCENEID. If no such scene exists, returns FALSE.
core_api::load_map()
Loads the map named THESTATE. Returns the map context.
core_api::load_maps()
As load_map(), but loads maps named in array STATELIST, and returns a struct of map contexts, keyed to the names from STATELIST. Names in STATELIST must be valid arguments to load_map().
core_api::login()
Logs in a user to the system. Establishes a session and sets the session cookie if the USERNAME and PASSWORD match the user database.
core_api::logout()
Logs out of the system. Cookies are destroyed and session is removed from database. Any map contexts and temporary files are also destroyed.
core_api::make_geometric_intersection_of_hilited_shapes()
Replaces the two hilited objects identified by FIRSTSHPID and SECONDSHPID with a single object consisting of the point set intersection of the two objects, with the name NAME.
core_api::make_geometric_symdifference_of_hilited_shapes()
Replaces the two hilited boundaries identified by FIRSTSHPID and SECONDSHPID with a single boundary consisting of the point set symmetric difference of the two boundaries, with the name NAME. The existing boundaries will be removed from the hilite layer.
core_api::make_geometric_union_of_hilited_shapes()
Replaces the hilited objects identified by hiliteids in array SHPLIST with a single, complex object consisting of the point set union of their geometries, with the name NAME. The existing objects will be removed from the hilite layer.
core_api::merge_analysis_zones()
Merges the classification of the zones MERGEZONES in analyzed image IMAGEHANDLE. The ranges of values in the raw image represented by the zones is combined into one zone.
core_api::move_layer()
Moves the layer LAYER of map MAPCONTEXT in the display list (order of drawing) by AMOUNT. If AMOUNT > 0, this moves the layer UP in the list. If AMOUNT < 0, the layer is moved DOWN in the list. AMOUNT = 0 is allowed, but silly. Layers are drawn in list order, so later layers will cover those drawn earlier; use this function to control which layers overlay each other.
core_api::paint_image_polygons_with_map_coordinates()
Alters the pixels of the analysis or edited image IMAGEHANDLE whose positions are within the polygonal region POLYLIST, to the color of zone ZONENUMBER, using MAPCONTEXT to paint the new points.
core_api::paint_image_polygons_with_pixel_points()
Alters the pixels of the analysis or edited image IMAGEHANDLE whose positions are within the polygonal region POLYLIST, to the color of zone ZONENUMBER, using MAPCONTEXT to paint the new points.
core_api::query_map_layer_at_map_coordinate()
Queries the layer identified by LAYER in map MAPCONTEXT, at the point defined by map coordinates XCORD and YCORD, and returns attribute information about any intersecting vectors at that point. XCORD and YCORD must be in latlong NAD83 (EPSG 4269) unless COORDSYS is specified. LAYER may be the index number or the name of the layer to query. LAYER must identify a vector layer; this function does not support querying raster layers.
core_api::query_map_layer_at_pixel_point()
Queries the layer identified by LAYER in map MAPCONTEXT, at the pixel coordinates XPOINT and YPOINT, and returns attribute information about any intersecting vectors at that point.
core_api::query_map_layer_with_layer_shapes()
Queries the layer identified by TARGETLAYER in map MAPCONTEXT, using the shapes identified by integer IDs in array IDS, which are contained in the layer SOURCELAYER. For each shape from SOURCELAYER in IDS, attribute information for the intersecting shapes from TARGETLAYER will be returned. SOURCELAYER and TARGETLAYER may be the index numbers or the names of the layers. They must identify vector layers; this function does not support querying raster layers.
core_api::query_multiple_map_layers_at_map_coordinate()
As query_map_layer_at_map_coordinate(), but queries each of the layers given in array LAYERLIST; all other arguments are as for query_map_layer_at_map_coordinate().
core_api::query_multiple_map_layers_at_pixel_point()
As query_map_layer_at_pixel_point(), but queries each of the layers given in array LAYERLIST; all other arguments are as for query_map_layer_at_pixel_point().
core_api::remove_hilited_shape()
Removes the hilited shape identified by HILITEID from its hilite layer.
core_api::remove_hilited_shapes()
As remove_hilited_shape(), but removes multiple hilites identified by HILITEIDs in array HILITEIDLIST. Useful when the user wants to remove several, but not all, hilites.
core_api::remove_image_display_layer()
Removes the display layer for image IMAGEHANDLE from display on map MAPCONTEXT.
core_api::remove_multiple_image_display_layers()
As remove_image_display_layer(), but removes display layers for all image handles in array IMGLIST.
core_api::rename_hilited_shape()
Changes the name of the hilited shape identified by GID to NEWNAME. This is primarily useful for preparing boundaries to be saved as fields.
core_api::rename_hilited_shapes()
As rename_hilited_shape(), but renames multiple hilites identified in HILITESTRUCT. HILITESTRUCT is a struct keyed to the GID of the hilited shapes, with values being the new names to assign.
core_api::search_pls_locations()
Queries the PLS layer LAYER for townships or sections matching the criteria in struct CRITERIA, returning results found.
core_api::select_by_extents()
Selects (hilites) the objects in LAYERNAME within current extents of the map MAPCONTEXT. LAYERNAME must be one of "boundaries" (the default), "locations", "paths", "clu", or "attribclu". Selecting on the "attribclu" layer requires the "use_attribclus" privilege.
core_api::select_by_pixel_point()
Selects (hilites) the boundaries in LAYERNAME of the map MAPCONTEXT which intersect the pixel point (XPOINT,YPOINT). XPOINT and YPOINT are pixel coordinates, with XPOINT in range 0 .. map width, YPOINT in range 0 .. map height. Coordinate 0,0 is top left corner of the map. LAYERNAME must be one of "boundaries" (the default), "locations", "paths", "clu", or "attribclu". Selecting on the "attribclu" layer requires the "use_attribclus" privilege.
core_api::select_by_point()
Selects (hilites) the objects in LAYERNAME of the map MAPCONTEXT which intersect the point (XCORD,YCORD). Point coordinates should be in latlong unless COORDSYS is set.
core_api::set_map_extents()
Sets the extents of the map given by MAPCONTEXT to MINX, MINY, MAXX, MAXY. Extents should be in latlong unless COORDSYS is given. BUFFER is additional padding (in meters) around the extents, to ensure everything is in view. Set to 0 for no buffering.
core_api::set_map_projection()
Sets the projection and coordinate system of map MAPCONTEXT to projection NEWPROJ.
core_api::set_map_size()
Sets the size of the map (size of the output image) given by MAPCONTEXT to WIDTH x HEIGHT, in pixels.
core_api::shift_analysis_zone_endpoints()
Changes the classification of the analysis IMAGEHANDLE, changing the maximum point of SHIFTZONE by SHIFTAMOUNT. SHIFTZONE must be in the range (1 .. number of zones - 1), i.e., the final zone's max point cannot be shifted.
core_api::toggle_map_layer()
Toggles the status of the map layer (on or off) identified by LAYER (the layer name or index) in the given map context. If the layer was off, it is turned on, and vice versa. A layer whose status is OFF is not drawn when draw_map() is called, but may still be drawn using WMS.
core_api::toggle_multiple_map_layers()
As toggle_map_layer(), but toggles each of the map layers identified by the layer names or layerid numbers in LAYERS.
core_api::upload_geotagged_photo()
Uploads the geotagged photo IMAGEFILE to the database, storing it with the description DESCRIPTION. The OPTIONS struct, if provided, can set three optional parameters:
core_api::upload_objects_to_hilites()
Uploads the geometries of vector file VECFILE, in the specified format FORMAT, into the hilite layer. NAMECOLUMN specifies which attribute column to use to name each object; if not specified, the boundaries will be given default names (Unnamed1, Unnamed2, Unnamed3, etc). Point coordinates should be in latlong/NAD83 unless COORDSYS is set. COORDSYS is ignored for GeoJSON, GML and KML files, which must be in latlong.
core_api::zoom_map_at_map_coordinate()
Recenters the map MAPCONTEXT around the point represented by map coordinates XCORD and YCORD. XCORD and YCORD must be in latlong NAD83 (EPSG 4269) unless COORDSYS is specified.
core_api::zoom_map_at_pixel_point()
Recenters the map MAPCONTEXT around the point represented by pixel coordinates XPOINT and YPOINT. Coordinate 0,0 is top left corner of the map.
core_api::zoom_map_to_map_coordinate_with_radius()
Sets the map extents to those of the bounding box around map coordinate XCORD,YCORD, with a buffer of RADIUS meters. XCORD and YCORD must be in latlong NAD83 (EPSG 4269) unless COORDSYS is specified. RADIUS must be a positive integer.
core_api::zoom_map_to_pixel_rectangle()
Sets the map extents to those bounded by the box described by pixel coordinates PIXMINX, PIXMINY, PIXMAXX, PIXMAXY. Cordinate (0,0) is the top left corner of the map. The bounding box size cannot be zero in either dimension (i.e., PIXMINX must not equal PIXMAXX, PIXMINY must not equal PIXMAXY).

Class Details

[line 31]
Provides services for precision agriculture "Mapcenter" systems.




[ Top ]


Class Methods


static method add_attributes_to_vector [line 6190]

static boolean add_attributes_to_vector( string $vechandle, array $attriblist)

Adds new attributes to the attribute table for vector VECHANDLE, based on the array ATTRIBLIST. The values of this array are attribute specifier structs, defined as follows:

  • name: Name of the new attribute column. Letters, numbers, and underscores allowed, first character must be a letter. No other characters allowed. Uppercase letters will be changed to lowercase.
  • type: Data type of the attribute. May be 'number' (numeric, three decimal places) or 'string' (string of any length).

It is an error if a new attribute's name is the name of an existing column. Additionally, the names "gid", "zone", "zone_color", "zone_area", "poly_area", and "the_geom" are reserved.

It is an error if the vector is saved and belongs to an object in use by more than one session.

If any errors are signalled, no attributes will be added.

Returns true.

If the vector is saved, use of this method requires the "modify_datasets" privilege, and "modify" access to the object to which the vector is saved.




Tags:

exception:  VECTOR_NOT_FOUND Vector handle does not exist.
exception:  ACCESS_DENIED Vector belongs to object not accessible to user, or user does not have "modify" access to object.
exception:  BAD_TABLE_PARAMS Attribute list empty, or invalid name, or invalid type, or named attribute already in table.
exception:  CONCURRENCY_VIOLATION Vector belongs to object currently in use by more than one session.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "modify_datasets" privilege and method called on a saved dataset.
access:  public


Parameters:

string   $vechandle   Vector handle.
array   $attriblist   List of attribute specifier structs.

[ Top ]

static method analyze_extracted_image_set [line 3863]

static struct|boolean analyze_extracted_image_set( string $mapcontext, struct $shpimages, string $type, string $mode, integer $numzones, [integer $colortable = 1], [struct $options = array()])



Tags:

deprecated:  

This is a legacy method, which will continue to work, but new code should consider using create_multibands_from_extracted_image_set() and classify_multiband_analyses().

Analyzes the raw extracted images in SHPIMAGES struct, using the analysis TYPE, slicing mode MODE, and number of zones NUMZONES. MAPCONTEXT is not actually required, and can be an empty string, but remains in the interface for legacy reasons.

Returns a struct keyed to the shpids of each object, with values being the imagehandles of the analyzed images.

SHPIMAGES struct is keyed to the hiliteid of each hilited object to analyze, with value of the corresponding raw image handle, as returned from extract_image_around_hilited_shape().

Analysis types are as follows: NIR is straight Near Infrared analysis, NDVIR is Normalized Difference Vegetation Index (NDVI) using the red band, NDVIG is NDVI using green band, REDEDGE (Rapideye only) is a straight classification of the "red-edge" band, NDVIREDEDGE (RapidEye only) is NDVI using the "red-edge" band, and MULTIBAND is an unclassified (raw values, no zones) composite of the NIR, NDVIR, NDVIG, and (for RapidEye) RedEdge and NDVI-RedEdge results from the raw images.

Slicing modes are "standard" to slice over the full histogram range of 0 - 255, "minmax" to slice over the range between the minimum and maximum histogram values in each individual image, and "minmaxgroup" to slice over the range between the minimum and maximum histogram values in all of the images given. (The minmaxgroup mode can result in "empty" zones in individual images, because it takes the min of the mins, and max of the maxes, of all of the images.) For one object and image, minmaxgroup is equivalent to minmax.

Additionally, the "custom" slicing mode allows clients to pass in customized intervals for slicing the analysis band data. This slicing data is passed in using the OPTIONS parameter, below. When MODE is set to "custom", the NUMZONES parameter is ignored, and the "zones" key in OPTIONS must be set. MODE cannot be set to "custom" for MULTIBAND analysis.

If COLORTABLE is set, uses the colortable identified by the given ID (as given by get_available_colortables()) to classify the analysis. COLORTABLE defaults to 1, which is the standard Satshot 31-color scaled colortable.

OPTIONS is an optional struct of additional parameters for analysis, which are only needed in special circumstances. The following keys are recognized:

  • zones: Array of zone intervals for custom slicing mode; this key is only referenced when MODE is set to "custom", otherwise it is ignored. The first interval will be applied to create the first zone, the second to the second zone, and so forth. Each element in the array is a struct consisting of at least two fields: "min" and "max", containing the minimum and maximum values the given zone will cover. The value ranges can either be floating point NDVI values (ranging from -1 to +1), for NDVI analysis types, or integer values for the given band, for NIR or REDEDGE. For best results, the zones should be ordered in the array in ascending value order, with the "max" of one zone being the "min" of the next, i.e., with no gaps between the value ranges of the zones. The band statistics for the input raw image from get_image_info() can be useful for calculating the proper zone intervals for NIR or REDEDGE. Optionally, a third field can be set in the zone struct for any given zone: "mask", a boolean value. If set to true, the given value range will not be classified, but will be skipped over, setting the pixels which match that value range to null values. Masked zones will not show up in the zone table, nor will they be counted for assignment of colors from either the colortable or custom colors in OPTIONS['colors']. It is an error if all zones are masked, or all but one zone: at least two non-masked zones are required for analysis.
  • colors: Array of zone color entries to assign to zones; if this is set, the COLORTABLE parameter is ignored. The first color will be applied to the first (non-masked) zone, the second to the second zone, and so on. Each element is an array of red, green, and blue values, in that order (RGB tuples). No two zone colors are allowed to be identical. If MODE is "custom", then the number of colors in this color array must equal the number of (non-masked) zones in OPTIONS['zones']; otherwise, the number of colors must be equal to NUMZONES. This option is ignored for MULTIBAND analysis.
  • buffer: The amount by which a non-boundary object will be buffered, in meters. This is valid for analyzing locations or paths, but is ignored for boundaries. If not provided, defaults to 100.

For MULTIBAND analysis, mode, numzones, and colortable are ignored. The bands are not classified, but are presented with their raw values (NIR and RedEdge values are rescaled to 8 bit).

NOTE: If this method is called with SHPIMAGES containing hilite => raw mappings which represent an object and scene for which a MULTIBAND analysis is already saved, and TYPE is set to "MULTIBAND", the returned handle for that hilite will be the handle of the reloaded saved MULTIBAND, not a newly-generated one.

Use of this method requires the "analyze" privilege.

exception:  HILITE_NOT_FOUND Given hilite for image handle does not exist.
exception:  IMAGEHANDLE_NOT_FOUND Given image handle does not exist.
exception:  BAD_ANALYSIS_PARAMS Type or mode not supported, or colortable not found, or number of zones out of range.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "analyze" privilege.
access:  public


Parameters:

string   $mapcontext   The map context. Legacy parameter, can be set to empty string.
struct   $shpimages   SHPID-raw image structure.
string   $type   Analysis type (one of 'NIR', 'NDVIR', 'NDVIG', 'REDEDGE', 'NDVIREDEDGE', 'MULTIBAND', 'NDMI' or 'NDWI').
string   $mode   Analysis mode (one of 'standard', 'minmax', 'minmaxgroup', 'custom').
integer   $numzones   Number of zones. Must be at least 2, and cannot exceed the number supported by the given colortable.
integer   $colortable   Colortable ID. Defaults to 1 (Satshot standard).
struct   $options   Struct of other options to pass in. Optional, except if 'custom' mode is used.

[ Top ]

static method approve_autoanalysis_jobs [line 10663]

static struct approve_autoanalysis_jobs( array $jobtokens, [struct $jobparams = array()])

Sets the jobs identified by the job tokens in array JOBTOKENS to "ready", so that they will be run by the automatic analyzer during its normal processing. The elements in

the JOBTOKENS array may be tokens, or arrays of tokens; in the latter case, the jobs grouped together in this sub-array will share a completion notification (as returned by get_notifications()). The JOBTOKENS array can contain a mixture of tokens and arrays of tokens without problems. Repeating a token in two different sub-arrays (or placing it in the main array and in one or more sub-arrays) will cause that job to become part of multiple completion notifications; this may or may not actually be intended.

JOBTOKENS must containe tokens that identify jobs visible to the current user. Otherwise, an error is signalled.

If a job in JOBTOKENS is not in the "wait" state, it will not be changed; instead, a duplicate of that job will be created, with the same parameters (modified by JOBPARAMS), and then set to status "ready", to be run normally.

JOBPARAMS is an optional struct of analysis parameters, as those passed to classify_multiband_analyses(). The struct is keyed to the job token, with values being parameter structs, as follows:

  • boundaryids: Array of IDs of permanent boundaries. Must be boundaries to which the current user has access, and must have been in the set of boundary IDs originally found to lie within the job's scene. These boundaries will be analyzed instead of the full set of boundaries, if this is set.
  • types: Array of analysis types, as for the TYPE parameter for classify_multiband_analyses(). Any combination of the allowed types is permitted; duplicates will be removed.
  • mode: One of "standard" or "minmax", as the MODE parameter for classify_multiband_analyses().
  • numzones: Number of zones, as the NUMZONES parameter for classify_multiband_analyses(). Must be at least 2, and cannot exceed the maximum for the given colortable (default colortable max is 31).
  • colortable: Index number for the color table to use, as the COLORTABLE parameter for classify_multiband_analyses().

If these parameters are set for a job, that job will be run with the given parameters, instead of the user's saved preferences (if any) or the system defaults. Setting parameters for a job is optional, and if a parameters struct is provided, the parameters themselves are optional; if a parameter is not set for a particular job, the system will use the user's saved preferences, or the system defaults, in that order. The only exception is if a job's colortable is set to one that supports fewer maximum zones than the saved preference or system default for numzones; in such a case, an error will be signalled. An error will also be signalled for invalid parameters.

Returns a struct keyed to the job token, with values being boundary cost structs: the key is the boundary id, value is the cost for that job with that boundary.

Use of this method requires the "autoanalysis" privilege.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION Job does not exist, or JOBTOKENS array is empty.
exception:  INSUFFICIENT_BALANCE Customer balance not sufficient to pay for analysis of objects with specialty scene.
exception:  BAD_ANALYSIS_PARAMS Type or mode not supported, or colortable not found, or number of zones out of range.
exception:  ACCESS_DENIED User does not have permission to access job.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "autoanalysis" privilege.
access:  public


Parameters:

array   $jobtokens   Job tokens.
struct   $jobparams   Analysis parameters to use for each job. Optional, defaults will be used for unset values.

[ Top ]

static method clear_autoanalysis_jobs [line 11104]

static boolean clear_autoanalysis_jobs( array $jobtokens)

Removes the autoanalysis jobs identified by the job tokens in array JOBTOKENS from the jobs list.

JOBTOKENS must contain tokens that identify jobs which are visible to the current user and whose current statuses are not 'running'. Otherwise, an error is signalled.

Removing a job in the 'wait' or 'ready' state will prevent that job from running. Removing a job in the 'complete' state will make the PDF(s) generated by that job unavailable.

Returns true.

Use of this method requires the "autoanalysis" privilege.




Tags:

exception:  INSUFFICIENT_PRIVILEGES User does not have the "autoanalysis" privilege.
exception:  PARAMETER_CONSTRAINT_VIOLATION Job state is 'running', or job does not exist, or JOBTOKEN array is empty.
exception:  ACCESS_DENIED User does not have permission to access job.
access:  public


Parameters:

array   $jobtokens   Job tokens.

[ Top ]

static method create_and_update_objects [line 2811]

static struct create_and_update_objects( struct $objects, [struct $options = array()])

Creates new permanent geospatial objects, and/or updates existing objects, based on the specification struct OBJECTS. This includes mapping the objects to specified regions, and setting appropriate access controls.

OBJECTS is a struct with the following structure. The outermost struct keys are object types (boundaries, locations, paths), with values being arrays of object description structs. Each object description struct accepts the following keys:

  • id: ID of an existing object to update. Object must be accessible to the current user. When this is set, other keys are optional; however, at least one key to update must be set. DO NOT SET when saving new objects.
  • name: Name of the object. Required if "id" is not set.
  • regionid: ID of region to assign to this object. Region must be accessible to the current user. Required if "id" is not set. If "id" is set, and this key is provided, the object's region will be changed if the new and old regionid differ.
  • geom: WKT geometry for the object. Required if "id" is not set. Must be a valid WKT geometry of type POINT, LINESTRING, MULTILINESTRING, POLYGON, or MULTIPOLYGON. Must be in latlong WGS84 (EPSG:4326) unless "coordsys" is set in OPTIONS.

OPTIONS is an optional struct with the following valid keys:

  • coordsys: Coordinate system (WKT or proj4) of the geometries in "geom" in the object description structs. Optional, but required if geometries are not in latlong, WGS84.

The return value is a struct, keyed to the object types passed in OBJECTS, with values being arrays of object IDs. In the case of new objects, these will be new IDs, while updated objects will have their existing IDs returned.

Note that this method operates atomically; any errors mean that no objects were created or updated.

Use of this method requires the "create_geoobjects" privilege to create new objects, and the "modify_geoobjects" privilege to update existing objects. In addition, updating objects will require "modify" access to the objects.




Tags:

exception:  ACCESS_DENIED ID given for region not accessible to user.
exception:  REQUESTED_ITEM_NOT_FOUND ID given for object that does not exist.
exception:  REQUESTED_ITEM_NOT_FOUND ID given for region that does not exist.
exception:  ACCESS_DENIED ID given for object not accessible to user.
exception:  INVALID_VECTOR Invalid WKT for geometry.
exception:  PARAMETER_CONSTRAINT_VIOLATION Invalid data in object description struct array.
exception:  PARAMETER_CONSTRAINT_VIOLATION Invalid object type in main struct.
exception:  PARAMETER_CONSTRAINT_VIOLATION Invalid key in object description struct.
exception:  INSUFFICIENT_PRIVILEGES User does not have privilege to create objects or modify objects.
exception:  PARAMETER_CONSTRAINT_VIOLATION Missing required key for object creation.
access:  public


Parameters:

struct   $objects   Objects struct.
struct   $options   Options struct. Optional.

[ Top ]

static method create_grid_vector_for_boundary [line 5609]

static string create_grid_vector_for_boundary( integer $boundaryid, integer $gridsize, [double $gridangle = 0], [double $xshift = 0], [double $yshift = 0])

Creates a new grid polygon vector dataset for the boundary object identified by BOUNDARYID. The boundary must be one to which the current user has access. The grid is composed of polygon rectangles, each approximately square with a side length of GRIDSIZE meters. Grid squares must be at least 20 meters on a side. The grid will be clipped to the boundary boundary, so polygons near the edge of an irregularly-shaped boundary will conform to the boundary boundary, and will not be square.

GRIDANGLE, if set, rotates the grid around the center of the boundary in either the clockwise (positive angle) or counterclockwise (negative angle) direction, to an angle ranging from +90 to -90 degrees. XSHIFT and YSHIFT, if set, shift the grid polygons' position by the given number of meters on the X (XSHIFT) and Y (YSHIFT) axes. Positive shift amounts shift to the east (XSHIFT) or north (YSHIFT), while negative numbers shift in the opposite directions.

This method does not currently support creating grid vectors for locations or paths.

Returns a vector handle for use in referring to the grid dataset.

Use of this method requires the "create_grid" privilege.




Tags:

exception:  ACCESS_DENIED Boundary not accessible to user.
exception:  PARAMETER_CONSTRAINT_VIOLATION Given angle outside of range.
access:  public


Parameters:

integer   $boundaryid   ID of field to create grid.
integer   $gridsize   Size of grid squares, in meters. Minimum 20.
double   $gridangle   Angle of rotation, in degrees. Maximum +90, minimum -90. Optional, defaults to 0.
double   $xshift   Meters to shift grid along the X axis. Optional, defaults to 0.
double   $yshift   Meters to shift grid along the Y axis. Optional, defaults to 0.

[ Top ]

static method create_group [line 890]

static integer create_group( string $name, string $description, [integer $parentid = null], [array $contactusers = null], [string $address = null], [string $city = null], [string $state_province = null], [string $zip_postcode = null], [string $country = null], [string $phone = null], [boolean $customer = false], [struct $privileges = array()], [struct $opts = array()])

Creates a new group and returns the new groupid. Use of this method requires the "create_groups" privilege.

Parameters for this method are as follows:

  • name: String. The name of the group. Required.
  • description: String. A textual description of what sort of business entity or organizational grouping this group represents. Required.
  • parentid: Integer. The ID of the group which is the direct parent of this one. For top-level groups, this is empty. Required except for administrators.
  • contactusers: Array of user IDs of users who are the primary contacts for this group. Usually group members, but not required to be.
  • address: Street or mailing address, if applicable. Customer groups should always have this, others may or may not.
  • city: City.
  • state_province: State or province.
  • zip_postcode: ZIP or postal code.
  • country: Country.
  • phone: Phone number.
  • customer: Boolean. True if this group represents an entity which is a customer of Agri ImaGIS, and thus has its own accout balance. May only be set by administrators or by users with the "set_group_customer" privilege.
  • privileges: Group privilege flags, as described in Privilege Flags.
  • opts: Options for group creation. Keys are as follows:
    • return_group: Boolean. If set true, this method will return the full group information for the newly created group, not just the groupid. Defaults to false.
    • plancode: String. Pricing plan of new group will be set to this plan code. Satshot admins only; ignored for other users.
    • plancomment: String. Comment on the pricing plan; only recognized if plancode is set. Satshot admins only; ignored for other users.




Tags:

exception:  INSUFFICIENT_PRIVILEGES Attempt to create group without "create_groups" privilege, or attempt to create top-level group by non-administrator, or attempt to create customer group without "set_group_customer" privilege.
exception:  DATABASE_ERROR Database reported an error.
exception:  REQUESTED_ITEM_NOT_FOUND Given parent group does not exist.
exception:  ACCESS_DENIED User does not have access to given parent group, or given users in CONTACTUSERS.
exception:  PARAMETER_CONSTRAINT_VIOLATION Invalid value for privilege flag.
access:  public


Parameters:

string   $name   Name of the group.
string   $description   Group description.
integer   $parentid   Parent group ID.
array   $contactusers   Array of user IDs for primary group contacts.
string   $address   Address.
string   $city   City.
string   $state_province   State or province.
string   $zip_postcode   Zip or postal code.
string   $country   Country.
string   $phone   Phone number.
boolean   $customer   Customer flag. Settable only by admins or users with "set_group_customer" privilege.
struct   $privileges   Privileges struct.
struct   $opts   Options for group creation.

[ Top ]

static method create_multibands_from_extracted_image_set [line 3586]

static struct create_multibands_from_extracted_image_set( struct $hiliteimages, [struct $options = array()])

Creates multiband-type analysis datasets for each of the raw extracted images in struct HILITEIMAGES. HILITEIMAGES is a struct keyed to the hiliteid of each hilited object to analyze, with values being the corresponding raw image handles, as returned by extract_image_set_around_hilited_shapes().

Multiband analyses are unclassified composites of the derived band values from the raw image. In order, each band in a multiband is as follows: NIR (scaled to 8-bit), NDVI-Red, NDVI-Green, and for RapidEye raw images, Red Edge (scaled to 8-bit), and NDVI-Red Edge. A multiband derived from a RapidEye raw image will thus have 5 bands, while one derived from a Landsat, ASTER, or other raw image will have 3 bands.

Multiband analyses may be saved, reloaded, and exported like any other analyses; furthermore, they may be used as input to classify_multiband_analyses(), generating classified analyses from the bands of the multiband.

OPTIONS is an optional struct of additional parameters for analysis, which are only needed in special circumstances. The following keys are recognized:

  • buffer: The amount by which a non-boundary object will be buffered, in meters. This is valid for analyzing locations or paths, but is ignored for boundaries. If not provided, defaults to 100.

Returns a struct keyed to the hiliteid, with values being the image handles of the generated multiband analyses.

Use of this method requires the "analyze" privilege.




Tags:

exception:  HILITE_NOT_FOUND Given hilite for image handle does not exist.
exception:  IMAGEHANDLE_NOT_FOUND Given image handle does not exist.
exception:  INSUFFICIENT_BALANCE User's customer group does not have sufficient balance to pay imagery charges for the multibands.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "analyze" privilege.
access:  public


Overrides core_api::create_multibands_from_extracted_image_set() (Creates multiband-type analysis datasets for each of the raw extracted images in struct HILITEIMAGES. HILITEIMAGES is a struct keyed to the hiliteid of each hilited object to analyze, with values being the corresponding raw image handles, as returned by extract_image_set_around_hilited_shapes().)

Parameters:

struct   $hiliteimages   Hilite-raw image mapping.
struct   $options   Struct of other options to pass in. Optional.

[ Top ]

static method create_multiple_point_vectors_from_images [line 5432]

static struct create_multiple_point_vectors_from_images( array $imagehandles)

As create_point_vector_from_image(), except creates a point vector for each image handle in array IMAGEHANDLES. Each point vector will be as described for create_point_vector_from_image().

Returns a struct keyed to the image handles, with values being the vector handles of the new vector spreadmaps.

Use of this method requires the "create_pointvector" privilege.




Tags:

exception:  INSUFFICIENT_PRIVILEGES User does not have the "create_pointvector" privilege.
exception:  IMAGEHANDLE_NOT_FOUND Image handle does not exist.
exception:  PARAMETER_CONSTRAINT_VIOLATION IMAGEHANDLES array cannot be empty.
access:  public


Parameters:

array   $imagehandles   Array of image handles

[ Top ]

static method create_multiple_vector_display_layers [line 5762]

static boolean create_multiple_vector_display_layers( string $mapcontext, array $veclist, [ $titles = array()], [ $hilites = array()])

As create_vector_display_layer(), but creates layers for all the vector handles in array VECLIST. TITLES is an optional struct keyed to the vector handles in IMGLIST, with values being the alternative "display" name to save for each layer. Titles can be set for all, some, or none of the handles. Similarly, HILITES is an optional struct keyed to the vector handles, values being the hilite IDs for each handle's hilite boundary. This information can also be set for all, some, or no handles.

Returns true if a layer was created for each vector handle, false otherwise (one or more of the vector handles already had a display layer).




Tags:

exception:  MAP_NOT_FOUND Map context does not exist.
exception:  VECTOR_NOT_FOUND Vector handle does not exist.
access:  public


Parameters:

string   $mapcontext   The map context.
array   $veclist   Array of vector handles.
   $titles  
   $hilites  

[ Top ]

static method create_multiple_vector_spreadmaps_from_images [line 5296]

static struct create_multiple_vector_spreadmaps_from_images( array $imagehandles)

As create_vector_spreadmap_from_image(), except creates a vector spreadmap for each image handle in array IMAGEHANDLES. Each vector spreadmap will be as described for create_vector_spreadmap_from_image().

Returns a struct keyed to the image handles, with values being the vector handles of the new vector spreadmaps.

Use of this method requires the "create_spreadmap" privilege.




Tags:

exception:  INSUFFICIENT_PRIVILEGES User does not have the "create_spreadmap" privilege.
exception:  IMAGEHANDLE_NOT_FOUND Image handle does not exist.
exception:  PARAMETER_CONSTRAINT_VIOLATION IMAGEHANDLES array cannot be empty.
access:  public


Parameters:

array   $imagehandles   Array of image handles

[ Top ]

static method create_point_vector_from_image [line 5352]

static string create_point_vector_from_image( string $imagehandle)

Creates a new point vector from image IMAGEHANDLE. IMAGEHANDLE must be an analysis or edited image. Multiband analyses are supported for this method.

The point vector is a vector dataset with points matching the pixels of the image. For edited images, or analyses other than multiband, each point also has two attributes: zone (the zone number) and zone_color (color tuple for this zone). Multiband analyses will instead have attributes corresponding to the bands in the analysis: NIR, NDVIR, and NDVIG will always be present, with RedEdge and NDVIRedEdge present for RapidEye multiband analyses. Further attributes can be added, set, or removed with add_attributes_to_vector(), set_attributes_for_vector(), and delete_attributes_from_vector(), respectively.

Note that the vector table is not permanent. Unless saved with save_vector_to_object(), it will not persist after the user logs out.

Returns a vector handle for use in referring to the point dataset.

Use of this method requires the "create_pointvector" privilege.




Tags:

exception:  IMAGEHANDLE_NOT_FOUND Image handle does not exist.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "create_pointvector" privilege.
access:  public


Parameters:

string   $imagehandle   The image handle.

[ Top ]

static method create_region [line 1923]

static integer create_region( string $name, [string $description = ''], [struct $objects = array()], [integer $groupid = null])

Creates a new region and optionally populates it with geospatial objects (boundaries, locations, or paths). The new region will be owned by the current user.

NAME identifies this region, while DESCRIPTION is intended as a more general description of the region's type or purpose. Both are freeform strings; NAME is required, while DESCRIPTION is optional.

The optional OBJECTS struct allows the new region to be populated with objects upon creation; if this is not done, the region will be empty, but can be populated later using update_region(). OBJECTS is a struct keyed to the object type; valid keys are "boundaries", "locations", or "paths". Values are arrays of object IDs for the objects of each type to add to this region. The objects must already be accessible to the current user.

GROUPID, if set, will assign the region to the given group. Otherwise, it will be assigned to the current user's group.

Returns the regionid of the new region.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION Empty strings passed in for NAME or DESCRIPTION, or invalid object type in OBJECTS.
exception:  ACCESS_DENIED Given group is not accessible to current user.
exception:  DATABASE_ERROR Database reported an error.
exception:  MULTIPLE_ERRORS_REPORTED Given objects in OBJECTS are not accessible to the current user.
access:  public


Parameters:

string   $name   Name of the new region.
string   $description   Description of the region.
struct   $objects   Optional struct of object types and IDs to add to this region.
integer   $groupid   Groupid to assign region. Optional.

[ Top ]

static method create_user [line 8150]

static integer|string create_user( integer $groupid, string $login, string $password, string $state, string $email, [string $firstname = ''], [string $lastname = ''], [string $address = ''], [string $address2 = ''], [string $city = ''], [string $zip = ''], [string $phone = ''], [string $fax = ''], [struct $privileges = array()], [struct $options = array()], [boolean $createdisabled = false], [boolean $override = false], [ $returnuser = false])

Creates a new user, and returns the UID of that user. Use of this method requires the "create_users" privilege.

GROUPID must be the ID of the user's group or a subgroup. LOGIN must consist of only letters, numbers, and underscores; further, it must be unique, and an error is signalled if the login name already exists. PASSWORD must be set, and must be at least 8 characters. EMAIL must be set and a valid email address. STATE must be the full name of a state or province, not an abbreviation, and it must correspond to an available map.

The new user will, by default, have privilege flags set according to the group privileges, as documented in Privilege Flags. The PRIVILEGES struct can be used to override the defaults for the new user's privilege flags when the group flags are set to ALLOW: the keys are the names of the privilege flags, values are boolean true or false to set or clear the flag, respectively. An error is signalled if a flag set to group GRANT is set to false, or a flag set to group DENY is set to true. New users also cannot have privileges that the current user does not have.

The OPTIONS struct optionally allows setting the new user's presets for autoanalysis jobs, or client preferences, using the keys "presets" or "client_preferences", respectively. The value for the "presets" key must be a struct with keys and values as described for the "presets" key in the struct returned by get_my_user_info(). This struct will be checked for validity; invalid keys or values will signal an error. The value for the "client_preferences" key must be a struct keyed to the client name, with values being structs of preference keys and values, as described for the "client_preferences" key in the struct returned by get_my_user_info(). This struct will NOT be checked for validity.

If CREATEDISABLED is set to true, the new user account will be disabled. This prevents the new user from logging in until the account is enabled via update_user_info(). This is useful for setting up accounts which are enabled after external confirmation.

OVERRIDE is a flag used for administrators only; it is ignored when this method is called by a normal user.

If RETURNUSER is set to true, this method will return the full info for the newly created user, not just the id. The data will be returned as a JSON string.

Charges may be incurred for user creation.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION Login name invalid, or already exists, or password too short, or email invalid, or state not recognized.
exception:  INSUFFICIENT_PRIVILEGES Cannot create user, or attempt to set privileges violating group settings, or attempt to set privilege not possessed by current user.
exception:  ACCESS_DENIED Given group is not accessible to current user.
access:  public


Parameters:

integer   $groupid   Group ID for the new user.
string   $login   Login to use for this user.
string   $password   Password.
string   $state   State/province name.
string   $email   First name.
string   $firstname   Last name.
string   $lastname   Street address.
string   $address   Additional street address part.
string   $address2   City name.
string   $city   ZIP/postal code.
string   $zip   Email address.
string   $phone   Phone number.
string   $fax   Fax number.
struct   $privileges   Privilege flags. Optional, default is to set user privileges from the group flags.
struct   $options   Struct of options to set.
boolean   $createdisabled   Whether to create the user account as disabled. Optional, defaults to false.
boolean   $override   For administrative use only; ignored for non-administrative users.
   $returnuser  

[ Top ]

static method create_vector_display_layer [line 5689]

static boolean create_vector_display_layer( string $mapcontext, string $vechandle, [string $title = ''], [integer $hilite = null])

Creates a display layer for the vector VECHANDLE on the map MAPCONTEXT. VECHANDLE must correspond to a vector handle returned by a vector-creating function, or a function which returns handles for saved vector datasets, such as get_saved_datasets_for_objects(). The layer is created at the end of the layer display list, covering everything before it (its layer index is equal to the highest existing index + 1). This can be changed with move_layer().

If TITLE is set, this optional "alternative" name will be saved to the layer, and will show up in the layer info from get_map_layers(). This can be useful for saving a "display" name. If HILITE is set, this ID, which corresponds to the layer's boundary, will be saved to the layer and will show up in the layer info. This is useful for filtering purposes.

Returns true if the layer was created, false if not (layer already exists).




Tags:

exception:  MAP_NOT_FOUND Map context does not exist.
exception:  VECTOR_NOT_FOUND Vector handle does not exist.
access:  public


Parameters:

string   $mapcontext   The map context.
string   $vechandle   The vector handle.
string   $title   Title (alternative name) for this layer. Optional.
integer   $hilite   Hilite ID for this layer's boundary. Optional.

[ Top ]

static method create_vector_spreadmap_from_image [line 5194]

static string create_vector_spreadmap_from_image( string $imagehandle)

Creates a new vector spreadmap from image IMAGEHANDLE. IMAGEHANDLE must be an analysis or edited image, and must not be a multiband analysis. The spreadmap is a vector dataset with polygons matching the colored regions of the images. Each polygon also has four attributes: zone (the zone number), zone_color (color tuple for this zone), zone_area (acreage of the entire zone), and poly_area (acreage of the specific polygon). Further attributes can be added, set, or removed with add_attributes_to_vector(), set_attributes_for_vector(), and delete_attributes_from_vector(), respectively.

Note that the vector table is not permanent. Unless saved with save_vector_to_object(), it will not persist after the user logs out.

Returns a vector handle for use in referring to the spreadmap.

Use of this method requires the "create_spreadmap" privilege.




Tags:

exception:  IMAGEHANDLE_NOT_FOUND Image handle does not exist.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "create_spreadmap" privilege.
access:  public


Parameters:

string   $imagehandle   The image handle.

[ Top ]

static method delete_attributes_from_vector [line 6436]

static boolean delete_attributes_from_vector( string $vechandle, array $attriblist)

Removes the attribute columns whose names are in the array ATTRIBLIST from the vector table VECHANDLE. ATTRIBLIST is an array of strings which specify the names of attributes to drop. Attribute names must follow the naming convention given for add_attributes_to_vector(): letters, numbers, and underscores allowed, first character must be a letter. Uppercase letters are shifted to lowercase.

It is an error if a column named in ATTRIBLIST does not exist in the vector table. Additionally, certain attribute names (depending on the type of the vector) are reserved, and may not be removed.

It is an error if the vector is saved and belongs to a field in use by more than one session.

If any errors are signalled, no attributes will be deleted.

If the vector is saved, use of this method requires the "modify_datasets" privilege, and "modify" access to the object to which the vector is saved.

Returns true.




Tags:

exception:  VECTOR_NOT_FOUND Vector handle does not exist.
exception:  ACCESS_DENIED Vector belongs to object not accessible to user, or user does not have "modify" access to object.
exception:  BAD_TABLE_PARAMS Attribute list empty, or invalid name, or attribute not in table, or attribute is reserved.
exception:  CONCURRENCY_VIOLATION Vector belongs to field currently in use by more than one session.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "modify_datasets" privilege and method called on a saved dataset.
access:  public


Parameters:

string   $vechandle   Vector handle.
array   $attriblist   List of attribute specifier structs.

[ Top ]

static method delete_objects [line 3277]

static boolean delete_objects( struct $objects)

Deletes the objects specified in OBJECTS, making them inaccessible to all users. OBJECTS is a struct keyed to the object type ("boundaries", "locations", or "paths"), with values being arrays of object IDs.

If any of the objects are currently selected by the current session, they will be removed from hilites.

Use of this method requires the "modify_geoobjects" privilege, and "modify" access to the objects specified. Additionally, the objects must not be in use (selected) by another session.

Returns true.




Tags:

exception:  ACCESS_DENIED Object not accessible to user, or user does not have "modify" access.
exception:  REQUESTED_ITEM_NOT_FOUND Given object does not exist.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "modify_geoobjects" privilege.
exception:  CONCURRENCY_VIOLATION One or more objects currently in use by more than one session.
access:  public


Parameters:

struct   $objects   Objects struct.

[ Top ]

static method delete_saved_datasets [line 5077]

static boolean delete_saved_datasets( array $datasetlist)

Deletes the saved datasets described in DATASETLIST, which is an array of structs describing each dataset. Struct fields are as follows:

  • type: Type of this dataset. Can be "analysis", "editedimage", or "vector". The "vector" type is used for all vector datasets.
  • id: The numeric ID (for analysis or editedimage) or vector handle (for vectors) of the dataset.

Each dataset so specified will be permanently removed from the database. This change will be reflected in the values returned by get_saved_datasets_for_objects().

It is an error if one of the given datasets does not exist, is associated with a fielddata event record, or belongs to an object not accessible to the user; it is also an error if one of the given datasets belongs to an object which is in use (hilited) in more than one login session. In any of these cases, none of the given datasets will be deleted.

Returns true if all datasets were deleted, otherwise signals an error.

Use of this method requires the "modify_datasets" privilege, and "modify" access to the objects to which the datasets are saved.




Tags:

exception:  GROWER_ACCESS_DENIED Dataset saved to object not accessible to user, or user does not have "modify" access.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "modify_datasets" privilege.
exception:  DATASET_NOT_FOUND Saved dataset does not exist.
exception:  PARAMETER_CONSTRAINT_VIOLATION Missing required parameter fields, or invalid dataset type, or dataset associated with a fielddata event.
exception:  CONCURRENCY_VIOLATION One or more datasets belong to objects currently in use by more than one session.
access:  public


Parameters:

array   $datasetlist   List of dataset structs.

[ Top ]

static method export_image_in_processed_format [line 14138]

static base64|string export_image_in_processed_format( string $imagehandle, string $name, [string $format = "GeoTIFF"], [string $process = "RESCALE"], [string $coordsys = "+init=EPSG:4269"], [struct $options = array()])

Returns the image IMAGEHANDLE (raw image only) in the format specified by FORMAT (defaults to GeoTIFF), after applying PROCESS to the raw image. The file will be named NAME, which is useful for multi-file formats where the names of the files inside the zip cannot otherwise be controlled. The image will be returned in the projection specified by COORDSYS, which defaults to latlong NAD83.

The image will be masked to only include the area contained within the field for which it was extracted, plus a small buffer around the field. The mask value will be the lowest value supported by the image's data type (0, for byte-based formats), or -2 for the floating point types (which are NDVI calculations).

Available formats are "GeoTIFF", "TIFF" ("TIFFW" with world file), "JPEG" ("JPEGW" with world file), "BMP" ("BMPW" with world file), "PNG" ("PNGW" with world file), "KMZ" (Google Earth KMZ file), "TXT" (Text point file), "shapefile" (ESRI point shapefile), "mapinfo" (MapInfo MIF/MID), "GML" (OGC GML), "KML" (Google Earth KML), "GeoJSON" (GeoJSON file), or "CSV" (comma-separated value). Other formats may become available in future.

Available processes are "RESCALE" (rescales the raw to an 8-bit range, returning all bands; only really meaningful for RapidEye images), "NDVIR" (does NDVI-Red calculation and returns single-band image), and "NDVIG" (as NDVIR, but does NDVI-Green calculation instead). Other processes may become available in future.

NOTE: "TXT" FORMAT cannot be combined with "RESCALE" PROCESS.

OPTIONS is a struct of optional parameters for various output formats, which are applied to the output image after the PROCESS, but before the image is returned. The options available vary by FORMAT, as follows:

  • type: Type of the output band. String. Can be one of "Byte", "UInt16", "Int16", "UInt32", "Int32", "Float32", "Float64". (Complex types are not meaningful for current processes.) Ignored for "RESCALE" process (that is always Byte type). Default for other processess is "Float32". Formats: GeoTIFF, TIFF, TIFFW, TXT. Other formats are always Byte type.
  • compression: Compression used. String. Can be one of "None", "Deflate", "LZW", "JPEG". JPEG should only be used with type "Byte". Formats: GeoTIFF, TIFF, TIFFW. Other formats either have their own compression, or (for TXT) are uncompressed.
  • scale: Scaling of the data to the new type. Array of two numbers, minimum and then maximum. Minimum must be < maximum, and both numbers must be in valid range for the given type. Note that the minimum value supported for a given type is the actual type minimum + 1, for instance, 1 for Byte, or -32767 for Int16. If type is set, and this is not, will default to the min-max range for the data type. Ignored for RESCALE process, which is always scaled 1-255. Formats: GeoTIFF, TIFF, TIFFW, TXT. Other formats automatically scale 0-255.
  • bands: Array of band numbers to use for the RGB values. Bands are numbered 1 through 5, and are in this order: NIR, Green, Red, Blue, Red-edge. Only used for "RESCALE", as the other processes are single-band. Formats: BMP, BMPW, JPEG, JPEGW, PNG, PNGW, KMZ.
  • url: Boolean. If set to true, then the processed image will be returned as a URL for download, instead of as a base64 binary. This URL will only remain valid for the duration of the session.

Note that the formats with world files are multi-file formats and are returned as a ZIP. (KMZ is itself a zip, but the KMZ file is treated as one entity by Google Earth.) Note also that the KMZ format is required to be in latlong NAD83, and thus the COORDSYS option will have no effect for that format.

Use of this method requires the "export_processed" privilege. Additionally, the RESCALE process requires the "export_processed_rescale" privilege.




Tags:

exception:  IMAGEHANDLE_NOT_FOUND Given image handle does not exist.
exception:  BAD_DATASET_TYPE Format not supported, or image is not a raw image.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "export_processed" privilege, or attempted to use RESCALE without "export_processed_rescale" privilege.
exception:  PARAMETER_CONSTRAINT_VIOLATION Unknown process, or coordinate system not recognized.
access:  public


Overrides core_api::export_image_in_processed_format() (Returns the image IMAGEHANDLE (raw image only) in the format specified by FORMAT (defaults to GeoTIFF), after applying PROCESS to the raw image. The file will be named NAME, which is useful for multi-file formats where the names of the files inside the zip cannot otherwise be controlled. The image will be returned in the projection specified by COORDSYS, which defaults to latlong NAD83.)

Parameters:

string   $imagehandle   Image handle.
string   $name   Name of the file.
string   $format   Format of the output (defaults to GeoTIFF).
string   $process   Process to apply to the raw image (defaults to RESCALE).
string   $coordsys   Coordinate system (WKT or proj4) of the output. Defaults to latlong NAD83.
struct   $options   Options struct. Optional.

[ Top ]

static method export_image_in_simple_format [line 7327]

static base64|string|struct|boolean export_image_in_simple_format( string $imagehandle, string $name, [string $format = "GeoTIFF"], [string $coordsys = "+init=EPSG:4269"], [boolean $url = false], [struct $struct = false], [ $emailopts = array()])

Returns the image IMAGEHANDLE (analysis, or edited image) in the format specified by FORMAT (defaults to GeoTIFF). The file will be named NAME, which is useful for multi-file formats where the names of the files inside the zip cannot otherwise be controlled. The image will be returned in the projection specified by COORDSYS, which defaults to latlong NAD83. If COORDSYS is set to an empty string, no reprojection will occur, and the image will be returned in its native projection (Universal Transverse Mercator, with appropriate zone for the location), unless FORMAT is set to "KMZ" (see below).

Available formats are "GeoTIFF", "TIFF" ("TIFFW" with world file), "JPEG" ("JPEGW" with world file), "BMP" ("BMPW" with world file), "PNG" ("PNGW" with world file), "KMZ" (Google Earth KMZ file), and "TXT" (Text point file). Other formats may become available in future.

Note that the formats with world files are multi-file formats and are returned as a ZIP. (KMZ is itself a zip, but the KMZ file is treated as one entity by Google Earth.) Note also that the KMZ format is required to be in latlong NAD83, and thus the COORDSYS option will have no effect for that format.

If URL is set to true, the image will be returned as a URL, instead of a base64-encoded binary. This URL will only remain valid for the duration of the active session.

If STRUCT is set to true, multi-file formats will be returned as a struct of individual base64-encoded binaries (or URLs, if URL is true), instead of as a zip file.

EMAILOPTS is an optional struct of parameters to send out emails containing a URL to the export, which does persist after the active session terminates. Valid keys are as follows:

  • emails: Array of email addresses for recipients of the export link. Mandatory; at least one email address must be provided.
  • comment: String, a comment to the recipients that will be placed in the body of the email message. Optional. Maximum length is 1024 characters (in UTF-8).

If EMAILOPTS['addresses'] is set, this method does not return the export data in any form, but returns boolean true if the emails were successfully constructed and sent. Errors will be signalled if the email addresses are not well-formed, or if no emails are provided. NOTE: Email links can only be sent for saved raster datasets. If the raster IMAGEHANDLE is not saved, an error will be signalled.




Tags:

exception:  INSUFFICIENT_BALANCE User's customer group does not have sufficient balance to pay export charges for the dataset.
exception:  IMAGEHANDLE_NOT_FOUND Given image handle does not exist.
exception:  BAD_DATASET_TYPE Format not supported.
access:  public


Overrides core_api::export_image_in_simple_format() (Returns the image IMAGEHANDLE (analysis, or edited image) in the format specified by FORMAT (defaults to GeoTIFF). The file will be named NAME, which is useful for multi-file formats where the names of the files inside the zip cannot otherwise be controlled. The image will be returned in the projection specified by COORDSYS, which defaults to latlong NAD83. If COORDSYS is set to an empty string, no reprojection will occur, and the image will be returned in its native projection (Universal Transverse Mercator, with appropriate zone for the location), unless FORMAT is set to "KMZ" (see below).)

Parameters:

string   $imagehandle   Image handle.
string   $name   Name of the file.
string   $format   Format of the output (defaults to GeoTIFF).
string   $coordsys   Coordinate system (WKT or proj4) of the output. Defaults to latlong NAD83.
boolean   $url   Return URL of export instead of binary file.
struct   $struct   Options for sending export URLs by email.
   $emailopts  

[ Top ]

static method export_multiple_images_in_processed_format [line 14267]

static struct|string export_multiple_images_in_processed_format( struct $imagestruct, [string $format = "GeoTIFF"], [string $process = "RESCALE"], [string $coordsys = "+init=EPSG:4269"], [struct $options = array()])

As export_image_in_processed_format(), but returns multiple images with handles specified in IMAGESTRUCT, in the format FORMAT, applying the process PROCESS, projected as specified by COORDSYS, with OPTIONS applied as appropriate.

Formats and processses available are the same as for export_image_in_processed_format(). IMAGESTRUCT is a struct keyed to the image handles, with values being the file names for the output files (as the NAME parameter to export_image_in_processed_format()).

There is one difference between the OPTIONS accepted by this method, and the OPTIONS accepted by export_image_in_processed_format(). The "url" option is not boolean, but a string with one of two values: "combined" or "separate". If set to "separate", the returned struct will contain a URL for each exported image; if set to "combined", the exported image files will be collected into a ZIP file, and the URL for that combined file will be returned.

Returns a struct keyed to the image handles, with values being the binary files (or URLs, if "url" is set to "separate" in OPTIONS), or a URL string for downloading the ZIP archive of all of the files, if "url" is set to "combined" in OPTIONS.

Use of this method requires the "export_processed" privilege. Additionally, the RESCALE process requires the "export_processed_rescale" privilege.




Tags:

exception:  INSUFFICIENT_PRIVILEGES User does not have the "export_processed" privilege, or attempted to use RESCALE without "export_processed_rescale" privilege.
exception:  IMAGEHANDLE_NOT_FOUND Given image handle does not exist.
exception:  BAD_DATASET_TYPE Format not supported.
access:  public


Overrides core_api::export_multiple_images_in_processed_format() (As export_image_in_processed_format(), but returns multiple images with handles specified in IMAGESTRUCT, in the format FORMAT, applying the process PROCESS, projected as specified by COORDSYS, with OPTIONS applied as appropriate.)

Parameters:

struct   $imagestruct   Image struct.
string   $format   Format of the output (defaults to GeoTIFF).
string   $process   Process to apply to the raw image (defaults to RESCALE).
string   $coordsys   Coordinate system (WKT or proj4) of the output. Defaults to latlong NAD83.
struct   $options   Options struct. Optional.

[ Top ]

static method export_multiple_images_in_simple_format [line 7433]

static struct|string|boolean export_multiple_images_in_simple_format( struct $imagestruct, [string $format = "GeoTIFF"], [string $coordsys = "+init=EPSG:4269"], [string $url = false], [boolean $struct = false], [struct $emailopts = array()])

As export_image_in_simple_format(), but returns multiple images with handles specified in IMAGESTRUCT, in the format FORMAT, projected as specified by COORDSYS.

Formats available are the same as for export_image_in_simple_format(). IMAGESTRUCT is a struct keyed to the image handles, with values being the file names for the output files (as the NAME parameter to export_image_in_simple_format()). COORDSYS is likewise handled as it is for export_image_in_simple_format().

Returns a struct keyed to the image handles, with values being the binary files, unless the optional parameter URL is set to one of two string values, "separate" or "combined". If set to "separate", the returned struct will have values being URLs linking to the individual binary files; if "combined", this method will combine all of the binary files into one ZIP archive and return a single URL linking to that archive file.

If STRUCT is set to true, this handling changes, as follows: for formats which are multi-file, or for the case where URL is set to "combined", zip files will be replaced with structs, keyed to the file name, with values being the binary files or the URLs, as appropriate for the URL parameter. These structs will be nested within the main output struct.

EMAILOPTS is handled as for export_image_in_simple_format(), except that each email sent out will contain multiple links, one for each image in IMAGESTRUCT. The return value of this method will be boolean true, as for export_image_in_simple_format(). Errors are also reported as for that method when EMAILOPTS is used.




Tags:

exception:  INSUFFICIENT_BALANCE User's customer group does not have sufficient balance to pay export charges for the datasets.
exception:  IMAGEHANDLE_NOT_FOUND Given image handle does not exist.
exception:  BAD_DATASET_TYPE Format not supported.
access:  public


Parameters:

struct   $imagestruct   Image struct.
string   $format   Format of the output (defaults to GeoTIFF).
string   $coordsys   Coordinate system (WKT or proj4) of the output. Defaults to latlong NAD83.
string   $url   Return URL of exports instead of binary files.
boolean   $struct   Return multi-file formats in a struct.
struct   $emailopts   Options for sending export URLs by email.

[ Top ]

static method export_multiple_vector_tables [line 7047]

static struct|string|boolean export_multiple_vector_tables( struct $vecs, [string $format = "shapefile"], [string $coordsys = '+init=EPSG:4269'], [string $url = false], [boolean $struct = false], [struct $emailopts = array()])

As export_vector_table(), but returns the attributes and geometries of each vector described in struct VECS. VECS is a struct keyed to the vector handles, as the VECHANDLE parameter to export_vector_table(), with values being the names as the NAME parameter to export_vector_table(). FORMAT and COORDSYS are as for export_vector_table(), and apply to all of the vectors in VECS.

Returns a struct keyed to the vector handle, with values being the base64 binaries as exported by export_vector_table(), unless the optional parameter URL is set to one of two string values, "separate" or "combined". If set to "separate", the returned struct will have values being URLs linking to the individual binary files; if "combined", this method will combine all of the binary files into one ZIP archive and return a single URL linking to that archive file.

If STRUCT is set to true, this handling changes, as follows: for formats which are multi-file, or for the case where URL is set to "combined", zip files will be replaced with structs, keyed to the file name, with values being the binary files or the URLs, as appropriate for the URL parameter. These structs will be nested within the main output struct.

EMAILOPTS is handled as for export_vector_table(), except that each email sent out will contain multiple links, one for each vector in VECS. The return value of this method will be boolean true, as for export_vector_table(). Errors are also reported as for that method when EMAILOPTS is used.

Use of this method requires the "export_vector" privilege.




Tags:

exception:  VECTOR_NOT_FOUND Vector handle does not exist.
exception:  BAD_TABLE_PARAMS Name cannot be empty.
exception:  SHAPEFILE_DUMP_FAILURE Export failed due to backend error.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "export_vector" privilege.
exception:  PARAMETER_CONSTRAINT_VIOLATION VECS cannot be empty.
exception:  INSUFFICIENT_BALANCE User's customer group does not have sufficient balance to pay export charges for the datasets.
access:  public


Parameters:

struct   $vecs   Vector handle/name structure.
string   $format   Format of the output file.
string   $coordsys   Coordinate system (WKT or proj4) of the output. Defaults to latlong NAD83.
string   $url   Return URL of exports instead of binary files.
boolean   $struct   Return multi-file formats in a struct.
struct   $emailopts   Options for sending export URLs by email.

[ Top ]

static method export_vector_table [line 6791]

static base64|string|boolean export_vector_table( string $vechandle, string $name, [string $format = "shapefile"], [string $coordsys = '+init=EPSG:4269'], [boolean $url = false], [boolean $struct = false], [struct $emailopts = array()])

Returns the attributes and geometries of the vector table VECHANDLE, in the format specified by FORMAT (defaults to ESRI Shapefile). The file will be given the name NAME, which is useful for multi-file formats where the names of the files inside the zip cannot otherwise be controlled.

The vector file will be projected in the coordinate system specified by COORDSYS, which defaults to latlong/NAD83, EPSG 4269. If COORDSYS is set to an empty string, the vector file will not be reprojected, but exported in its native projection (latlong/NAD83, EPSG 4269).

Available formats are "shapefile" (ESRI Shapefile), "mapinfo" (MapInfo MIF/MID), "GML" (OGC GML), "KML" (Google Earth KML), "GeoJSON" (GeoJSON file), or "CSV" (comma-separated value). The shapefile, mapinfo, and GML formats are multi-file, and are returned in a ZIP.

If URL is set to true, the vector will be returned as a URL, instead of a base64-encoded binary. This URL will only remain valid for the duration of the active session.

If STRUCT is set to true, multi-file formats will be returned as a struct of individual base64-encoded binaries (or URLs, if URL is true), instead of as a zip file.

EMAILOPTS is an optional struct of parameters to send out emails containing a URL to the export, which does persist after the active session terminates. Valid keys are as follows:

  • emails: Array of email addresses for recipients of the export link. Mandatory; at least one email address must be provided.
  • comment: String, a comment to the recipients that will be placed in the body of the email message. Optional. Maximum length is 1024 characters (in UTF-8).

If EMAILOPTS['addresses'] is set, this method does not return the export data in any form, but returns boolean true if the emails were successfully constructed and sent. Errors will be signalled if the email addresses are not well-formed, or if no emails are provided. NOTE: Email links can only be sent for saved vector datasets. If the vector table VECHANDLE is not saved, an error will be signalled.

Use of this method requires the "export_vector" privilege.




Tags:

exception:  VECTOR_NOT_FOUND Vector handle does not exist.
exception:  INSUFFICIENT_BALANCE User's customer group does not have sufficient balance to pay export charges for the dataset.
exception:  BAD_TABLE_PARAMS Name cannot be empty.
exception:  SHAPEFILE_DUMP_FAILURE Export failed due to backend error.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "export_vector" privilege.
access:  public


Parameters:

string   $vechandle   Vector handle.
string   $name   Name of the vector file.
string   $format   Format of the output file.
string   $coordsys   Coordinate system (WKT or proj4) of the output. Defaults to latlong NAD83.
boolean   $url   Return URL of export instead of binary file.
boolean   $struct   Return multi-file formats in a struct.
struct   $emailopts   Options for sending export URLs by email.

[ Top ]

static method extract_image_around_hilited_shape [line 3365]

static string extract_image_around_hilited_shape( string $mapcontext, string $sceneid, integer $hiliteid, [integer $buffer = 100])

Extracts a portion of the scene SCENEID around the extents of the hilited shape given in HILITEID, plus a buffer area. The source scene SCENEID need not already be displayed on the map. HILITEID must be the ID of a hilited shape which corresponds to a permanent boundary, not the permanent boundary id.

BUFFER, if provided, is the amount by which the shape is buffered in meters. BUFFER must be greater than zero, and defaults to 100.

The extracted raw image will be resampled to 5 meters per pixel, unless the source scene is already at that resolution or higher. IMPORTANT NOTE: The image is a temporary file, and will not persist between login sessions.

Use of this method requires the "analyze" privilege. To extract special imagery additionally requires the "specialimagery" privilege.

Returns the image handle for the extracted image.




Tags:

exception:  MAP_NOT_FOUND Map context does not exist.
exception:  HILITE_NOT_FOUND No shapes hilited or given hilite ID does not exist.
exception:  PARAMETER_CONSTRAINT_VIOLATION Buffer value of 0 or less passed.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "analyze" privilege, or user attempted to extract special imagery without "specialimagery" privilege.
exception:  REQUESTED_ITEM_NOT_FOUND Given boundary is not a field.
exception:  INSUFFICIENT_BALANCE Customer balance not sufficient to pay for analysis of object with specialty scene.
access:  public


Overrides core_api::extract_image_around_hilited_shape() (Extracts a portion of the scene SCENEID around the extents of the hilited shape given in HILITEID, plus a buffer area. The source scene SCENEID need not already be displayed on the map. HILITEID must be the ID of a hilited shape which corresponds to a permanent boundary, not the permanent boundary id.)

Parameters:

string   $mapcontext   The map context.
string   $sceneid   Image to extract.
integer   $hiliteid   HILITEID of hilite around which to extract.
integer   $buffer   Buffer size in meters. Defaults to 100.

[ Top ]

static method extract_image_set_around_hilited_shapes [line 3445]

static struct extract_image_set_around_hilited_shapes( string $mapcontext, string $sceneid, array $hilitelist, [integer $buffer = 100])

As extract_image_around_hilited_shape(), but extracts an image for each hilited shape in array HILITELIST from scene SCENEID, and returns a struct keyed to the IDs of the hilited shapes, with values being the image handles of the extracted images.

Use of this method requires the "analyze" privilege. To extract special imagery additionally requires the "specialimagery" privilege.




Tags:

exception:  MAP_NOT_FOUND Map context does not exist.
exception:  INSUFFICIENT_BALANCE Customer balance not sufficient to pay for analysis of objects with specialty scene.
exception:  HILITE_NOT_FOUND No shapes hilited or given hilite ID does not exist.
exception:  PARAMETER_CONSTRAINT_VIOLATION Buffer value of 0 or less passed.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "analyze" privilege.
access:  public


Overrides core_api::extract_image_set_around_hilited_shapes() (As extract_image_around_hilited_shape(), but extracts an image for each hilited shape in array HILITELIST from scene SCENEID, and returns a struct keyed to the IDs of the hilited shapes, with values being the image handles of the extracted images.)

Parameters:

string   $mapcontext   The map context.
string   $sceneid   Image to extract.
array   $hilitelist   List of HILITEIDs of hilites around which to extract.
integer   $buffer   Buffer size in meters. Defaults to 100.

[ Top ]

static method get_accessible_regions_and_objects [line 1257]

static struct|boolean get_accessible_regions_and_objects( [struct $criteria = array()], [struct $returns = array()])

Returns a struct containing the regions and geospatial objects to which the current user has access, or the regions and objects to which a given user or group has access. The outermost struct has two keys: "regions" and "objects". The value of "regions" is a struct keyed to the regionids of the regions, with values being region description structs, as follows:

  • name: Name of the region.
  • description: A textual description of what sort of area of interest this region represents, such as a farm, unit, sales region, etc.
  • creatorid: Uid of the user who created this region. May or may not be a user the current user can see.
  • createtime: Date and time this region was created (ISO-8601 format).
  • extents: Extent of the region's geospatial objects as an extents struct (latlong). Empty if the region contains no objects.
  • private: Boolean. True if the region is only visible to the creator and to users in parent groups; false if the region is visible to any user who has access to objects within that region.
  • groupid: ID of the group to which this region is assigned, if any; this is used for assigning default access controls for objects added to a region. Region visibility is controlled by object access controls, so it is entirely possible for a region to have a groupid that does not correspond to a group visible to the current user.
  • objects: Struct of objects within this region; keyed to the object type (boundaries, locations, or paths), with values being structs keyed to the object IDs, and having values of structs with three fields: "name", the object name, "centroid", the WKT of the object's center point, and "state", the state or province in which the object lies. Empty if the region contains no objects.

The value of "objects" is a struct keyed to the three object types (boundaries, locations, paths), with values being structs of objects. The structs of objects are keyed to the object IDs, with values being object description structs, as follows:

  • name: Name of the object.
  • state: State or province in which the object is located.
  • regions: Array of regionids identifying the regions in which this object exists.
  • acreage: Boundaries only. The acreage of the boundary.
  • length: Paths only. Length of the path in meters.
  • realtime_notifier: Boolean. True if this object is set to broadcast notifications for new scenes.
  • createdate: Date and time this object was created (ISO-8601 format).
  • append: Boolean. If true, current user can append new data to the datasets or event data for this object, subject to privileges.
  • modify: Boolean. If true, current user can modify or delete datasets on this object, or delete the object itself, subject to privileges.
  • extents: Extent of this object as an extents struct (latlong).
  • wkt: OGC WKT of the object (latlong). Not present if "include_wkt" is set to false in RETURNS.
  • preview: Preview image of the object. Can be in PNG or SVG format. The PNG version is a binary object, a transparent PNG of size 256 x 256, with the object rendered in black. The SVG version is returned as a full SVG document with proper viewbox, nominal size of 256 x 256, with the object as a single SVG PATH object (except for locations, which will be a CIRCLE object). Present only if "include_preview" is set in RETURNS.
  • accessors: Struct of accessors who can view this region, keyed to accessor type, with values being arrays of accessor ids. If there are no accessors of a given type (no ACLs are defined for that type on the object), the key will not be present; for example, if no "USER" ACLs are set, the "USER" key will be absent.
  • subscription_startdate: Start date of currently active subscription for this object, if any. ISO-8601 format. If object is not subscribed, will be empty string.
  • subscription_enddate: End date of currently active subscription for this object, if any. ISO-8601 format. If object is not subscribed, will be empty string.

Optionally, the search for accessible regions and objects can be filtered by search criteria, using the CRITERIA struct. Currently supported criteria keys are as follows:

  • regionid: One region and its objects. Integer.
  • regionids: A set of regions and their objects. Array of integers.
  • state: Filtered to the given state or province. String.
  • extents: Spatially filtered to the given extents. Extents struct, must be in latlong. Empty regions will NOT be returned if this criterion is set, as they have no extents.
  • accessor: DEPRECATED: USE "groupids" KEY INSTEAD. Accessibility is determined for the given accessor, either a user or a group, instead of for the current user. Struct, with two keys: 'type', which is 'GROUP' ('USER' is deprecated), and 'id', which is the id of the group. Requested group must be the current user's group, or a child of that group.
  • accessors: DEPRECATED: USE "groupids" KEY INSTEAD. As "accessor" above, but takes an array of structs to specify accessors. The structs are as defined above for "accessor". The rules for the requested group or user are the same. If this option is specified along with "accessor", above, this plural version will override the singular version. All other filter and return options work identically for this option.

<li>groupids: Regions accessible to the given groups. Array of integers.</li> <li>region_groupids: Regions owned by the given groups, i.e., with their "groupid" attribute set to one of the given groupids. Array of integers.</li>

Using "regionid" (or "regionids") with "extents" or "state" can be useful if a region or set of regions is particularly large, to "subset" the region(s) by the given extent, or to select the part of a region or set of regions that lies within one state or province, when that region or set of regions overlaps state or provincial boundaries; if the given region or set of regions only lies within the one state/province given, or entirely within the given extents, this is not particularly useful, but does no harm. Using "extents" with "state" can be useful to subset the objects in the given state/province by an extent. Using all three criteria together is unlikely to be useful, but again does no harm. Using "accessor" or "accessors", or "groupids" or "region_groupids", with any of the other filters will apply those filters to the accessible regions and objects for the given user or group.

Also optional is the RETURNS struct. This allows the caller to ask the server to omit parts of the returned structure, for efficiency reasons. RETURNS currently accepts the following keys:

  • regionsonly: Boolean. If true, the returned struct will only have the 'regions' key, omitting 'objects'. This can be useful for requesting a listing of regions without any other search criteria, and then requesting objects for particular regionids afterwards. The default is false, returning both regions and objects.
  • include_wkt: Boolean. If true, the full WKT of the object is included. Defaults to true.
  • include_preview: String. Selects the format of preview image to return. Value can be "svg" or "png".
  • include_empty: Boolean. If true, empty regions which are visible to the given accessor(s), or the current user if none specified, will be returned. Defaults to true, unless "extents" is set in CRITERIA, in which case this is forced to false.
  • compact: Boolean. If true, the entire struct returned by this method will be serialized to a JSON string, for faster transmission time. This will require clients to parse the JSON string in order to use the data.
  • attribspec: Struct. This struct allows clients to request that only specific attributes (keys and values) be returned in the various parts of the returned struct. If set, only the named attributes will be present in that portion of the returned struct, with all others omitted. Unique keys (ids) will still be returned in all cases, except when the given struct portion is itself an attribute of a containing struct. The key is the portion of the struct in question, with values being arrays of attribute names. Valid keys, and the attribute names that can be specified with them, are as follows:
    • regions: The region description structs under the "regions" portion of the returned struct. Attribute names are as given for the region description structs, above. Note that if the "objects" attribute of the region description struct is omitted from this array, then the "regions_objects" array, below, will be ignored if present.
    • regions_objects: The "objects" attribute of the region description structs under "regions". Attribute names are "name", "state", and "centroid", as above.
    • objects: The object description structs under the "objects" portion of the returned struct. Attribute names are as given for the obect description structs, above.
    If the array of attribute names for a given key is empty, then no attributes are returned, and the corresponding struct of description structs is replaced with a simple array of IDs. For example, if the attribute array for "regions" is empty, the "regions" portion of the returned struct will contain only an array of region IDs. This is useful for clients which already have the region and object information that they need for the current user, and only need to make an access check for another accessor (using the "accessor" or "accessors" criteria, above). Note that use of this option can conflict with other options. If "regionsonly" is specified, the "objects" key for this option will be ignored; also, for the "wkt" and "mbc" attributes of the object description structs, if using this option, the desired attributes must be included in the "objects" key for this option AND "include_wkt" or "include_mbc" must be set in RETURNS.

If the user has access to no regions and no objects (a rare occurrence), or if none were found for the given criteria, returns boolean false.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION Given extents struct is not valid, or given regionid is not an integer, or invalid state/province name.
access:  public


Parameters:

struct   $criteria   Optional search criteria.
struct   $returns   Optional return-value criteria.

[ Top ]

static method get_available_crop_types [line 7834]

static struct get_available_crop_types( )

Returns a struct of crop type definitions, for use in field attributing. Struct keys are the crop codes (short names), values are the descriptive long names.



Tags:

access:  public


[ Top ]

static method get_changed_data_records [line 12330]

static struct|boolean get_changed_data_records( string $timestamp, array $categories, [struct $options = array()])

Returns a struct describing the changes in data visible to the current user since the time TIMESTAMP, in the categories specified in array CATEGORIES, with options specified in struct OPTIONS. The returned struct will be keyed to each category, with values being the data as returned by the indicated method for that category (as listed below). Calling this method is thus equivalent to calling all of the indicated methods, but filtered according to TIMESTAMP.

TIMESTAMP must be a date and time string; ISO 8601 format is preferred for lack of ambiguity. CATEGORIES is an array of categories of data to return, each of which has its own OPTIONS that affect the returned data. Some categories also require specific privileges to retrieve. At least one category must be specified.

The categories, and their options, are as follows:

  • groups: New groups added, or changes in group information or privileges. As get_visible_groups(). No options.
  • users: New users, or changes to existing users. As get_visible_users(). Options: "showdisabled", if set, disabled users will be included.
  • regions: New regions, or updates to regions (including to region extents due to objects added or removed). As the "regions" portion of the struct returned by get_accessible_regions_and_objects(). No options.
  • objects: New objects, updates to objects, or deletion of objects. New or updated objects data will be as that returned by get_objects_info(), while deleted objects will have no information, with the values for their ID keys being boolean false. Options: "previews", "include_wkt" and "include_mbc", as for get_objects_info().
  • datasets: New datasets, updates to datasets, or deletion of datasets. New or updated dataset info will be returned as follows: the outermost struct will be keyed to the object type of each object with changed datasets, with values being structs keyed to the object ID; the values of those structs will be the dataset type structs as returned by get_saved_datasets_for_objects(), for new and updated datasets; deleted datasets will have no information under their ID keys but a boolean false. Options: "previews", as for get_saved_datasets_for_objects().
  • fielddata: New fielddata events, or new versions of existing events. As get_object_fielddata_records(), except that the returned events may be for any crop year, and will be sorted in change order, not necessarily in event date order. No options.
  • financials: New transaction records. As get_customer_transaction_history() with the following parameters: custid = current user's customer group (if accessible), starttime = TIMESTAMP, no endtime. Options: "custid", "endtime", "childgroups", "sumtypes", as for get_customer_transaction_history(). Requires the "view_financials" privilege.

In addition, there are three general options, affecting the entire returned struct, which can be set regardless of the categories present in CATEGORIES:

  • uid: If set, changes will be returned for data visible to the given user, instead of the current user. The given user must be visible to the current user.
  • compact: If set, the returned struct will be serialized as a JSON string for faster transmission time. This will require clients to parse the JSON string in order to use the data.
  • attribspec: Struct. This struct allows clients to request that only specific attributes (keys and values) be returned in the various parts of the returned struct. If set, only the named attributes will be present in that portion of the returned struct, with all others omitted. Unique keys (ids) will still be returned in all cases, except when the given struct portion is itself an attribute of a containing struct. The key is the category, with values being the attribspec option as documented for the "parent" method, e.g., for groups, the attribspec would be as defined for get_visible_groups(). This feature is only supported for the groups, users, regions, and objects categories at present.

If no data visible to the current user or given user, in any given category, has changed since TIMESTAMP, returns boolean false.




Tags:

exception:  ACCESS_DENIED Given user not accessible to current user.
exception:  PARAMETER_CONSTRAINT_VIOLATION TIMESTAMP is not a valid date and time, or TIMESTAMP is before change logging began, or CATEGORIES is empty, or invalid category given.
exception:  INSUFFICIENT_PRIVILEGES User requested "financials" category without "view_financials" privilege.
access:  public


Parameters:

string   $timestamp   Date and time after which changes should be returned.
array   $categories   Categories of changes to request.
struct   $options   Options struct. Optional.

[ Top ]

static method get_customer_balances [line 9329]

static struct get_customer_balances( array $custids, [boolean $imagerybalance = false])

Returns a struct giving the credit balances for the customer groups identified in array CUSTIDS. CUSTIDS is an array of groupids for customer groups to which the current user has access. Use of this method requires either the "view_financials" privilege or the "specialimagery" privilege; the latter will only allow the user to view the imagery credit balance, while the former allows viewing both the subscription and imagery balances.

IMAGERYBALANCE no longer has any effect, and is present only for backwards compatibility.

Whether a given group is a customer, and thus has a balance of its own, depends on whether the "customer" flag is set on that group. Groups which do not have this flag set will not have independently-tracked balances (though one of their parent groups will).

The returned struct is keyed to the ID, with value being the credit balance (to two decimal places).




Tags:

exception:  REQUESTED_ITEM_NOT_FOUND Given groupid does not exist.
exception:  DATABASE_ERROR Database reported an error.
exception:  INSUFFICIENT_PRIVILEGES Cannot access requested financial information.
exception:  ACCESS_DENIED Given customer group not accessible to user, or does not exist.
exception:  PARAMETER_CONSTRAINT_VIOLATION Given groupid does not correspond to customer group.
access:  public


Parameters:

array   $custids   Array of customer group IDs.
boolean   $imagerybalance   Backwards compatibility: ignored.

[ Top ]

static method get_customer_transaction_history [line 9426]

static array get_customer_transaction_history( integer $custid, [string $starttime = null], [string $endtime = null], [boolean $imageryhistory = true], [struct $options = array()])

Returns the transaction history for the customer group identified by CUSTID, which must be a customer group to which the current user has access.

Use of this method requires the "view_financials" privilege.

STARTTIME and ENDTIME, if set, specify a range of time for which to return transaction records. If not set, STARTTIME defaults to one month prior to the current date, and ENDTIME defaults to the current date. STARTTIME cannot be equal to or after ENDTIME, or an error is signalled. IMAGERYHISTORY no longer has any effect, and is present only for backwards compatibility. OPTIONS is an additional struct of optional settings to constrain or alter the returned data. The available options are:

  • childgroups: Boolean. If true, child groups of the customer group which are also customers, will have their transactions returned as well. The default is to return transactions only for the specified group, and not child customer groups.
  • sumtypes: Array of strings naming transaction types. Records of each named transaction type will be omitted, and replaced with a single record which will contain the total of all amounts for the given customer group and transaction type in the "amount" column. The "transtime" column will contain the date and time of the last transaction of the given type. If the transaction type's amounts are normally indicated with a negative number (charges), the summed value will also be negative. Use with caution: summing some types of transactions ("adjustment", specifically) can have confusing results, because these transaction types use both signs. The default is to return all records, with no summarizing.
  • compact: Boolean. If true, the entire struct returned by this method will be serialized to a JSON string, for faster transmission time. This will require clients to parse the JSON string in order to use the data.

Transaction history is returned as an array of transaction record structs, which are defined as follows:

  • tid: Transaction ID.
  • uid: User ID of the user who performed this transaction.
  • user: Name of the user who performed this transaction.
  • type: Type of the transaction. Transaction types: "initial", "subscription", "groupcreation", "usercreation", "payment", "ccpayment", "adjustment", "imagerycharge", "exportcharge", "transfer".
  • transtime: Date and time of the transaction (ISO-8601 format).
  • amount: Dollar amount of transaction (for subscription costs), or credit amount (for imagery). Positive for credits, negative for debits.
  • balance: Balance after transaction. Amount is in credits.
  • groupid: ID of the customer group for this transaction.
  • group: Name of the customer group for this transaction.
  • confnum: Confirmation number for credit card transactions ("ccpayment"). Null for other types.
  • comment: Comment on the transaction by the user who performed the action, if any.
  • region*: Name of the region or regions in which the object exists.
  • object_type*: Type of object for which imagery was purchased.
  • objectid*: ID of object for which imagery was purchased.
  • sceneid**: ID of the scene from which the purchased imagery came.
  • scene**: Name of the scene from which the purchased imagery came.
  • analysistype+: Type of analysis performed on the purchased imagery.
  • exporttype&: Type of export performed.

"*" = Only present for "subscription", "imagerycharge", or "exportcharge" transactions. "**" = Only present for "imagerycharge" or "exportcharge" transactions. "+" = Only present for "imagerycharge" transactions. "&" = Only present for "exportcharge" transactions.




Tags:

access:  public


Parameters:

integer   $custid   Groupid of customer group.
string   $starttime   Starting date and time (ISO 8601 format).
string   $endtime   Ending date and time (ISO 8601 format).
boolean   $imageryhistory   Backwards compatibility: ignored.
struct   $options   Options struct. Defaults to empty.

[ Top ]

static method get_edited_image_info [line 4582]

static struct get_edited_image_info( string $imagehandle)



Tags:

deprecated:  

This method is being phased out in favor of get_rasters_info().

Returns a struct of information about the edited image IMAGEHANDLE.

Info struct is as follows:

  • width: Image width in pixels.
  • height: Image height in pixels.
  • resolution: Resolution in meters per pixel.
  • projection: Image's projection (in WKT).
  • origin: Origin point of image (in image's coordinate system).
  • extents: Extents of the image (in latlong).
  • objecttype: Type of the object analyzed (boundaries, locations, or paths).
  • objectid: ID of the object analyzed.
  • numzones: Number of zones in edited image.
  • acres: Total acreage of the edited image area.
  • createdate: Date and time this image was saved (ISO 8601 format).
  • zones: List of structs describing the details of each zone. List indexes are 0..numzones - 1, value structs are as follows:
    • zonenum: Zone number.
    • color: RGB tuple describing the color of the zone.
    • acres: Acreage of the zone.

exception:  IMAGEHANDLE_NOT_FOUND Image handle does not exist.
access:  public


Parameters:

string   $imagehandle   The image handle.

[ Top ]

static method get_fcic_crop_types [line 14393]

static void get_fcic_crop_types( )

Returns a struct describing the known Federal Crop Insurance Corporation (FCIC) crop types. This includes crop names, types, and practices.

Struct keys are the numeric crop codes, with values being structs as follows:

  • cropcode: numeric crop code.
  • crop: descriptive name of the crop.
  • cropabbrev: short, "abbreviated" name of the crop.
  • units: units in which this crop is measured.
  • practices: struct of practices, keyed to the practice code, with values being the practice description.
  • types: struct of types, keyed to the type code, with values being the type description.




Tags:

access:  public


[ Top ]

static method get_fielddata_units [line 12203]

static struct get_fielddata_units( )

Returns an array of structs describing the units used in the event records. Each struct is defined as follows:

  • unit: The unit symbol. This is the value used in event records.
  • type: What type of measurement this unit describes (area, volume, weight, length, etc).
  • metric: True if this is an SI (metric) unit, false otherwise.
  • description: Textual description of the unit. Mostly useful for display purposes.




Tags:

access:  public


[ Top ]

static method get_group_fielddata_equipment_records [line 12067]

static struct|boolean get_group_fielddata_equipment_records( integer $groupid)

Returns a struct describing the farming equipment recorded for the group GROUPID, used for field events (see the "equipid" field in the event record structs). GROUPID must be the current user's group, or a child of that group.

The equipment struct is keyed to the equipment ID, with the values being the equipment records, as follows:

  • name: Name of the equipment.
  • make: Equipment manufacturer.
  • model: Model of equipment.
  • year: Year equipment was made.
  • equipment_type: Description of the equipment type.
  • create_date: Date and time this equipment record was recorded in the database (ISO 8601 format).

If no equipment records exist for the given group, returns false.




Tags:

exception:  ACCESS_DENIED Given group is not accessible to current user.
access:  public


Parameters:

integer   $groupid   Group ID.

[ Top ]

static method get_multiple_edited_images_info [line 4605]

static struct get_multiple_edited_images_info( array $imagehandles)



Tags:

deprecated:  

This method is being phased out in favor of get_rasters_info().

As get_edited_image_info(), but returns info for the edited images in array IMAGEHANDLES. Returns a struct keyed to each edited image image handle, with values being the info structs from get_edited_image_info().

access:  public


Parameters:

array   $imagehandles   Array of image handles.

[ Top ]

static method get_multiple_vectors_metadata [line 6141]

static struct get_multiple_vectors_metadata( array $vechandles, [struct $options = array()])

As get_vector_metadata(), but returns the metadata of each vector in array VECHANDLES, in a struct keyed to the vector handles. Values are the metadata structs returned by get_vector_metadata().



Tags:

exception:  VECTOR_NOT_FOUND Vector handle does not exist.
access:  public


Parameters:

array   $vechandles   Array of vector handles.
struct   $options   Options struct.

[ Top ]

static method get_multiple_vector_attribute_tables [line 5952]

static struct get_multiple_vector_attribute_tables( array $veclist, [string $criterion = 'zone'], [boolean $namesonly = false])

As get_vector_attribute_table(), but returns a table for each vector table whose handle is in VECLIST. The tables are placed in a struct keyed to the vector handle; the value is the array of rows described in get_vector_attribute_table(). CRITERION and ZONE are interpreted as for get_vector_attribute_table().



Tags:

exception:  VECTOR_NOT_FOUND Vector handle does not exist.
access:  public


Parameters:

array   $veclist   Array of vector handles.
string   $criterion   Criterion to generate table: can be 'row' or 'zone'. Defaults to 'zone'.
boolean   $namesonly   Whether to return only the column names or the full table. Defaults to false (full table).

[ Top ]

static method get_my_user_info [line 225]

static struct get_my_user_info( [string $client = 'all'], [struct $options = array()])

Returns a struct describing basic information about the current user, as follows:

  • uid: User ID (primary key).
  • login: User's login name.
  • f_name: First name.
  • l_name: Last name.
  • address1: First line of address.
  • address2: Second line of address (may be blank).
  • city: City.
  • state_prov: State or province.
  • mailcd: ZIP or postal code.
  • country: Country.
  • phone: Phone number.
  • email: Email address.
  • groupid: ID of this user's group.
  • agiadmin: Special flag for Agri ImaGIS administrators.
  • User privilege flags, as described in Privilege Flags.
  • notification_settings: Struct containing the user's current notification settings. If the user is not subscribed to any category of notifications, this struct will not be present.Struct keyed to the notification category (see Notification Categories: What to Report), with values being the notification settings for that category, as follows:
    • mode: Delivery mode. One of "immediate" or "digest".
    • interval: Interval to collect changes for digests. One of "1 day", "1 week", or "1 month".
    • timeofday: Time of day to deliver digest. ISO 8601 time (not date/time) with time zone.
    • dayofweek: Day of week to deliver weekly digest. Named day of week.
    • dayofmonth: Day of month to deliver monthly digest. Integer.
    • send_email: Whether or not to send a notification email for this category. Boolean.
  • subscribed_objects: Struct keyed to the type of geospatial objects (boundaries, point locations, or linear paths) to which the user's group is subscribed, with values being a struct keyed to the object IDs; the nested struct's values are arrays of imagery sources. Objects which are subscribed to an imagery source are charged as per the "subscribed" rates for the customer pricing plan.
  • notifying: Struct keyed to the type of geospatial objects (boundaries, point locations, or linear paths) for which the user will receive icue notifications, with values being a struct keyed to the object IDs; this nested struct's values are structs consisting of two date fields: "startdate" and "enddate". The month and day of these dates determine the range of scene dates for which the user will receive notifications of new scenes. The user must have "icue" notifications enabled in "notification_settings".
  • presets: Struct of preference settings for autoanalysis jobs. These saved settings will override the system defaults for an autoanalysis job. If the user has no preferences saved, this struct will not be present. Struct definition is as follows:
    • types: Array of analysis types, as for the TYPE parameter for classify_multiband_analyses(). Any combination of the allowed types is permitted; duplicates will be removed.
    • mode: One of "standard", "minmax", or "custom" as the MODE parameter for classify_multiband_analyses().
    • numzones: Number of zones, as the NUMZONES parameter for classify_multiband_analyses(). Must be at least 2, and cannot exceed the maximum for the given colortable (default colortable max is 31). Ignored if "mode" is "custom".
    • colortable: Index number for the color table to use, as the COLORTABLE parameter for classify_multiband_analyses(). Ignored if "mode" is "custom".
    • custom_classifications: Struct keyed to analysis types, with values being the name of a saved custom classification valid for each analysis type. Only relevant if "mode" is set to "custom". If not set, will be an empty string.
  • customerinfo: Struct of information about the customer group to which this user belongs, including the pricing plan Fields are as follows:
    • customerid: Groupid of this customer group.
    • name: Name of the customer group.
    • plancode: Code name of the pricing plan for this customer group.
    • balance: Current balance for the customer group, in credits.
    • allow_negative_balance: Whether or not this pricing plan allows the balance to become negative. Boolean.
    • analysis_purchase_prompt: Whether or not clients should prompt for approval before making an analysis purchase. Boolean.
    • export_purchase_prompt: Whether or not clients should prompt for approval before making an export purchase. Boolean.
    • costs: Struct of cost specifiers for each source of data for analysis or export. Keyed to the data source name, with values being cost spec structs, as follows:
      • analysis_cost_subscribed: Cost per acre per boundary for analysis of this imagery source, during the customer group's subscription period.
      • analysis_cost_subscribed_after_threshold: Cost per acre per boundary for analysis of this imagery source, after the number of analyses purchased for a boundary exceeds the "analysis_threshold" value, during subscription period.
      • analysis_cost_unsubscribed: Cost per acre per boundary for analysis of this imagery source when not subscribed.
      • export_cost_subscribed: Cost per acre per boundary for export of this data source, during the customer group's subscription period.
      • export_cost_subscribed_after_threshold: Cost per acre per boundary for export of this data source, after the number of analyses purchased for a boundary exceeds the "export_threshold" value, during subscription period.
      • export_cost_unsubscribed: Cost per acre per boundary for export of this data source when not subscribed.
      • analysis_threshold: Number of analyses purchased per boundary before the "after_threshold" cost is used.
      • export_threshold: Number of exports purchased per boundary before the "after_threshold" cost is used.
      • subscription_cost: Cost per acre per boundary for subscription to this data source.
  • classifications: Struct of saved classifications, usable with classify_multiband_analyses(). Struct keys are band names (NIR, NDVIR, NDVIG, REDEDGE, NDVIREDEDGE); each band name key's value is a struct of named classifications, with the names as keys and the classification structs as values. Classification structs are structured as described for classify_multiband_analyses(). Not present if the user has no classifications saved.
  • client_preferences: Struct of preference settings for different client program to use. Keyed to the client names, with values being structs of preferences. The special client name "all" is used to indicate global preferences which should be honored by all clients. These preferences are not checked for validity by the server, and have no effect on server functionality by themselves; the intention is for this information to be used by various clients to control client-side preferences or presets for server method calls. Not present if the user has no preferences saved.

If the optional CLIENT parameter is set, preferences for the specified client, as well as global preferences, will be retrieved. If not set, only the global preferences will be retrieved.

OPTIONS, if set, is a struct which accepts boolean flags to turn off various parts of the user info struct, if not desired. The struct accepts the following keys, all of which default to true if not set:

  • include_notification_settings: If true, notification settings is included under "notification_settings".
  • include_notifying: If true, notifying objects is included under "notifying".
  • include_subscribed: If true, objects to which the user's customer group are subscribed is included under "subscribed_objects".
  • include_presets: If true, the user's autoanalysis presets for iCue is included under "presets".
  • include_customerinfo: If true, the user's customer group info is included under "customerinfo".
  • include_classifications: If true, the user's custom classification info is included under "classifications".




Tags:

access:  public


Parameters:

string   $client   Name of client to retrieve preferences for, under 'client_preferences'. Optional.
struct   $options   Options struct.

[ Top ]

static method get_notifications [line 13281]

static struct|boolean get_notifications( struct $criteria, [struct $options = array()])

Returns an array of notification messages reflecting changes in the system, according to CRITERIA. Notification messages are generated for the current user if the user is subscribed to that category of notification, according to the user's subscription parameters (see Notifications and Autoanalysis). The notifications are returned in reverse order of completion time, which (for digest notifications) is when compilation of the notification's data ended, not when it began. This distinction is meaningless for immediate notifications.

CRITERIA is a struct which specifies which notifications should be returned. It can accept the following keys:

  • ids: Array of notification IDs. Fetches specific notifications by ID. This is mostly useful if the notification has already been fetched once with partial information via the "attribspec" option in OPTIONS, and more information is desired. Fetching by ID should probably not be combined with other criteria, but doing so does no harm other than potentially excluding more notifications than desired.
  • categories: Array of category names. Notifications will be fetched only from the given categories if this is set. Categories are as give in
  • starttime: Timestamp at and after which notifications will be returned; this is compared against the notification's completion time, not creation time. ISO 8601 format is preferred to avoid ambiguity. Timestamps should include time zone information, or else be in US Central Time, for best accuracy.
  • endtime: Timestamp at and before which notifications will be returned. As for "starttime", this is compared against completion time.

If "starttime" and "endtime" are both set, it is an error if "starttime" is after "endtime", if "starttime" or "endtime" are not valid dates, or if "starttime" is in the future. Invalid category names in "categories" will also trigger an error, as will passing in IDs for notifications to which the current user does not have access (users only access their own notifications).

With no keys set in CRITERIA, all of the current user's visible notifications will be returned (or all notifications, if "include_hidden" is set in OPTIONS), which may be a very large amount of data.

Each notification record is a struct with the following fields:

  • id: Numeric ID of this notification.
  • category: The category of notification. See Notification Categories: What to Report.
  • createtime: Timestamp for the creation of this notification. ISO 8601 format.
  • completetime: Timestamp for the completion of this notification, i.e., when data collection stopped for this notification. ISO 8601 format.
  • viewtime: Timestamp for when this notification was "viewed" by a client. May be empty string, in which case, no client has set the viewtime. See update_notifications().
  • delivery: Mode of notification delivery. This will be "immediate", "daily", "weekly", or "monthly"; see Notification Modes: When to Notify.
  • special: If this notification was delivered before its regular delivery time, due to the user changing notification settings or creating a new iCue notification using the method search_and_prepare_autoanalysis_matches_and_jobs(), this field will specify what occurred. This can be "Mode changed", in which case the delivery mode was changed from "digest" to "immediate", "Delivery time changed", in which case the new delivery schedule put the delivery time in the past, or "Time machine", in which case the user created a new iCue notification using the above method. Otherwise, this field will not be present.
  • visible: Boolean. If true, this notification is considered "visible" to the user, while if false, the notification is "hidden". Will only be present if "include_hidden" is set in OPTIONS.
  • records: The data records for the change or changes that this notification represents. This is an array of structs with the following keys:
    • keys: Struct containing the key-value pairs that uniquely identify this record.
    • id: String value of the values from "keys", in a defined order. Useful for quick client-side comparisons.
    • subtype: Within a category, there can be several types of notification. The specifics of this field vary by category, but the field will always be present.
    • action: One of "created", "updated", or "deleted".
    • name: Current name of the changed entity in the database. If the action is "deleted", this is the name of the entity as it was before deletion.
    • previews: Struct of preview images of the objects, datasets, iCue matches (showing each boundary over the matched scene), or iCue analysis datasets in this record, keyed to the id of the object or dataset in question. Only present for the "objects", "datasets", and "icue" categories, and only if "include_previews" is set.
    • transaction_time: Timestamp for the start of the database transaction that performed this action. ISO 8601 format.
    • clock_time: Timestamp for when this action was actually performed, within the transaction. ISO 8601 format.
    • old_data: Struct containing the data record as it was before the change. If action is "created", this is empty.
    • changed_data: Struct containing the record keys and values that were changed. If action is "created", this is the entire new record; if "deleted", this is empty.

The details of the data records will vary with category, as follows:

  • groups: Subtypes are "info", "privileges", and "pricingplan", reflecting changes to the group basic info, privileges, or (for customer groups) pricing plan, respectively. For "info" subtype, the old and changed data will be fields from the basic group info, while "privileges" will be changes to privilege flags. See get_visible_groups().
  • users: Subtypes are "info", "privileges", "subscriptions", "presets", and "preferences", and the old and changed data records will contain the changes to those types of data. See get_my_user_info() and get_visible_users().
  • regions: Subtypes are "info" and "mappings", with the data records containing changes to region info or to the objects mapped into the region. See get_accessible_regions_and_objects().
  • objects: Subtypes are "boundaries", "locations", "paths", and "access", with data records containing changes to the objects or to their access controls. See get_objects_info() and set_objects_access_controls(). Previews of the objects will not be returned unless "include_previews" is set in OPTIONS.
  • datasets: Subtypes are the dataset types given in get_saved_datasets_for_objects(). Data records contain new or changed dataset information. The actual full dataset will not be returned, nor will the preview unless "include_previews" is set in OPTIONS.
  • fielddata: Subtypes are the fielddata record types given in get_object_fielddata_records(), with additional subtype information for changes to "sub-entries" for a particular record type after a colon; for example, a new weed record for a scouting record would have subtype "scouting:weeds". Data records will always contain the new record, because of fielddata versioning.
  • financials: Subtypes are "transactions" and "fmid". Data records will contain the new transaction record, or the changes to the customer pricing plan. See get_customer_transaction_history().
  • icue: Subtypes are "match" and "completion". Data records are special: matches will contain information about what jobs, if any, they currently have in the job queue, and completion records will include information about which jobs were completed, and what new analysis datasets were created. In both cases, this data will be present under "changed_data", and "old_data" will be empty.

Match records are persistent, but job records are not; a match record's jobs list can and will grow as new jobs are created from it, run to completion, and are then removed; old jobs will remain in the record as a log, but cannot be rerun directly. Completion records are likewise persistent, as are the analysis datasets they refer to. Completion records can be generated for multiple jobs from multiple matches.

A match record will contain the following information under "changed_data":

  • id: ID of this match record.
  • sceneinfo: Information about the scene matched as returned by get_scene_info().
  • boundaryids: Array of boundary IDs matched for the given scene.
  • createtime: Timestamp for the creation of this match (ISO 8601 format). This is the time when the original match was found.
  • jobs: Array of job description structs for jobs generated for this match record. By default, only the first job generated for this match will be returned; to return a full history, set "icue_get_job_history" in OPTIONS. Job description structs are defined as follows:
    • token: Job's identifying token. This is unique to every job.
    • boundaryids: Array of boundary IDs to be analyzed. This is always a proper subset of the IDs under "boundaryids" in the parent match struct, but some IDs in the parent list may not be present here, i.e., not all boundaries matched for the match need be analyzed for a given job.
    • boundarycosts: Cost (in credits) to analyze each boundary with the given scene for this job. Struct keyed to the boundary ID, value is the cost. Cost may be 0 if the boundary has already been analyzed for the given scene's scene year, or if the scene's type has no cost.
    • createtime: Timestamp for the creation of this job (ISO 8601 format), or its completion if status is "complete". This timestamp can and will be different from the "createtime" for the match itself.
    • status: Status of the job. Can be "wait" (waiting for approval), "ready" (ready to be run), "running" (currently running), "complete" (job completed), or "removed" (job removed).
    • analysis_types: Array of analysis types to be performed for this job.
    • analysis_mode: Mode of analysis (standard or minmax) for this job.
    • numzones: Number of zones to use in analysis.
    • colortable: Color table to use for classification. See get_available_colortables().
  • previews: Struct of PNG preview images of the matched scene, for each matched boundary. Keyed to the boundary IDs, with values being the preview images. Only present if "include_previews" is set in OPTIONS.

Completion records are simpler, and will have the following fields:

  • matchid: ID of the match this job was generated from.
  • jobtoken: Token of this job.
  • sceneinfo: Information about the scene analyzed as returned by get_scene_info().
  • settings: The settings used to run this job. Struct containing four fields: "analysis_types", "analysis_mode", "numzones", and "colortable", which are as defined for "match" subtype records.
  • boundarydatasets: Struct keyed to the objectid of each boundary analyzed, with values being structs keyed to the analysis id; the values of these structs are analysis information structs, with the following fields:
    • name: Name of the analysis.
    • type: Analysis type.
    • mode: Analysis mode.
    • numzones: Number of zones.
    • preview: PNG preview of the analysis. Only present if "include_previews" is set in OPTIONS.
  • joberrors: Array of error messages generated during the job's run. If no errors were generated, this field will not be present.

OPTIONS is an optional struct with keys to control the returned data, with the following keys:

  • summary: String, one of two values: "include" or "only". If set to "include", the returned array of structs will contain a "summary" struct at position 0, before the notification structs. If set to "only", the only element in the returned array will be the summary struct, at position 0. This summary struct is keyed to the categories of notifications available to the user; a category key will only be present if notifications of that category exist for the current user. Values for each key will be a struct containing (up to) two keys, "visible" and "hidden", which will in turn have values of arrays of timestamps for the completion times of each visible or hidden notification for the given category. If there are no visible notifications for the given category, the "visible" key will not be present, and conversely, the "hidden" key will not be present if there are no hidden notifications for the given category, or if "include_hidden" is not set.
  • compact: Boolean. If set, the returned array will be serialized as a JSON string for faster transmission time. This will require clients to parse the JSON string in order to use the data.
  • include_previews: String. If set, preview images will be returned for data records in the "objects", "datasets", and "icue" categories. The string's value is irrelevant for datasets and for icue, but for objects, can be set to "svg" or "png", to control the returned preview's format. PNG format previews will be returned in base64 encoding.
  • preview_urls: Boolean; only has effect if "include_previews" is set. If set to true, the previews will be returned as URL download paths, instead of as data in the struct. The download URLs will only be valid for the current session.
  • include_hidden: Boolean. If set, notifications which have been hidden (via update_notifications()) will still be returned. Otherwise, only notifications which are flagged as visible will be returned.
  • attribspec: Struct. This struct allows clients to request that only specific attributes (keys and values) be returned in the data records of each notification ("old_data" and "changed_data"); "changed_data" will only be modified if the record's action is "created". If set, only the named attributes will be present in those records, with all others omitted. Keys are category names, with values being structs keyed to subtypes for the given category; values of those keys are arrays of attribute names to include. The specific attribute names that can be specified vary for each category and subtype; if no attributes are specified for a given category and subtype, only minimal identifying information (primary key values and names) will be returned in the data records.
  • icue_get_job_history: Boolean. If set, match records for icue notifications will contain a full job history for each match. Normally this is not desireable, so default is false.

If no notifications are found for the given CRITERIA, this method returns boolean false.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION Invalid category names, or starttime or endtime not valid dates, or starttime after endtime, or starttime in future.
exception:  ACCESS_DENIED Given notification IDs not accessible to current user.
access:  public


Parameters:

struct   $criteria   Criteria to search for notifications.
struct   $options   Options to control return values.

[ Top ]

static method get_objects_analysis_costs_for_scene [line 9292]

static struct get_objects_analysis_costs_for_scene( struct $objects, string $sceneid, [integer $buffer = 100])



Tags:

deprecated:  This method will continue to work, but new code should use get_objects_costs_for_scenes_or_vectors() instead. This method is a wrapper for that one now.
exception:  ACCESS_DENIED Given object not accessible to user.
access:  public


Parameters:

struct   $objects   Objects struct.
string   $sceneid   Scene ID.
integer   $buffer   Buffer amount.

[ Top ]

static method get_objects_costs_for_scenes_or_vectors [line 9008]

static void get_objects_costs_for_scenes_or_vectors( struct $objects, array $sceneidsorvechandles, [string $operation = "analysis"], [integer $buffer = 100], [integer $groupid = null])

Calculates and returns the costs in credits for performing OPERATION with the objects described in OBJECTS, and the scenes or vectors identified in SCENEIDSORVECHANDLES.

OBJECTS is a struct, keyed to the object type ("boundaries", "locations", or "paths"), with values being arrays of object ids. The objects must be ones to which the current user has access.

SCENEIDSORVECHANDLES is a simple array of scene ids, or vector handles. Vector handles can only be passed in for export check.

OPERATION can be one of "analysis" or "export". For "analysis", the costs returned will be the cost of analyzing (creating multibands) each scene in SCENEIDSORVECHANDLES for each object in OBJECTS, while "export" will calculate the costs for exporting datasets created from each scene in SCENEIDSORVECHANDLES for each object in OBJECTS.

BUFFER is used for calculating the costs for locations or paths; it is ignored for boundaries.

The returned struct will have the following structure: outermost keys are object types, with values being structs keyed to object ids; values of those structs will be structs keyed to sceneids or vector handles, values being costs. The struct will look something like this:

  Struct("boundaries" => Struct(objectid => Struct(sceneid => cost,
							 sceneid => cost,
							 sceneid => cost),
				      objectid => Struct(sceneid => cost)),
		"locations" => (...),
		"paths" => (...))

Only object types that were passed in will be returned; e.g., if the OBJECTS struct only contained boundaries, then the returned struct will only have "boundaries" as the outermost key.




Tags:

exception:  ACCESS_DENIED Given object not accessible to user.
exception:  PARAMETER_CONSTRAINT_VIOLATION Empty OBJECTS or SCENEIDSORVECHANDLES passed in, or invalid object specification, or invalid value specified for OPERATION or for BUFFER, or vector handles passed in for "analysis" OPERATION.
access:  public


Parameters:

struct   $objects   Objects struct.
array   $sceneidsorvechandles   Array of sceneids.
string   $operation   One of "analysis" or "export". Optional, defaults to "analysis".
integer   $buffer   Buffer amount. Optional, defaults to 100.
integer   $groupid   Groupid. Optional.

[ Top ]

static method get_objects_info [line 1800]

static array get_objects_info( struct $objects, [struct $options = array()])

Retrieves and returns information about the objects specified in struct OBJECTS, according to options OPTIONS. OBJECTS is a struct keyed to the object type (boundaries, locations, or paths), with values being arrays of object ids. The objects must be accessible to the current user.

OPTIONS is an optional struct with the following keys:

  • include_wkt: Boolean. If true, the full WKT of the object is included. Defaults to false.
  • previews: String. If set, selects the format of preview image to return. Valid values are "svg" or "png". Note that previews for locations are not very useful, as they will always look like points.
  • compact: Boolean. If true, the entire struct returned by this method will be serialized to a JSON string, for faster transmission time. This will require clients to parse the JSON string in order to use the data.
  • attribspec: Array. This array allows clients to request that only specific attributes (keys and values) be returned in the object description structs. If set, only the named attributes will be present, with all others omitted. The "objecttype" and "objectid" attributes may not be omitted from the object description struct; they will be present regardless of their presence in this option's array. If the array of attribute names is empty, then the object description structs will only contain the attributes "objecttype" and "objectid".

The returned data is an array of object description structs, which are defined as follows:

  • objecttype: Type of the object. One of "boundaries", "locations", or "paths".
  • objectid: ID of the object.
  • name: Name of the object.
  • state: State or province in which the object is located.
  • regions: Struct of regions identifying the regions in which this object exists, keyed to regionid, value is region name.
  • region_groupid: ID of the group to which this region is assigned, if any; this is used for assigning default access controls for objects added to a region. Region visibility is controlled by object access controls, so it is entirely possible for a region to have a groupid that does not correspond to a group visible to the current user.
  • group_name: Name of the group to which this region is assigned, if any.
  • acreage: Boundaries only. The acreage of the boundary.
  • length: Paths only. Length of the path in meters.
  • realtime_notifier: Boolean. True if this object is set to broadcast notifications for new scenes.
  • createdate: Date and time this object was created (ISO-8601 format).
  • append: Boolean. If true, current user can append new data to the datasets or event data for this object, subject to privileges.
  • modify: Boolean. If true, current user can modify or delete datasets on this object, or delete the object itself, subject to privileges.
  • extents: Extent of this object as an extents struct (latlong).
  • accessors: Struct of accessors who can view this region, keyed to accessor type, with values being arrays of accessor ids. If there are no accessors of a given type (no ACLs are defined for that type on the object), the key will not be present; for example, if no "USER" ACLs are set, the "USER" key will be absent.
  • subscription_startdate: Start date of currently active subscription for this object, if any. ISO-8601 format. If object is not subscribed, will be empty string.
  • subscription_enddate: End date of currently active subscription for this object, if any. ISO-8601 format. If object is not subscribed, will be empty string.
  • wkt: OGC WKT of the object (latlong). Present only if "include_wkt" is set to true in OPTIONS.
  • preview: Preview image of the object. Can be in PNG or SVG format. The PNG version is a binary object, a transparent PNG of size 256 x 256, with the object rendered in black. The SVG version is returned as a full SVG document with proper viewbox, nominal size of 256 x 256, with the object as a single SVG PATH object (except for locations, which will be a CIRCLE object). Present only if "previews" is set in OPTIONS.




Tags:

exception:  ACCESS_DENIED Given object is not accessible to current user.
access:  public


Parameters:

struct   $objects   Objects struct.
struct   $options   Options struct. Optional.

[ Top ]

static method get_object_fielddata_records [line 11472]

static struct get_object_fielddata_records( integer $cropyear, struct $objects, [boolean $allversions = false])

Returns the fielddata event, scouting, and other data records for the objects in struct OBJECTS, for the given CROPYEAR. OBJECTS is a struct keyed to the object type ('boundaries', 'locations', or 'paths'), with values being arrays of objectids of that type. The objects must be ones to which the current user has access.

Returns a struct keyed to the object type, with values being structs keyed to the objectid; the values of those structs are arrays of event record structs, sorted first by the event date, then by the event type, and finally by the version of the event record (if ALLVERSIONS is true). If ALLVERSIONS is false, only the latest version of a given event record will be returned; otherwise, all versions are returned.

If no event records exist for a given object ID for CROPYEAR, the value for that object ID in the struct will be boolean false.

Event record structs vary by event type, but contain common fields, as follows:

  • objecttype: Type of the object for this event.
  • objectid: ID of the object for this event.
  • cropyear: Crop year for the event.
  • eventname: Descriptive name for the event. Not present for insurance.
  • eventtype: Type of event. One of "crop_protection", "fertilizing", "harvest", "insurance", "irrigation", "planting", "scouting", "soiltesting", or "tillage".
  • create_date: Date and time this event was recorded in the database (ISO 8601 format). This is not the same as the event's date and time!
  • operation_datetime: Date and time the event took place (ISO 8601 format). This can and will often differ from the create_date, above. Not present for insurance.
  • id: ID number for this event. Multiple event records may have the same ID, but different versions (below).
  • version: Version number of this event.
  • equipid: ID for equipment used in this operation. Refers to equipment records returned by get_group_fielddata_equipment_records(). Not present for scouting or insurance events.
  • photoids: Array of IDs of geotagged photos associated with this event.
  • analysisids: Array of IDs of analyses associated with this event.
  • editedimageids: Array of IDs of edited image associated with this event.
  • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this event.
  • comments: All events have a freeform comments field for entering notes and other comments.
  • additional_attribs: A structure of additional, arbitrary keys and values set on the event. May not be present.

The event record structs have additional fields which vary by event type. Definitions for each are as follows. All of these fields are present in addition to the above common fields! Note that any "units" fields will contain unit names as returned by get_fielddata_units().

Event type "crop_protection":

  • application_type: Text string describing the type of application.
  • application_method: Text describing the application method.
  • adjuvent: Adjuvent applied, if any.
  • adjuvent_rate: Rate of adjuvent application.
  • adjuvent_rate_units: Units for adjuvent_rate.
  • adjuvent_rate_area_units: Units for the area to which adjuvent_rate applies.
  • water_volume: Volume of water used in application.
  • water_volume_units: Units for water_volume.
  • water_volume_area_units: Units for the area to which water_volume applies.
  • air_temp: Air temperature during application.
  • air_temp_units: Units for air_temp.
  • relative_humidity: Relative humidity during application.
  • wind_speed: Wind speed during application.
  • wind_speed_units: Units for wind_speed.
  • wind_speed_direction: Compass direction of wind in degrees. Client applications should translate this to cardinal directions.
  • products: Array of products used in this application. Product records for crop_protection are as follows:
    • product: Name of the product used.
    • rate: Rate of product application.
    • units: Units for rate.
    • area_units: Units for the area to which rate applies.
    • additional_attribs: A structure of additional, arbitrary keys and values set on the product. May not be present.

Event type "fertilizing":

  • application_type: Text string describing the type of application.
  • application_method: Text describing the application method.
  • products: Array of products used in this application. Product records for crop_protection are as follows:
    • fertilizer: Name of the fertilizer used.
    • type: Type of fertilizer.
    • rate: Rate of product application.
    • units: Units for rate.
    • area_units: Units for the area to which rate applies.
    • n: Nitrogen percentage.
    • p: Phosphorus percentage.
    • k: Potassium percentage.
    • s: Sulfur percentage.
    • additional_attribs: A structure of additional, arbitrary keys and values set on the product. May not be present.

Event type "harvest":

  • crop: Name of the crop.
  • variety: Variety of the crop.
  • yield: Yield of crop.
  • yield_units: Units for yield.
  • yield_area_units: Units for the area to which yield applies.
  • grade: Grade of crop.
  • quality: Crop quality.
  • dockage: Dockage (if applicable).
  • kernel_weight: Weight of kernels (if applicable).
  • kernel_weight_units: Units for kernel_weight.
  • protein_content: Protein content of crop (if applicable).
  • oil_content: Oil content of crop (if applicable).
  • green_seed_content: Number of green seeds.
  • falling_numbers: Falling numbers.
  • weather_conditions: Weather conditions during harvest.
  • moisturepercent: Moisture percentage of harvested crop.

Event type "insurance":

  • insuranceyear: Year for which this insurance is in effect.
  • prevented_planting: Array of prevented planting insurance unit records. Prevented planting structs are as follows:
    • unit_number: Unit number.
    • unit_type: Unit type. May be one of "EU" (Enterprise Unit), "OU" (Optional Unit), "BU" (Basic Unit), or "WFU" (Whole Farm Unit).
    • cropcode: FCIC crop code, as returned by get_fcic_crop_types().
    • practicecode: FCIC practice code, as returned by get_fcic_crop_types().
    • typecode: FCIC type code, as returned by get_fcic_crop_types().
    • acres: Acres insured.
    • land_description: Legal land description.
    • photoids: Array of IDs of geotagged photos associated with this entry.
    • analysisids: Array of IDs of analyses associated with this entry.
    • editedimageids: Array of IDs of edited image associated with this entry.
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry.
    • comments: Freeform comments about this entry.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry.

Event type "irrigation":

  • irrigation_type: Type of irrigation.
  • water_applied: Amount of water applied.
  • water_applied_units: Units for water applied.
  • water_applied_area_units: Units for the area to which water_applied applies.

Event type "planting":

  • crop: Crop planted.
  • seed_company: Company seeds were purchased from.
  • variety_hybrid: Variety or hybrid.
  • seeding_method: Method of seeding. Can be "conventional" or "variablerate".
  • seeding_rate: Rate of seeding.
  • seeding_rate_units: Units for seeding rate.
  • seeding_rate_area_units: Units for the area to which seeding rate applies.
  • planting_depth: Depth seeds were planted.
  • planting_depth_units: Units for planting_depth.
  • tillage_method: Method of tillage before/during planting. Can be "notill", "striptill", or "fulltill".
  • weather_conditions: Weather conditions during planting.

Event type "scouting":

  • crop_growth_stage: Crop growth stage. Average for the whole field. For localized measurements, see crop_growth array.
  • stand_count: Stand count. Average for the whole field. For localized measurements, see crop_growth array.
  • stand_count_area_units: Unit of area for stand_count.
  • plant_height: Height of plants. Average for the whole field. For localized measurements, see crop_growth array.
  • plant_height_units: Units for plant_height.
  • crop_condition: Condition of crop.
  • soil_condition: Condition of soil.
  • weather_conditions: Weather conditions when field was scouted.
  • temperature: Temperature during scouting.
  • temperature_units: Units for temperature.
  • recommendations: Recommendations for the grower.
  • beneficials: Array of beneficial species found. Beneficial record structs are as follows:
    • beneficialid: ID number for this beneficial species.
    • common_name: Common name for the beneficial species.
    • alt_common_name: Alternative common name, if any.
    • scientific_name: Scientific nomenclature for the beneficial species.
    • rating: Rating of the beneficial species in the field per area measured.
    • rating_units: Units for rating area.
    • density: Relative density of the beneficial species.
    • stage: Stage of the beneficial species life cycle.
    • location_on_plant: Location of the beneficial species on the plant.
    • count: Count of beneficial species per location or region.
    • location: Point location (in latlong NAD83) where this beneficial species was found. OGC WKT format for point geometry.
    • region: Area location (in latlong NAD83) where this beneficial species was found. OGC WKT format for polygon geometry.
    • photoids: Array of IDs of geotagged photos associated with this entry.
    • analysisids: Array of IDs of analyses associated with this entry.
    • editedimageids: Array of IDs of edited image associated with this entry.
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry.
    • comments: Freeform comments about this entry.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry. May not be present.
  • crop_growth: Array of crop growth measurements taken. Crop growth record structs are as follows:
    • crop_growth_stage: Description of the growth stage.
    • stand_count: Stand count.
    • stand_count_area_units: Unit of area for stand_count.
    • plant_height: Height of plants.
    • plant_height_units: Units for plant_height.
    • location: Point location (in latlong NAD83) where this crop growth measurement was taken. OGC WKT format for point geometry.
    • region: Area location (in latlong NAD83) where this crop growth measurement was taken. OGC WKT format for polygon geometry.
    • photoids: Array of IDs of geotagged photos associated with this entry.
    • analysisids: Array of IDs of analyses associated with this entry.
    • editedimageids: Array of IDs of edited image associated with this entry.
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry.
    • comments: Freeform comments about this entry.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry.
  • custom: Array of custom scouting records, for items or issues that are not covered under the other categories. Optional, but if present, required elements are noted. Custom record structs are as follows:
    • name: Name of this custom record.
    • location: Point location (in latlong NAD83) where this item was found. OGC WKT format for point geometry.
    • region: Area location (in latlong NAD83) where this item was found. OGC WKT format for polygon geometry.
    • photoids: Array of IDs of geotagged photos associated with this entry.
    • analysisids: Array of IDs of analyses associated with this entry.
    • editedimageids: Array of IDs of edited image associated with this entry.
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry.
    • comments: Freeform comments about this entry.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry.
  • diseases: Array of diseases found. Disease record structs are as follows:
    • diseaseid: ID number for this disease.
    • crop: Crop or crops this disease affects.
    • part: Part of plant disease infects.
    • common_name: Common name for the disease.
    • scientific_name: Scientific nomenclature for the disease.
    • class: Classification of disease, may be "bacteria", "virus", "fungus", or "unknown".
    • rating: Rating of the disease in the field per area measured.
    • rating_units: Units for rating area.
    • density: Relative density of the disease.
    • stage: Stage of the disease life cycle.
    • location_on_plant: Location of the disease on the plant.
    • count: Count of diseased plants per location or region.
    • percent_of_field: Percent of the field affected.
    • location: Point location (in latlong NAD83) where this disease was found. OGC WKT format for point geometry.
    • region: Area location (in latlong NAD83) where this disease was found. OGC WKT format for polygon geometry.
    • photoids: Array of IDs of geotagged photos associated with this entry.
    • analysisids: Array of IDs of analyses associated with this entry.
    • editedimageids: Array of IDs of edited image associated with this entry.
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry.
    • comments: Freeform comments about this entry.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry. May not be present.
  • insects: Array of insects found. Insect record structs are as follows:
    • insectid: ID number for this insect.
    • crop: Crop or crops this insect preys upon.
    • common_name: Common name for this insect.
    • alt_common_name: Alternative common name, if any.
    • scientific_name: Scientific nomenclature for the insect.
    • pressure: Pressure the insect is placing on crop.
    • location_on_plant: Location of the insect on the plant.
    • count: Number of insects found per location or region.
    • density: Relative density of the insect.
    • stage: Growth stage of insect.
    • percent_of_field: Percent of the field affected.
    • location: Point location (in latlong NAD83) where this insect was found. OGC WKT format for point geometry.
    • region: Area location (in latlong NAD83) where this insect was found. OGC WKT format for polygon geometry.
    • photoids: Array of IDs of geotagged photos associated with this entry.
    • analysisids: Array of IDs of analyses associated with this entry.
    • editedimageids: Array of IDs of edited image associated with this entry.
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry.
    • comments: Freeform comments about this entry.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry. May not be present.
  • weeds: Array of weeds found. Weed record structs are as follows:
    • weedid: ID number for this weed.
    • common_name: Common name for the weed.
    • alt_common_name: Alternative common name, if any.
    • scientific_name: Scientific nomenclature for the weed.
    • type: Type of weed, may be "broadleaf" or "grass".
    • tr: Triazine resistant.
    • gr: Glyphosate resistant.
    • alsr: Acetolactate synthesis resistant.
    • accaser: Acetyl-CoA carboxylase inhibitor resistant.
    • size: Size of weed plants.
    • size_units: Units for size.
    • rating: Rating of the plant's occurrence in the field per area measured.
    • rating_units: Units for rating area.
    • percent_of_field: Percent of the field affected.
    • count: Number of weeds found per location or region.
    • density: Relative density of the weed.
    • stage: Growth stage of the weed.
    • location: Point location (in latlong NAD83) where this weed was found. OGC WKT format for point geometry.
    • region: Area location (in latlong NAD83) where this weed was found. OGC WKT format for polygon geometry.
    • photoids: Array of IDs of geotagged photos associated with this entry.
    • analysisids: Array of IDs of analyses associated with this entry.
    • editedimageids: Array of IDs of edited image associated with this entry.
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry.
    • comments: Freeform comments about this entry.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry. May not be present.

Event type "soiltesting":

  • testentries: Array of test entry record structs. Test entry record structs are as follows:
    • location: Point location (in latlong NAD83) where testing was performed. OGC WKT format for point geometry.
    • region: Area location (in latlong NAD83) where testing was performed. OGC WKT format for polygon geometry.
    • photoids: Array of IDs of geotagged photos associated with this entry.
    • analysisids: Array of IDs of analyses associated with this entry.
    • editedimageids: Array of IDs of edited image associated with this entry.
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry.
    • comments: Freeform comments about this entry.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry.

Event type "tillage":

  • area_tilled: Area tilled.
  • area_tilled_units: Units for area_tilled.




Tags:

exception:  ACCESS_DENIED User does not have permission to access object in OBJECTS.
exception:  PARAMETER_CONSTRAINT_VIOLATION OBJECTS array was empty.
access:  public


Parameters:

integer   $cropyear   Crop year for events.
struct   $objects   Struct of object types and IDs to examine.
boolean   $allversions   Return all versions of each event record if true. Defaults to false.

[ Top ]

static method get_pdfs [line 13617]

static struct get_pdfs( struct $typeitems, [struct $typeoptions = array()], [struct $pdfoptions = array()])

Generates and returns a set of PDF reports for the items specified in TYPEITEMS, collecting information for each item based on TYPEOPTIONS, and preparing the PDFs based on PDFOPTIONS.

TYPEITEMS is a struct keyed to the types of reportable items (as described below), with values being arrays of IDs for those items. Reportable item types are as follows:

  • notification: Any notification returned by the method get_notifications(). IDs are the notification IDs.
  • dataset: An analysis, spreadmap, or spreadpoint vector. Array values are structs, with two keys: "type", which is either "analysis" or "vector", and "id", which is the analysis ID or vector handle. Analyses and vectors must be saved to generate PDFs.

TYPEOPTIONS is a struct of options to be applied to each type of item, as appropriate for the type. Struct is keyed to the type, with values being structs of options, which vary by type, as follows:

  • notification: "include_table", boolean flag, includes a color-based acreage and value breakdown (default true), only applies to icue completion notifications; "include_hidden", as described for get_notifications(). For PDFs, the "include_previews" option is automatically set.
  • dataset: "include_table", boolean flag, includes a color-based acreage and attribute breakdown (default true).

PDFOPTIONS is a struct of options to apply to the set of PDFs as a whole, controlling generation of the PDFs themselves. Keys are as follows:

  • collect: How many PDFs to generate, and how to group together the information in each PDF. String, can be "object", "region", "group", "item", "type", or "all". Value "object" generates one PDF per geospatial object for which items are being reported in TYPEITEMS; "region" generates one PDF per region; "group" generates one PDF per group reported on in TYPEITEMS; "item" generates one PDF per item specified in TYPEITEMS; "type" generates one PDF per type specified in TYPEITEMS, with each item having one (or more) pages in the PDF; and "all" generates one PDF, with all items collected into the one PDF file. Exception: type "notification" in TYPEITEMS will not be grouped together with other types; for notifications, "item" is the highest level of grouping available. Default is "item".
  • coverpage: String. If set, each PDF will have a cover page as its first page; this is a static page that serves only as a cover. Can be one of two values: 'default' or 'custom'. If 'default', the Satshot default cover page is used; 'custom' means that a custom cover page (which must be provided to Satshot for storage) will be used, if one is available for the current user's group. If no custom page is available, 'custom' is treated as 'default'. Default value for this is not to be set.
  • toc: Boolean. If true, a table of contents will be generated for each PDF. Default is false.
  • return_urls: Boolean. If true, the returned struct will not contain the PDFs, but will instead contain URLs to PDF files in the current user's temporary space on the server for later download. These URLs will only be valid during the current session.




Tags:

access:  public


Parameters:

struct   $typeitems   Type - ID struct specifying items to report.
struct   $typeoptions   Type options struct, options for each type of item.
struct   $pdfoptions   PDF options, applied to output PDFs.

[ Top ]

static method get_raster_pdf [line 7858]

static base64 get_raster_pdf( string $mapcontext, array $imagehandles, [ $foruid = null])



Tags:

deprecated:  

This method is deprecated in favor of get_pdfs().

Generates and returns a PDF report mapping out the analyses or edited images in array IMAGEHANDLES, mapped using MAPCONTEXT. For best results, MAPCONTEXT should be for the state/province in which the analyzed fields exist, but it is not an error if this isn't the case.

IMAGEHANDLES is an array of image handles of analyses or edited images. These can be newly created, or previously saved and reloaded. Multiband analyses may not be used.

FORUID is for administrative use only. It is ignored for non-administrative users.

exception:  MAP_NOT_FOUND Map context does not exist.
exception:  IMAGEHANDLE_NOT_FOUND Given image handle does not exist.
access:  public


Parameters:

string   $mapcontext   The map context.
array   $imagehandles   List of image handles.
   $foruid  

[ Top ]

static method get_regions_info [line 1722]

static struct|array get_regions_info( array $regionids, [struct $options = array()])

Retrieves and returns information about the regions specified in array REGIONIDS, according to options OPTIONS. REGIONS is an array of region ids accessible to the current user.

OPTIONS is an optional struct with the following valid keys:

  • compact: Boolean. If true, the entire struct returned by this method will be serialized to a JSON string, for faster transmission time. This will require clients to parse the JSON string in order to use the data.
  • attribspec: Array. This array allows clients to request that only specific attributes (keys and values) be returned in the regions struct. If set, only the named attributes will be present, with all others omitted. If no attributes are specified, only an array of region ids will be returned (which is not very useful). Only "top-level" keys can be specified in this array, i.e., "objects" can be specified, but not just one part of the "objects" sub-struct values.

The returned struct is keyed to the region id, with values being as follows:

  • name: Name of the region.
  • description: A textual description of what sort of area of interest this region represents, such as a farm, unit, sales region, etc.
  • creatorid: Uid of the user who created this region. May or may not be a user the current user can see.
  • createtime: Date and time this region was created (ISO-8601 format).
  • extents: Extent of the region's geospatial objects as an extents struct (latlong). Empty if the region contains no objects.
  • private: Boolean. True if the region is only visible to the creator and to users in parent groups; false if the region is visible to any user who has access to objects within that region.
  • groupid: ID of the group to which this region is assigned, if any; this is used for assigning default access controls for objects added to a region. Region visibility is controlled by object access controls, so it is entirely possible for a region to have a groupid that does not correspond to a group visible to the current user.
  • objects: Struct of objects within this region; keyed to the object type (boundaries, locations, or paths), with values being structs keyed to the object IDs, and having values of structs with four fields: "name", the object name, "acreage", the acreage of the object, "centroid", the WKT of the object's center point, and "state", the state or province in which the object lies. Empty if the region contains no objects.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION Passed in an empty array for REGIONIDS.
access:  public


Parameters:

array   $regionids   Array of region ids.
struct   $options   Options struct. Optional.

[ Top ]

static method get_saved_datasets_for_objects [line 4662]

static struct get_saved_datasets_for_objects( array $hiliteids, [boolean $previews = false])

Returns a struct containing information on datasets saved to the hilited objects in HILITEIDS. HILITEIDS is an array of hilite ids corresponding to saved objects (boundaries, locations, or paths). The struct is keyed to the hilite ids, with values being dataset type structs. Possible keys (dataset types) are as follows:

  • analysis: Analyses, basic or customized (but not edited images).
  • editedimage: Edited images.
  • econ: Economic analysis calculations. (not implemented)
  • spreadmap: Vectorized spreadmaps.
  • spreadpoint: Point vector spreadmaps.
  • multibandpoint: Point vectors of multiband analyses.
  • soilmap: Soil vectors.
  • testpoint: Test point vectors.
  • grid: Field grid vectors.
  • striptrial: Strip trial vectors. (not implemented)
  • geophotos: Geotagged photos associated with the object.

Each key's value is a struct keyed to the IDs for the datasets of that type. The values of that struct are individual dataset structs. If the object does not have any datasets of a particular type, that key will not be present in the top-level struct.

If the object has no saved datasets, the value for that hilite id will be boolean false.

Dataset structs can have the following fields, depending on the type of dataset:

  • id OR handle: For analyses, edited images, or geotagged photos, "id" is the ID key for this dataset; for vectors, "handle" is the vector handle. Both will be equal to the key in the outer dataset type struct.
  • name: Name of this dataset. This is always present. For geotagged photos, this is the description.
  • createdate: Date and time this dataset was created (ISO 8601 format). Always present. For geotagged photos, this is the time of upload.
  • objecttype: Type of object to which this dataset was saved. Will be one of "boundaries", "locations", or "paths".
  • objectid: ID of object to which this dataset was saved.
  • srcimg: Source image for the analysis. Analyses only.
  • sourcesceneid: Scene ID for the source sceen for the analysis. Analyses only.
  • type: Type of analysis band. Analyses and edited images only.
  • numzones: Number of zones. Analyses, edited images, spreadmaps, and spreadpoints will have this.
  • numsoils: Number of distinct soil types in soilmap. Soilmaps only.
  • location: WKT point describing geotagged photo's location, in latlong NAD83. Geotagged photos only.
  • preview: PNG image preview of the dataset. Present only if PREVIEWS option is true.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION No hilite ids provided in HILITEIDS.
exception:  HILITE_NOT_FOUND No shapes hilited or given hilite ID does not exist.
exception:  REQUESTED_ITEM_NOT_FOUND Given hilite id does not correspond to permanently saved object.
access:  public


Parameters:

array   $hiliteids   Array of hilite ids corresponding to permanently saved geospatial objects.
boolean   $previews   Return preview images with dataset entries.

[ Top ]

static method get_scouting_master_tables [line 12250]

static struct get_scouting_master_tables( )

Returns a struct describing the master tables for the beneficial species, diseases, insects, and weeds used in scouting report records.

Struct has four keys: "beneficial", "disease", "insect", and "weed", with values being arrays of record structs for each type. The arrays will be sorted by the common_name.

Beneficial record structs:

  • beneficialid: ID number for this beneficial species.
  • common_name: Common name for the beneficial species.
  • alt_common_name: Alternative common name, if any.
  • scientific_name: Scientific nomenclature for the beneficial species.

Disease record structs:

  • diseaseid: ID number for this disease.
  • crop: Crop or crops this disease affects.
  • part: Part of plant disease infects.
  • common_name: Common name for the disease.
  • scientific_name: Scientific nomenclature for the disease.
  • class: Classification of disease, may be "bacteria", "virus", "fungus", or "unknown".

Insect record structs:

  • insectid: ID number for this insect.
  • crop: Crop or crops this insect preys upon.
  • common_name: Common name for this insect.
  • alt_common_name: Alternative common name, if any.
  • scientific_name: Scientific nomenclature for the insect.

Weed record structs:

  • weedid: ID number for this weed.
  • common_name: Common name for the weed.
  • alt_common_name: Alternative common name, if any.
  • scientific_name: Scientific nomenclature for the weed.




Tags:

access:  public


[ Top ]

static method get_scouting_table_inputs [line 12270]

static struct get_scouting_table_inputs( )

Returns a struct describing the allowed inputs for certain restricted string columns in the various scouting tables.

The tables in question are "scouting" (the main table), "beneficials", "crop_growth", "diseases", "insects", and "weeds".

Returned struct is keyed to the table name, with values being column structs for each table.

Column structs are keyed to the column name, with values being the valid values for that column.




Tags:

access:  public


[ Top ]

static method get_vector_attribute_table [line 5875]

static array get_vector_attribute_table( string $vechandle, [string $criterion = 'zone'], [boolean $namesonly = false])

Returns the attribute table for the vector VECHANDLE, with rows grouped according to CRITERION: 'row' means all attributes for all rows of the table are returned, while an attribute name will group the rows by that attribute. If a requested CRITERION attribute does not exist in the table, the results will be grouped by 'row'.

CRITERION must not correspond to a null attribute, or one that contains null values.

The table is returned as a struct, keyed the criterion used (row number for row, attribute value otherwise), with each array element being a struct keyed to column names, with values of column values. Which attributes will be present in the table will vary, but row-based tables always contain a column called 'gid', which is the primary key. For vector spreadmaps, the following will always be present:

  • zone: The zone number.
  • zone_area: Area of the zone.
  • zone_color: Color tuple used to represent this zone.
  • poly_area: Area of the polygon represented by this row. Only present for row-based tables which contain polygon geometries.

Other attributes added by users with access to this table will also be present, if they exist. Any attributes with null values will NOT be present in the given row.

If NAMESONLY is true, the returned array is a simple list of the attribute names available in the table. This is useful for determining which attributes are present in the table.




Tags:

exception:  VECTOR_NOT_FOUND Vector handle does not exist.
access:  public


Parameters:

string   $vechandle   The vector handle.
string   $criterion   Criterion to generate table: can be 'row' or an attribute.
boolean   $namesonly   Whether to return only the column names or the full table. Defaults to false (full table).

[ Top ]

static method get_vector_metadata [line 6006]

static struct get_vector_metadata( string $vechandle, [struct $options = array()])

Returns metadata about the vector VECHANDLE. The metadata is returned as a struct, as follows:

  • name: Name of the vector. Not present for unsaved vectors.
  • createdate: Date and time the vector was created and saved. Not present for unsaved vectors.
  • type: Data type of the vector (e.g., 'spreadmap', 'soilmap').
  • classitem: Name of column on which this vector is classified (e.g., zone for spreadmaps, mukey for soilmaps).
  • numclasses: Number of distinct classes in this vector (number of zones for spreadmaps, number of soils for soilmaps, etc.) If "classitem" is "gid", this is the number of distinct shapes (rows).
  • columns: List of column structs. Each column struct describes one column of the vector's attribute table, as follows:
    • name: Column name.
    • type: Column type. Will be "string" or "numeric".
    • reserved: Boolean. Whether this is a "reserved" attribute that cannot be changed.
  • extents: Extents of the vector (in latlong/NAD83).
  • zones: Array of zone information structs, provided only for spreadmaps. Each struct has the following keys:
    • zonenum: Zone number.
    • minval: Minimum value of this zone.
    • maxval: Maximum value of this zone.
    This data may not be available for older spreadmaps. If unavailable, or for non-spreadmaps, this will be an empty string.
  • objecttype: Type of object for which this vector was created. Will be one of "boundaries", "locations", or "paths".
  • objectid: ID of object for which this vector was created.
  • regionname: Name of the region for the object for which this vector was created.
  • objectname: Name of the object for which this vector was created.
  • preview: PNG image preview of the dataset. Present only if PREVIEWS option is true, and only for saved vectors.

OPTIONS is an optional struct of additional parameters. The following keys are supported:

  • previews: Boolean. If true, the PNG preview will be included in the returned struct. Defaults to false.
  • compact: Boolean. If true, the entire struct returned by this method will be serialized to a JSON string, for faster transmission time. This will require clients to parse the JSON string in order to use the data.




Tags:

exception:  VECTOR_NOT_FOUND Vector handle does not exist.
access:  public


Parameters:

string   $vechandle   The vector handle.
struct   $options   Options struct.

[ Top ]

static method get_vector_pdf [line 7979]

static base64 get_vector_pdf( string $mapcontext, array $veclist)



Tags:

deprecated:  

This method is deprecated in favor of get_pdfs().

Generates and returns a PDF report mapping out the vector datasets given in VECLIST, mapped using MAPCONTEXT. For best results, MAPCONTEXT should be for the state/province in which the fields exist, but it is not an error if this isn't the case.

VECLIST is an array of vector handles, as returned from get_saved_datasets_for_objects(). The vectors must be saved to objects to which the user has access.

exception:  MAP_NOT_FOUND Map context does not exist.
exception:  VECTOR_NOT_FOUND Vector handle does not exist.
exception:  ACCESS_DENIED Object not accessible to user.
access:  public


Parameters:

string   $mapcontext   The map context.
array   $veclist   List of vector handles.

[ Top ]

static method get_visible_groups [line 672]

static struct|string get_visible_groups( [boolean $compact = false], [struct $options = array()])

Returns a struct of info describing the groups visible to the current user. Users can see their own group, and the children of their group down to the bottom of their group hierarchy; they cannot see sibling groups (other groups with the same parent as their group), or subgroups of sibling groups.

If COMPACT is true, the struct will be serialized to a JSON string for faster transmission time. This will require clients to parse the JSON string in order to use the data.

OPTIONS is an optional struct with the following keys:

  • groupids: Array. If set, only groups with groupids contained in this array will be returned.
  • rootgroup: Integer. If set, returns the part of the visible group hierarchy starting from this groupid, instead of the top of the current user's hierarchy (the default).
  • toplevel_only: Boolean. If set, only the topmost group in the visible hierarchy will be returned, or (for administrators) only those groups which have no parent will be returned.
  • attribspec: Array. This array allows clients to request that only specific attributes (keys and values) be returned in the group description structs. If set, only the named attributes will be present in each group description struct, with all other keys omitted. If the array of attribute names is empty, then no attributes are returned, and the returned value is a flat array of groupids.

The struct returned is keyed to the groupid, with values being group description structs as follows:

  • name: The name of the group.
  • description: A textual description of what sort of business entity or organizational grouping this group represents.
  • parentid: The ID of the group which is the direct parent of this one. For top-level groups, this is empty.
  • contactusers: Array of user IDs of users who are the primary contacts for this group.
  • address: Street or mailing address, if applicable. Customer groups should always have this, others may or may not.
  • city: City.
  • state_province: State or province.
  • zip_postcode: ZIP or postal code.
  • country: Country.
  • phone: Phone number.
  • customer: Boolean. True if this group represents an entity which is a customer of Agri ImaGIS, and thus has its own accout balance. Customer groups which are children of other groups have separate subscription and credit balances from their parent. Members of parent groups can still see those records, subject to privileges.
  • creatorid: User ID of the creator of this group. The identified user may or may not be visible (administrators are not visible, for instance).
  • createtime: Date and time this group was created. Timestamp with time zone, ISO-8601 format.
  • additional_info: Struct of key-value pairs describing additional information about this group. Freeform, could contain any information useful to the group creators or members. This data does not have any direct effect on server-side code, and is only for informational purposes.
  • setby: User ID of the person who last set the group's privileges. As with creatorid, the identified user may or may not be visible to the current user.
  • settime: Date and time the group's privileges were last set. Timestamp with time zone, ISO-8601 format.
  • Group privilege flags, as described in Privilege Flags.
  • customerid: The groupid identifying the group which is this group's customer (has the account balance). For customer groups, this will be this group's groupid. For others, it will be the groupid of one of this group's parents, either the direct parent (equal to "parentid") or some group higher up the group hierarchy.
  • parents: Array of groupids of parent groups. This includes the direct parent (equal to "parentid"), as well as parents of the direct parent. For top-level groups, this will be empty.
  • children: Array of groupids of child groups, both direct subgroups (having this group's groupid as their parentid) and children of those subgroups. If this group has no children, this will be empty.
  • direct_children: Array of groupids of child groups which are direct subgroups (having this group's groupid as their parentid).
  • accessible_regions: Array of region ids of regions accessible to this group. If no regions are accessible, will be an empty string.
  • accessible_objects: Struct of objects accessible to this group, keyed to the object type, with values being arrays of object ids. If no objects are accessible, will be an empty string.




Tags:

exception:  ACCESS_DENIED Groupid given in rootgroup or groupids options not accessible to current user.
exception:  PARAMETER_CONSTRAINT_VIOLATION Invalid column specified in attribspec option.
access:  public


Parameters:

boolean   $compact   Return the data as a JSON string. Default false.
struct   $options   Struct of options for querying the groups tree. Optional.

[ Top ]

static method get_visible_users [line 8069]

static struct get_visible_users( [boolean $showdisabled = false], [boolean $compact = false], [ $options = array()])

Returns a struct of user info for all users visible to the current user, as defined by group membership. Only members of the current user's group, and subgroups of that group, are visible. Struct keys are the UIDs of the users, values are as defined for get_my_user_info(), except for the following keys, which will NOT be present: notification_settings, subscriptions, presets, client_preferences, customerinfo.

If SHOWDISABLED is true, then disabled users will be shown in the list; otherwise, they will be omitted.

If COMPACT is true, the struct will be serialized to a JSON string for faster transmission time. This will require clients to parse the JSON string in order to use the data.

OPTIONS is an optional struct with the following keys:

  • attribspec: Array. This array allows clients to request that only specific attributes (keys and values) be returned in the user description structs. If set, only the named attributes will be present in each user description struct, with all other keys omitted. If the array of attribute names is empty, then no attributes are returned, and the returned value is a flat array of uids.




Tags:

access:  public


Parameters:

boolean   $showdisabled   Show disabled users or not.
boolean   $compact   Return the data as a JSON string. Default false.
   $options  

[ Top ]

static method load_map [line 42]

static string load_map( string $thestate)

Loads the map named THESTATE. Returns the map context.

This function is crucial for working with maps, and should always be called as early as possible.




Tags:

exception:  MAP_NOT_FOUND Map was not found for given state name.
access:  public


Overrides core_api::load_map() (Loads the map named THESTATE. Returns the map context.)

Parameters:

string   $thestate   Name of the state to load. This can be either the two-letter name code, or the full name of the state. Case-insensitive.

[ Top ]

static method load_maps [line 104]

static struct load_maps( array $statelist)

As load_map(), but loads maps named in array STATELIST, and returns a struct of map contexts, keyed to the names from STATELIST. Names in STATELIST must be valid arguments to load_map().



Tags:

exception:  MAP_NOT_FOUND Map was not found for given state name.
access:  public


Overrides core_api::load_maps() (As load_map(), but loads maps named in array STATELIST, and returns a struct of map contexts, keyed to the names from STATELIST. Names in STATELIST must be valid arguments to load_map().)

Parameters:

array   $statelist   List of map names.

[ Top ]

static method prepare_new_autoanalysis_jobs_from_matches [line 10593]

static struct prepare_new_autoanalysis_jobs_from_matches( array $matchids, [struct $boundaryidmapping = array()])

Prepares new autoanalysis jobs for the match records identified in array MATCHIDS. The identified match records must belong to the current user. Each new job will be created using the current user's presets, or default settings if the user has no presets. The new jobs will be in the "wait" state; a new notification will NOT be created for the new jobs, as they are part of existing matches.

BOUNDARYIDMAPPING, if provided, is a struct keyed to the match id, with values being arrays of boundary ids. The boundary ids provided for each match must be a subset of the boundary ids found in the match record; this mechanism is provided to allow the user to prepare jobs on only a part of the set of matched boundaries.

Returns a struct keyed to the match id, with values being the new job tokens. As the jobs are in "wait" state, the client will need to call approve_autoanalysis_jobs() to run them.

Use of this method requires the "autoanalysis" privilege.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION Empty array passed for MATCHIDS, or invalid match id in MATCHIDS, or boundary id in BOUNDARYIDMAPPING not in given match.
exception:  ACCESS_DENIED User does not have permission to access boundaries, or user does not have permission to access matches.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "autoanalysis" privilege.
access:  public


Parameters:

array   $matchids   Array of match ids.
struct   $boundaryidmapping   Match-boundary mapping struct.

[ Top ]

static method process_creditcard_payment [line 9518]

static double process_creditcard_payment( mixed $amount, string $cardnumber, string $expdate, [string $cvv = ''], [boolean $imagerypayment = false], [string $paymentreason = ''])

Processes a credit card payment of AMOUNT in US dollars, using the CARDNUMBER, EXPDATE, and CVV provided, for the current user's customer group.

Use of this method requires the "make_payments" privilege.

Card payments are validated and processed through Authorize.net. The cardholder's CVV, address, and zip code are used for validation.

Returns the new balance for the customer if payment is successful. In the case of a validation failure, invalid card number, insufficient funds, or other failure which causes the transaction to be declined, an error is signalled.




Tags:

exception:  INSUFFICIENT_PRIVILEGES User not permitted to make payments.
exception:  PARAMETER_CONSTRAINT_VIOLATION Amount must be positive, or card number invalid.
exception:  DATABASE_ERROR Database reported an error.
exception:  TRANSACTION_DECLINED Transaction was declined by processor.
access:  public


Parameters:

mixed   $amount   Payment amount in US dollars.
string   $cardnumber   Credit card number with no spaces or dashes.
string   $expdate   Expiration date, four digits, no spaces or separators.
string   $cvv   CVV code on the credit card.
boolean   $imagerypayment   Ignored; backwards compatibility only.
string   $paymentreason   Comment stating the reason for this payment. Optional, defaults to empty.

[ Top ]

static method query_map_layer_at_map_coordinate [line 373]

static struct|boolean query_map_layer_at_map_coordinate( string $mapcontext, double $xcord, double $ycord, mixed $layer, [string $coordsys = "+init=EPSG:4269"], [double $tolerance = 0])

Queries the layer identified by LAYER in map MAPCONTEXT, at the point defined by map coordinates XCORD and YCORD, and returns attribute information about any intersecting vectors at that point. XCORD and YCORD must be in latlong NAD83 (EPSG 4269) unless COORDSYS is specified. LAYER may be the index number or the name of the layer to query. LAYER must identify a vector layer; this function does not support querying raster layers.

If TOLERANCE is greater than 0, the layer query will also look for shapes which are within TOLERANCE meters of the point. This allows for "inexact" matches.

Returns a struct keyed to the permanent ID of the shapes in the layer, with values being per-shape attribute structs. The exact keys and values of these attribute structs will vary by layer. Each attribute struct will contain an extents struct for the shape's extents, keyed to "extents".

If no results found, returns false.

This MAPCENTER_API version returns object information as given for the 'objects' key in the struct returned by get_accessible_regions_and_objects() when querying one of the object layers ("boundaries", "locations", or "paths"); otherwise, attributes returned are those of the shape directly.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION Raster query not supported, or tolerance distance cannot be negative, or coordinate system specified was not recognized as valid.
exception:  MAP_NOT_FOUND Map context does not exist.
exception:  LAYER_NOT_FOUND Layer given does not exist in map context.
access:  public


Overridden in child classes as:

clu_mapcenter_api::query_map_layer_at_map_coordinate()
Queries the layer identified by LAYER in map MAPCONTEXT, at the point defined by map coordinates XCORD and YCORD, and returns attribute information about any intersecting vectors at that point. XCORD and YCORD must be in latlong NAD83 (EPSG 4269) unless COORDSYS is specified. LAYER may be the index number or the name of the layer to query. LAYER must identify a vector layer; this function does not support querying raster layers.

Overrides core_api::query_map_layer_at_map_coordinate() (Queries the layer identified by LAYER in map MAPCONTEXT, at the point defined by map coordinates XCORD and YCORD, and returns attribute information about any intersecting vectors at that point. XCORD and YCORD must be in latlong NAD83 (EPSG 4269) unless COORDSYS is specified. LAYER may be the index number or the name of the layer to query. LAYER must identify a vector layer; this function does not support querying raster layers.)

Parameters:

string   $mapcontext   The map context.
double   $xcord   X coordinate (longitude for latlong).
double   $ycord   Y coordinate (latitude for latlong).
mixed   $layer   Layer index number or layer name.
string   $coordsys   Coordinate system (WKT or proj4) of the output. Defaults to latlong NAD83.
double   $tolerance   Tolerance distance in meters. Defaults to 0.

[ Top ]

static method query_map_layer_at_pixel_point [line 432]

static struct|boolean query_map_layer_at_pixel_point( string $mapcontext, integer $xpoint, integer $ypoint, mixed $layer, [double $pixeltolerance = 0])

Queries the layer identified by LAYER in map MAPCONTEXT, at the pixel coordinates XPOINT and YPOINT, and returns attribute information about any intersecting vectors at that point. XPOINT must be in range 0 .. map width, YPOINT in range 0 .. map height. Coordinate 0,0 is top left corner of the map. LAYER must identify a vector layer; this function does not support querying raster layers.

If PIXELTOLERANCE is greater than 0, the layer query will also look for shapes which are within PIXELTOLERANCE pixels of the pixel point. This allows for "inexact" matches.

Returns a struct keyed to the permanent ID of the shapes in the layer, with values being per-shape attribute structs. The exact keys and values of these attribute structs will vary by layer. Each attribute struct will contain an extents struct for the shape's extents, keyed to "extents".

If no results found, returns false.

This MAPCENTER_API version returns object information as given for the 'objects' key in the struct returned by get_accessible_regions_and_objects() when querying one of the object layers ("boundaries", "locations", or "paths"); otherwise, attributes returned are those of the shape directly.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION Raster query not supported, or tolerance distance cannot be negative.
exception:  MAP_NOT_FOUND Map context does not exist.
exception:  LAYER_NOT_FOUND Layer given does not exist in map context.
access:  public


Overridden in child classes as:

clu_mapcenter_api::query_map_layer_at_pixel_point()
Queries the layer identified by LAYER in map MAPCONTEXT, at the pixel coordinates XPOINT and YPOINT, and returns attribute information about any intersecting vectors at that point. XPOINT must be in range 0 .. map width, YPOINT in range 0 .. map height. Coordinate 0,0 is top left corner of the map. LAYER may be the index number or the name of the layer to query. LAYER must identify a vector layer; this function does not support querying raster layers.

Overrides core_api::query_map_layer_at_pixel_point() (Queries the layer identified by LAYER in map MAPCONTEXT, at the pixel coordinates XPOINT and YPOINT, and returns attribute information about any intersecting vectors at that point.)

Parameters:

string   $mapcontext   The map context.
integer   $xpoint   X coordinate of pixel position.
integer   $ypoint   Y coordinate of pixel position.
mixed   $layer   Layer index number or layer name.
double   $pixeltolerance   Tolerance distance in pixels. Defaults to 0.

[ Top ]

static method query_map_layer_with_layer_shapes [line 565]

static struct query_map_layer_with_layer_shapes( string $mapcontext, mixed $targetlayer, mixed $sourcelayer, array $ids)

Queries the layer identified by TARGETLAYER in map MAPCONTEXT, using the shapes identified by integer IDs in array IDS, which are contained in the layer SOURCELAYER. For each shape from SOURCELAYER in IDS, attribute information for the intersecting shapes from TARGETLAYER will be returned. SOURCELAYER and TARGETLAYER may be the index numbers or the names of the layers. They must identify vector layers; this function does not support querying raster layers.

Returns a struct keyed to the ID of each shape from SOURCELAYER in IDS, with the values being a struct keyed to the ID of each found shape in TARGETLAYER; values of those structs will be per-shape attribute structs. The exact keys and values of these attribute structs will vary by TARGETLAYER. Each attribute struct will contain an extents struct for the shape's extents, keyed to "extents". It will also contain a field "intersect_area", which describes the area of the intersection between the shapes from SOURCELAYER and from TARGETLAYER, in square meters.

If no results are found for a given shape from SOURCELAYER, the value of that ID in the returned struct will be boolean false.

This MAPCENTER_API version returns object information as given for the 'objects' key in the struct returned by get_accessible_regions_and_objects() when querying one of the object layers ("boundaries", "locations", or "paths"); otherwise, attributes returned are those of the shape directly. The "intersect_area" struct field will be present in the results for fields.




Tags:

exception:  MAP_NOT_FOUND Map context does not exist.
exception:  LAYER_NOT_FOUND Source or target layer given does not exist in map context.
exception:  BAD_SEARCH_REQUEST Shape ID does not exist in source layer.
exception:  PARAMETER_CONSTRAINT_VIOLATION Raster query not supported, or no IDs provided for source layer, or IDs not integers.
access:  public


Overridden in child classes as:

clu_mapcenter_api::query_map_layer_with_layer_shapes()
Queries the layer identified by TARGETLAYER in map MAPCONTEXT, using the shapes identified by integer IDs in array IDS, which are contained in the layer SOURCELAYER. For each shape from SOURCELAYER in IDS, attribute information for the intersecting shapes from TARGETLAYER will be returned. SOURCELAYER and TARGETLAYER may be the index numbers or the names of the layers. They must identify vector layers; this function does not support querying raster layers.

Overrides core_api::query_map_layer_with_layer_shapes() (Queries the layer identified by TARGETLAYER in map MAPCONTEXT, using the shapes identified by integer IDs in array IDS, which are contained in the layer SOURCELAYER. For each shape from SOURCELAYER in IDS, attribute information for the intersecting shapes from TARGETLAYER will be returned. SOURCELAYER and TARGETLAYER may be the index numbers or the names of the layers. They must identify vector layers; this function does not support querying raster layers.)

Parameters:

string   $mapcontext   The map context.
mixed   $targetlayer   Layer index number or layer name of target layer.
mixed   $sourcelayer   Layer index number or layer name of source layer.
array   $ids   Array of shape IDs for shapes from SOURCELAYER.

[ Top ]

static method query_multiple_map_layers_at_map_coordinate [line 490]

static struct|boolean query_multiple_map_layers_at_map_coordinate( string $mapcontext, double $xcord, double $ycord, array $layerlist, [string $coordsys = "+init=EPSG:4269"], [double $tolerance = 0])

As query_map_layer_at_map_coordinate(), but queries each of the layers given in array LAYERLIST; all other arguments are as for query_map_layer_at_map_coordinate().

Returns a struct keyed to the layer name or ID of each layer queried in LAYERLIST, with values being the query structs as returned by query_map_layer_at_map_coordinate(), or boolean false if the query of that layer returned no shapes.

This MAPCENTER_API version returns object information as given for the 'objects' key in the struct returned by get_accessible_regions_and_objects() when querying one of the object layers ("boundaries", "locations", or "paths"); otherwise, attributes returned are those of the shape directly.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION Raster query not supported, or tolerance distance cannot be negative, or coordinate system specified was not recognized as valid, or no layers provided in LAYERLIST.
exception:  MAP_NOT_FOUND Map context does not exist.
exception:  LAYER_NOT_FOUND Layer given does not exist in map context.
access:  public


Overridden in child classes as:

clu_mapcenter_api::query_multiple_map_layers_at_map_coordinate()
As query_map_layer_at_map_coordinate(), but queries each of the layers given in array LAYERLIST; all other arguments are as for query_map_layer_at_map_coordinate().

Overrides core_api::query_multiple_map_layers_at_map_coordinate() (As query_map_layer_at_map_coordinate(), but queries each of the layers given in array LAYERLIST; all other arguments are as for query_map_layer_at_map_coordinate().)

Parameters:

string   $mapcontext   The map context.
double   $xcord   X coordinate (longitude for latlong).
double   $ycord   Y coordinate (latitude for latlong).
array   $layerlist   Array of layer index numbers or layer names.
string   $coordsys   Coordinate system (WKT or proj4) of the output. Defaults to latlong NAD83.
double   $tolerance   Tolerance distance in meters. Defaults to 0.

[ Top ]

static method query_multiple_map_layers_at_pixel_point [line 524]

static struct|boolean query_multiple_map_layers_at_pixel_point( string $mapcontext, integer $xpoint, integer $ypoint, mixed $layerlist, [double $pixeltolerance = 0])

As query_map_layer_at_pixel_point(), but queries each of the layers given in array LAYERLIST; all other arguments are as for query_map_layer_at_pixel_point().

Returns a struct keyed to the layer name or ID of each layer queried in LAYERLIST, with values being the query structs as returned by query_map_layer_at_pixel_point(), or boolean false if the query of that layer returned no shapes.

This MAPCENTER_API version returns object information as given for the 'objects' key in the struct returned by get_accessible_regions_and_objects() when querying one of the object layers ("boundaries", "locations", or "paths"); otherwise, attributes returned are those of the shape directly.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION Raster query not supported, or tolerance distance cannot be negative, or no layers provided in LAYERLIST.
exception:  MAP_NOT_FOUND Map context does not exist.
exception:  LAYER_NOT_FOUND Layer given does not exist in map context.
access:  public


Overridden in child classes as:

clu_mapcenter_api::query_multiple_map_layers_at_pixel_point()
As query_map_layer_at_pixel_point(), but queries each of the layers given in array LAYERLIST; all other arguments are as for query_map_layer_at_pixel_point().

Overrides core_api::query_multiple_map_layers_at_pixel_point() (As query_map_layer_at_pixel_point(), but queries each of the layers given in array LAYERLIST; all other arguments are as for query_map_layer_at_pixel_point().)

Parameters:

string   $mapcontext   The map context.
integer   $xpoint   X coordinate of pixel position.
integer   $ypoint   Y coordinate of pixel position.
mixed   $layerlist   Layer index number or layer name.
double   $pixeltolerance   Tolerance distance in pixels. Defaults to 0.

[ Top ]

static method record_ssr_transaction [line 9741]

static numeric record_ssr_transaction( int $gid, int $shapeID)

Records a SSR index transaction and returns the balance.



Tags:

access:  public


Parameters:

int   $gid   ID of the sceneindex record that was created for the SSR image
int   $shapeID  

[ Top ]

static method reload_multiple_saved_analyses [line 4346]

static struct reload_multiple_saved_analyses( string $mapcontext, array $analysisids)

As reload_saved_analysis(), but reloads multiple analyses as specified in array ANALYSISIDS.

Returns a struct keyed to the analysis IDs, with values being the corresponding image handles.

The analyses must belong to objects to which the user has access.




Tags:

exception:  MAP_NOT_FOUND Map context does not exist.
exception:  HILITE_NOT_FOUND No shapes hilited or given hilite ID does not exist.
exception:  DATASET_NOT_FOUND Saved analysis ID does not exist.
exception:  ACCESS_DENIED Analysis tied to object not accessible to user.
access:  public


Parameters:

string   $mapcontext   The map context.
array   $analysisids   Array of analysis IDs.

[ Top ]

static method reload_multiple_saved_edited_images [line 4541]

static struct reload_multiple_saved_edited_images( array $imageids)

As reload_saved_edited_image(), but reloads multiple edited images as specified in array IMAGEIDS.

The edited image must belong to objects to which the user has access.

Returns a struct keyed to the image IDs, with values being the corresponding image handles.




Tags:

exception:  ACCESS_DENIED Image tied to object not accessible to user.
exception:  DATASET_NOT_FOUND Saved analysis ID does not exist.
access:  public


Parameters:

array   $imageids   Array of image IDs.

[ Top ]

static method reload_saved_analysis [line 4146]

static string reload_saved_analysis( string $mapcontext, integer $analysisid)

Reloads the saved analysis ANALYSISID from the database, using MAPCONTEXT. Returns the image handle of the reloaded analyzed image.

The analysis must belong to an object to which the user has access.




Tags:

exception:  MAP_NOT_FOUND Map context does not exist.
exception:  HILITE_NOT_FOUND No shapes hilited or given hilite ID does not exist.
exception:  DATASET_NOT_FOUND Saved analysis ID does not exist.
exception:  ACCESS_DENIED Analysis tied to object not accessible to user.
access:  public


Parameters:

string   $mapcontext   The map context.
integer   $analysisid   ID of the analysis.

[ Top ]

static method reload_saved_edited_image [line 4491]

static string reload_saved_edited_image( integer $imgid)

Reloads the saved edited image IMGID from the database. Returns the image handle of the reloaded edited image.

The edited image must belong to an object to which the user has access.




Tags:

exception:  ACCESS_DENIED Image tied to object not accessible to user.
exception:  DATASET_NOT_FOUND Saved analysis ID does not exist.
access:  public


Parameters:

integer   $imgid   The ID of the saved edited image dataset.

[ Top ]

static method remove_multiple_vector_display_layers [line 5836]

static boolean remove_multiple_vector_display_layers( string $mapcontext, array $veclist)

As remove_vector_display_layer(), but removes display layers for all vector handles in array VECLIST.

Returns true if all layers removed, false otherwise (one or more vector handles had no display layer).




Tags:

exception:  MAP_NOT_FOUND Map context does not exist.
exception:  VECTOR_NOT_FOUND Vector handle does not exist.
access:  public


Parameters:

string   $mapcontext   The map context.
array   $veclist   Array of vector handles.

[ Top ]

static method remove_vector_display_layer [line 5784]

static boolean remove_vector_display_layer( string $mapcontext, string $vechandle)

Removes the display layer for vector VECHANDLE from display on map MAPCONTEXT.

Returns true if the layer was removed, false if not (no such layer).




Tags:

exception:  MAP_NOT_FOUND Map context does not exist.
exception:  VECTOR_NOT_FOUND Vector handle does not exist.
access:  public


Parameters:

string   $mapcontext   The map context.
string   $vechandle   Vector handle.

[ Top ]

static method rename_objects [line 3198]

static boolean rename_objects( struct $objectnames)

Renames the objects specified in OBJECTNAMES to the given names. OBJECTNAMES is a struct keyed to the object type ("boundaries", "locations", or "paths"), with values being structs keyed to the objectid, having values of the new names for the objects.

If any of the objects are currently selected by the current session, a subsequent call to get_hilites() will reflect the new names. The new names will also be shown in calls to get_accessible_regions_and_objects().

Use of this method requires the "modify_geoobjects" privilege, and "modify" access to the objects specified. Additionally, the objects must not be in use (selected) by another session.

Returns true.




Tags:

exception:  ACCESS_DENIED Object not accessible to user, or user does not have "modify" access.
exception:  REQUESTED_ITEM_NOT_FOUND Given object does not exist.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "modify_geoobjects" privilege.
exception:  CONCURRENCY_VIOLATION One or more objects currently in use by more than one session.
access:  public


Parameters:

struct   $objectnames   Object names struct.

[ Top ]

static method rename_saved_datasets [line 4961]

static boolean rename_saved_datasets( struct $datasetlist)

Renames the saved datasets described in DATASETLIST, which is an array of structs describing each dataset. Struct fields are as follows:

  • type: Type of this dataset. Can be "analysis", "editedimage", or "vector". The "vector" type is used for all vector datasets.
  • id: The numeric ID (for analysis or editedimage) or vector handle (for vectors) of the dataset.
  • name: The new name to give this dataset.

For each dataset so specified, the name given in NAME will replace the current name. This change will be reflected in the values returned by get_saved_datasets_for_objects().

It is an error if one of the given datasets does not exist, or belongs to an object not accessible to the user; it is also an error if one of the given datasets belongs to an object which is in use (hilited) in more than one login session. In any of these cases, none of the given datasets will be renamed.

Returns true if all datasets were renamed, otherwise signals an error.

Use of this method requires the "modify_datasets" privilege, and "modify" access to the objects to which the datasets are saved.




Tags:

exception:  ACCESS_DENIED Dataset saved to object not accessible to user, or user does not have "modify" access.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "modify_datasets" privilege.
exception:  DATASET_NOT_FOUND Saved dataset does not exist.
exception:  PARAMETER_CONSTRAINT_VIOLATION Missing required parameter fields, or invalid dataset type.
exception:  CONCURRENCY_VIOLATION One or more datasets belong to objects currently in use by more than one session.
access:  public


Parameters:

struct   $datasetlist   List of dataset structs.

[ Top ]

static method save_analysis [line 3966]

static integer save_analysis( string $analysisname, string $imagehandle)

Saves the analyzed image IMAGEHANDLE to database under name ANALYSISNAME. All metadata associated with the analysis, and all information needed to recreate it, are also saved.

Reloading the saved analysis will require its permanent ID, which is available through get_saved_datasets_for_objects().

Use of this method requires the "save_datasets" privilege, and "append" access to the object analyzed.

Returns the permanent ID of the newly saved analysis.




Tags:

exception:  INSUFFICIENT_PRIVILEGES User does not have the "save_datasets" privilege.
exception:  IMAGEHANDLE_NOT_FOUND Image handle does not exist.
exception:  BAD_DATASET_TYPE Image is not analysis.
access:  public


Parameters:

string   $analysisname   Name to give the saved analysis.
string   $imagehandle   Image handle.

[ Top ]

static method save_edited_image [line 4376]

static boolean save_edited_image( string $imagename, string $imagehandle)

Saves the edited image IMAGEHANDLE to database under name IMAGENAME.

Reloading the saved image will require its permanent ID, which is available through get_saved_datasets_for_objects().

Use of this method requires the "save_datasets" privilege, and "append" access to the object analyzed.

Returns the permanent ID of the newly saved analysis.




Tags:

exception:  IMAGEHANDLE_NOT_FOUND Image handle does not exist.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "save_datasets" privilege.
access:  public


Parameters:

string   $imagename   Name to give the saved edited image.
string   $imagehandle   Image handle.

[ Top ]

static method save_group_fielddata_equipment_records [line 12125]

static array save_group_fielddata_equipment_records( array $equipment, integer $groupid)

Saves farming equipment records, described in array EQUIPMENT, for the group identified by GROUPID. GROUPID must identify the current user's group, or a child of that group.

EQUIPMENT is an array of equipment record structs, defined as follows:

  • name: Name of the equipment. String. Required.
  • make: Equipment manufacturer. String. Required.
  • model: Model of equipment. String.
  • year: Year equipment was made. Integer.
  • equipment_type: Description of the equipment type. String. Required.
  • equipid: ID for equipment record. Integer. Set this only if updating an existing equipment record. Otherwise, do not set.

If "equipid" is not set in the record struct, then a new record is created for that struct. Otherwise, an existing record is updated.

Returns an array of equipment IDs for the newly created records. The array will be ordered identically to the input EQUIPMENT array, so that the corresponding new identifying keys are in the same array positions. If a record was updated (not newly created), the ID will be the same.

Use of this method requires the "set_fielddata" privilege.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION EQUIPMENT array is empty.
exception:  MULTIPLE_ERRORS_DETECTED Multiple errors were found with equipment records, see reported errors for details.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "set_fielddata" privilege.
exception:  ACCESS_DENIED Given group is not accessible to current user.
access:  public


Parameters:

array   $equipment   Array of equipment record structs.
integer   $groupid   Group ID.

[ Top ]

static method save_hilited_objects [line 2381]

static struct|boolean save_hilited_objects( string $mapcontext, mixed $regionids, [boolean $update = false], [array $access = array()], [array $hiliteids = array()])



Tags:

deprecated:  

This method will continue to work, but is deprecated in favor of create_and_update_objects().

Saves currently hilited objects as permanent objects, of their appropriate types (boundaries, locations, and paths), and maps them to the region or regions given in REGIONIDS. REGIONIDS may be a single regionid, in which case it should be passed as a single integral value, or may be a struct mapping hilite IDs to regionids. In the latter case, the struct is keyed to hiliteids, with values being the regionids. In either case, the region or regions identified by REGIONIDS must be accessible to the current user.

Use of this method requires the "create_geoobjects" privilege; some options require other privileges in addition.

MAPCONTEXT is loaded to get information needed to save the objects.

If UPDATE is set, then existing objects which are hilited will be updated: their names will be changed, they will be mapped to new regions if the given regionids are different from their current regions, and their geometries will be updated to the hilite geometries (if different). This will not unmap the objects from existing regions. Setting UPDATE requires the "modify_geoobjects" privilege. (Note: while calling this method just to add new regions or access controls to an object will work, clients are better off calling create_region(), update_region(), or set_objects_access_controls(), to do so.)

Note that if objects were modified using the methods make_geometric_union_of_hilited_shapes(), make_geometric_intersection_of_hilited_shapes(), or make_geometric_symdifference_of_hilited_shapes(), the resulting hilited objects will not be directly associated with saved objects, but will be saved as new objects.

By default, the saved objects will have the following access controls: full access (append and modify) will be granted to the current user, and to parent groups, if any. ACCESS, if provided, is an array of access control structs, as documented for set_objects_access_controls(), except omitting the "object_type" and "objectid" fields (these will be provided by this method). These access control structs will be applied to the saved objects in addition to the defaults. Setting ACCESS requires the "change_object_acls" privilege.

NOTE: If ACCESS is provided to grant access to users or groups which are children of the current user's group, the region or regions specified in REGIONIDS must not be set to "private".

If the current user is an administrator, no access controls will be set by default; administrators must provide access control entries in ACCESS, or set them up later with set_objects_access_controls(), for the objects to be visible to non-administrative users.

If the optional HILITEIDS array is provided, only the hilites identified in the array will be saved. Otherwise, all currently hilited objects will be saved.

After calling this method, existing hilites will be removed from the hilite layer. Clients wanting to continue working with newly saved objects should select them using a selection method such as select_by_object_type_and_id().

Returns a struct keyed to the object types saved, with values being structs keyed to the hiliteids, and values being the objectids of the newly saved objects. If no objects were saved, returns false.

exception:  ACCESS_DENIED Given region or regions not accessible to current user.
exception:  INSUFFICIENT_PRIVILEGES User does not have privilege to create objects, or modify objects, or set access controls.
exception:  CONCURRENCY_VIOLATION Update set and one or more objects hilited by more than one user session.
exception:  INSUFFICIENT_BALANCE Insufficient credit balance to save attributed CLUs.
exception:  PARAMETER_CONSTRAINT_VIOLATION Malformed access control entries.
exception:  DATABASE_ERROR Database reported an error.
access:  public


Parameters:

string   $mapcontext   The map context.
mixed   $regionids   Regionid, or mapping of hilite IDs to regionids.
boolean   $update   Update existing objects if true.
array   $access   Array of access control structs. Optional.
array   $hiliteids   Array of hiliteids to save. Optional, if omitted all hilites are saved.

[ Top ]

static method save_multiple_analyses [line 4122]

static struct save_multiple_analyses( struct $namehandlestruct)

As save_analysis(), but saves all analyses with handles and names specified in struct NAMEHANDLESTRUCT. NAMEHANDLESTRUCT is keyed to the image handles, with values of the names under which to save each analysis.

Returns a struct keyed to the image handles, with values being the permanent IDs of the newly saved analyses.

Use of this method requires the "save_datasets" privilege, and "append" access to the objects analyzed.




Tags:

exception:  INSUFFICIENT_PRIVILEGES User does not have the "save_datasets" privilege.
exception:  IMAGEHANDLE_NOT_FOUND Image handle does not exist.
exception:  BAD_DATASET_TYPE Image is not analysis.
access:  public


Parameters:

struct   $namehandlestruct   Struct of image handles and names.

[ Top ]

static method save_multiple_edited_images [line 4471]

static struct save_multiple_edited_images( struct $namehandlestruct)

As save_edited_image(), but saves all edited images with handles and names specified in struct NAMEHANDLESTRUCT. NAMEHANDLESTRUCT is keyed to the image handles, with values of the names under which to save each edited image.

Use of this method requires the "save_datasets" privilege, and "append" access to the objects analyzed.

Returns a struct keyed to the image handles, with values being the permanent IDs of the newly saved edited images.




Tags:

exception:  IMAGEHANDLE_NOT_FOUND Image handle does not exist.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "save_datasets" privilege.
access:  public


Parameters:

struct   $namehandlestruct   Struct of image handles and names.

[ Top ]

static method save_multiple_vectors_to_multiple_objects [line 6667]

static boolean save_multiple_vectors_to_multiple_objects( struct $vecstruct)

As save_vector_to_object(), but saves multiple vector tables to (potentially) multiple objects, as specified in struct VECSTRUCT.

VECSTRUCT is keyed to the vector handle, with values being either strings, in which case they will be interpreted as names for the vector datasets, or description structs as follows:

  • name: Descriptive name for this vector dataset.
  • objecttype: Type of object ('boundaries', 'locations', or 'paths').
  • objectid: Permanent object ID for the object for this vector.
  • type: Dataset type for the vector.

Struct values are identical to the parameters for save_vector_to_object(). In the case where strings are provided, the "name" value will be the string, and the other values will be looked up internally. The struct-based format is provided in case clients need to override the defaults, or lookup fails (this should never be necessary, and the struct-format may be removed in future versions).

Each vector handle in VECSTRUCT will be saved to the given object, with the given name, and the given type. If any errors are signalled, none of the vectors will be saved.

Use of this method requires the "save_datasets" privilege, and "append" access to each of the objects to which the vectors will be saved.

Returns true.




Tags:

exception:  VECTOR_NOT_FOUND Vector handle does not exist.
exception:  BAD_TABLE_PARAMS Name cannot be empty.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "save_datasets" privilege.
exception:  ACCESS_DENIED Object not accessible to user, or user does not have "append" access to object.
access:  public


Parameters:

struct   $vecstruct   Vector description struct.

[ Top ]

static method save_object_fielddata_records [line 11841]

static array save_object_fielddata_records( integer $cropyear, array $events)

Creates and saves new event, scouting, or data records for the given CROPYEAR as described in the array EVENTS. EVENTS is an array of event description structs.

The event description structs vary by event type, but contain common fields, as follows. Required fields are labelled as such.

  • objecttype: Type of the object for this event. String, must be one of "boundaries", "locations", or "paths". Required.
  • objectid: ID of the object for this event. Must be an object to which the current user has access. Integer. Required.
  • eventname: Descriptive name for the event. String. Required, except for insurance; do not use for insurance.
  • eventtype: Type of event. String value, one of "crop_protection", "fertilizing", "harvest", "insurance", "irrigation", "planting", "scouting", "soiltesting", or "tillage". Required.
  • operation_datetime: Date and time the event took place. String value. Required, and should be in ISO 8601 format for best results. Do not use for insurance.
  • id: ID number for this event. Integer. Required ONLY IF this event record is a new version of a previous record; otherwise, DO NOT set.
  • equipid: ID for equipment used in this operation. Refers to equipment records returned by get_group_fielddata_equipment_records(). Do not use for scouting or insurance events.
  • photoids: Array of IDs of geotagged photos associated with this event. Integer array, IDs are as returned by upload_geotagged_photo().
  • analysisids: Array of IDs of analyses associated with this event. Integer array, IDs are as returned by save_analysis().
  • editedimageids: Array of IDs of edited image associated with this event. Integer array, IDs are as returned by save_edited_image().
  • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this event. String array, handles are as returned by the vector creation methods.
  • comments: All events have a freeform comments field for entering notes and other comments. String value with no length limit.
  • additional_attribs: A structure of additional, arbitrary keys and values set on the event. Keys and values must be strings. These values are not checked for validity!

The event description structs have additional fields which vary by event type. Definitions for each are as follows. All of these fields are in addition to the above common fields! Note that any "units" fields MUST contain unit names as returned by get_fielddata_units(), and are required IF the measured value they correspond to is set. Again, required fields are labelled as such.

Event type "crop_protection":

  • application_type: Text string describing the type of application. String.
  • application_method: Text describing the application method. String.
  • adjuvent: Adjuvent applied, if any. String.
  • adjuvent_rate: Rate of adjuvent application. Numeric.
  • adjuvent_rate_units: Units for adjuvent_rate. String, must be a unit symbol from get_fielddata_units(). Required if adjuvent_rate is set.
  • adjuvent_rate_area_units: Units for the area to which adjuvent_rate applies. String, must be a unit symbol from get_fielddata_units(). Required if adjuvent_rate is set.
  • water_volume: Volume of water used in application. Numeric.
  • water_volume_units: Units for water_volume. String, must be a unit symbol from get_fielddata_units(). Required if water_volume is set.
  • water_volume_area_units: Units for the area to which water_volume applies. String, must be a unit symbol from get_fielddata_units(). Required if water_volume is set.
  • air_temp: Air temperature during application. Numeric.
  • air_temp_units: Units for air_temp. String, must be a unit symbol from get_fielddata_units(). Required if air_temp is set.
  • relative_humidity: Relative humidity during application. Numeric.
  • wind_speed: Wind speed during application. Numeric.
  • wind_speed_units: Units for wind_speed. String, must be a unit symbol from get_fielddata_units(). Required if wind_speed is set.
  • wind_speed_direction: Compass direction of wind in degrees. Numeric. Client applications should translate this from cardinal directions.
  • products: Array of products used in this application. Optional, but if present, the required fields are noted. Product records for crop_protection are as follows:
    • product: Name of the product used. String. Required for each product.
    • rate: Rate of product application. Numeric. Required for each product.
    • units: Units for rate. String, must be a unit symbol from get_fielddata_units(). Required for each product.
    • area_units: Units for area to which rate applies. String, must be a unit symbol from get_fielddata_units(). Required for each product.
    • additional_attribs: A structure of additional, arbitrary keys and values set on the product. Keys and values must be strings. These values are not checked for validity!

Event type "fertilizing":

  • application_type: Text string describing the type of application. String.
  • application_method: Text describing the application method. String.
  • products: Array of products used in this application. Optional, but if present, the required fields are noted. Product records for crop_protection are as follows:
    • fertilizer: Name of the fertilizer used. String. Required for each fertilizer product.
    • type: Type of fertilizer. String.
    • rate: Rate of product application. Numeric. Required for each fertilizer product.
    • units: Units for rate. String, must be a unit symbol from get_fielddata_units(). Required for each fertilizer product.
    • area_units: Units for area to which rate applies. String, must be a unit symbol from get_fielddata_units(). Required for each fertilizer product.
    • n: Nitrogen percentage. Numeric.
    • p: Phosphorus percentage. Numeric.
    • k: Potassium percentage. Numeric.
    • s: Sulfur percentage. Numeric.
    • additional_attribs: A structure of additional, arbitrary keys and values set on the product. Keys and values must be strings. These values are not checked for validity!

Event type "harvest":

  • crop: Name of the crop. String. Required.
  • variety: Variety of the crop. String.
  • yield: Yield of crop. Numeric.
  • yield_units: Units for yield. String, must be a unit symbol from get_fielddata_units(). Required if yield is set.
  • yield_area_units: Units for the area to which yield applies. String, must be a unit symbol from get_fielddata_units(). Required if yield is set.
  • grade: Grade of crop. String.
  • quality: Crop quality. String.
  • dockage: Dockage (if applicable). Numeric.
  • kernel_weight: Weight of kernels (if applicable). Numeric.
  • kernel_weight_units: Units for kernel_weight. String, must be a unit symbol from get_fielddata_units(). Required if kernel_weight is set.
  • protein_content: Protein content of crop (if applicable). Numeric.
  • oil_content: Oil content of crop (if applicable). Numeric.
  • green_seed_content: Number of green seeds. Numeric.
  • falling_numbers: Falling numbers. Numeric.
  • weather_conditions: Weather conditions during harvest. String.
  • moisturepercent: Moisture percentage of harvested crop. Numeric.

Event type "insurance":

  • insuranceyear: Year for which this insurance is in effect. Integer. Required.
  • prevented_planting: Array of prevented planting insurance unit records. Optional, but if present, required elements are noted. Prevented planting structs are as follows:
    • unit_number: Unit number. Required.
    • unit_type: Unit type. String. May be one of "EU" (Enterprise Unit), "OU" (Optional Unit), "BU" (Basic Unit), or "WFU" (Whole Farm Unit). Required.
    • cropcode: FCIC crop code, as returned by get_fcic_crop_types(). Integer. Required.
    • practicecode: FCIC practice code, as returned by get_fcic_crop_types(). Integer. Required.
    • typecode: FCIC type code, as returned by get_fcic_crop_types(). Integer. Required.
    • acres: Acres insured. Numeric. Required.
    • land_description: Legal land description.
    • photoids: Array of IDs of geotagged photos associated with this entry.
    • analysisids: Array of IDs of analyses associated with this entry.
    • editedimageids: Array of IDs of edited image associated with this entry.
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry.
    • comments: Freeform comments about this entry.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry.

Event type "irrigation":

  • irrigation_type: Type of irrigation. String.
  • water_applied: Amount of water applied. Numeric.
  • water_applied_units: Units for water_applied. String, must be a unit symbol from get_fielddata_units(). Required if water_applied is set.
  • water_applied_area_units: Units for the area to which water_applied applies. String, must be a unit symbol from get_fielddata_units(). Required if water_applied is set.

Event type "planting":

  • crop: Crop planted. String. Required.
  • seed_company: Company seeds were purchased from. String.
  • variety_hybrid: Variety or hybrid. String.
  • seeding_method: Method of seeding. String, must be one of "conventional" or "variablerate". Required, defaults to "conventional".
  • seeding_rate: Rate of seeding. Numeric.
  • seeding_rate_units: Units for seeding rate. String, must be a unit symbol from get_fielddata_units(). Required if seeding_rate is set.
  • seeding_rate_area_units: Units for the area to which seeding rate applies. String, must be a unit symbol from get_fielddata_units(). Required if seeding_rate is set.
  • planting_depth: Depth seeds were planted. Numeric.
  • planting_depth_units: Units for planting_depth. String, must be a unit symbol from get_fielddata_units(). Required if planting_depth is set.
  • tillage_method: Method of tillage before/during planting. String, must be one of "notill", "striptill", or "fulltill".
  • weather_conditions: Weather conditions during planting. String.

Event type "scouting":

  • crop_growth_stage: Crop growth stage. Average for the whole field. For localized measurements, see crop_growth array. String.
  • stand_count: Stand count. Average for the whole field. For localized measurements, see crop_growth array. Integer.
  • stand_count_area_units: Unit of area for stand_count. String, must be a unit symbol from get_fielddata_units(). Required if stand_count is set.
  • plant_height: Height of plants. Average for the whole field. For localized measurements, see crop_growth array. Numeric.
  • plant_height_units: Units for plant_height. String, must be a unit symbol from get_fielddata_units(). Required if plant_height is set.
  • crop_condition: Condition of crop. String.
  • soil_condition: Condition of soil. String.
  • weather_conditions: Weather conditions when field was scouted. String.
  • temperature: Temperature during scouting. Numeric.
  • temperature_units: Units for temperature. String, must be a unit symbol from get_fielddata_units(). Required if temperature is set.
  • recommendations: Recommendations for the grower. String.
  • beneficials: Array of beneficial species found. Optional, but if present, required elements are noted. Beneficial record structs are as follows:
    • beneficialid: ID number for this beneficial species. Refer to master beneficial table from get_scouting_master_tables(). Required.
    • rating: Rating of the beneficial species in the field per area measured. Numeric.
    • rating_units: Units for rating area. String, must be a unit symbol from get_fielddata_units(). Required if rating is set.
    • density: Relative density of the beneficial species. String.
    • stage: Stage of the beneficial species life cycle. String.
    • location_on_plant: Location of the beneficial species on the plant. String.
    • count: Count of beneficial species per location or region. Numeric.
    • location: Point location (in latlong NAD83) where this beneficial species was found. String, must conform to OGC WKT format for point geometry.
    • region: Area location (in latlong NAD83) where this beneficial species was found. String, must conform to OGC WKT format for polygon geometry.
    • photoids: Array of IDs of geotagged photos associated with this entry. Integer array, IDs are as returned by upload_geotagged_photo().
    • analysisids: Array of IDs of analyses associated with this entry. Integer array, IDs are as returned by save_analysis().
    • editedimageids: Array of IDs of edited image associated with this entry. Integer array, IDs are as returned by save_edited_image().
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry. String array, handles are as returned by the vector creation methods.
    • comments: Freeform comments about this entry. String.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry. Keys and values must be strings. These values are not checked for validity!
  • crop_growth: Array of crop growth measurements taken. Optional, but if present, required elements are noted. Crop growth record structs are as follows:
    • crop_growth_stage: Description of the growth stage. String.
    • stand_count: Stand count. Integer.
    • stand_count_area_units: Unit of area for stand_count. String, must be a unit symbol from get_fielddata_units(). Required if stand_count is set.
    • plant_height: Height of plants. Numeric.
    • plant_height_units: Units for plant_height. String, must be a unit symbol from get_fielddata_units(). Required if plant_height is set.
    • location: Point location (in latlong NAD83) where this crop growth measurement was taken. String, must conform to OGC WKT format for point geometry.
    • region: Area location (in latlong NAD83) where this crop growth measurement was taken. String, must conform to OGC WKT format for polygon geometry.
    • photoids: Array of IDs of geotagged photos associated with this entry. Integer array, IDs are as returned by upload_geotagged_photo().
    • analysisids: Array of IDs of analyses associated with this entry. Integer array, IDs are as returned by save_analysis().
    • editedimageids: Array of IDs of edited image associated with this entry. Integer array, IDs are as returned by save_edited_image().
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry. String array, handles are as returned by the vector creation methods.
    • comments: Freeform comments about this entry. String.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry. Keys and values must be strings. These values are not checked for validity!
  • custom: Array of custom scouting records, for items or issues that are not covered under the other categories. Optional, but if present, required elements are noted. Custom record structs are as follows:
    • name: Name of this custom record. String. Required.
    • location: Point location (in latlong NAD83) where this item was found. String, must conform to OGC WKT format for point geometry.
    • region: Area location (in latlong NAD83) where this item was found. String, must conform to OGC WKT format for polygon geometry.
    • photoids: Array of IDs of geotagged photos associated with this entry. Integer array, IDs are as returned by upload_geotagged_photo().
    • analysisids: Array of IDs of analyses associated with this entry. Integer array, IDs are as returned by save_analysis().
    • editedimageids: Array of IDs of edited image associated with this entry. Integer array, IDs are as returned by save_edited_image().
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry. String array, handles are as returned by the vector creation methods.
    • comments: Freeform comments about this entry. String.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry. Keys and values must be strings. These values are not checked for validity!
  • diseases: Array of diseases found. Optional, but if present, required elements are noted. Disease record structs are as follows:
    • diseaseid: ID number for this disease. Refer to master disease table from get_scouting_master_tables(). Required.
    • rating: Rating of the disease in the field per area measured. Numeric.
    • rating_units: Units for rating area. String, must be a unit symbol from get_fielddata_units(). Required if rating is set.
    • density: Relative density of the disease. String.
    • stage: Stage of the disease life cycle. String.
    • location_on_plant: Location of the disease on the plant. String.
    • count: Count of diseased plants per location or region. Numeric.
    • percent_of_field: Percent of the field affected. Numeric.
    • location: Point location (in latlong NAD83) where this disease was found. String, must conform to OGC WKT format for point geometry.
    • region: Area location (in latlong NAD83) where this disease was found. String, must conform to OGC WKT format for polygon geometry.
    • photoids: Array of IDs of geotagged photos associated with this entry. Integer array, IDs are as returned by upload_geotagged_photo().
    • analysisids: Array of IDs of analyses associated with this entry. Integer array, IDs are as returned by save_analysis().
    • editedimageids: Array of IDs of edited image associated with this entry. Integer array, IDs are as returned by save_edited_image().
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry. String array, handles are as returned by the vector creation methods.
    • comments: Freeform comments about this entry. String.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry. Keys and values must be strings. These values are not checked for validity!
  • insects: Array of insects found. Optional, but if present, required elements are noted. Insect record structs are as follows:
    • insectid: ID number for this insect. Refer to master inesct table from get_scouting_master_tables(). Required.
    • pressure: Pressure the insect is placing on crop. String.
    • location_on_plant: Location of the insect on the plant. String.
    • count: Number of insects found per location or region. Numeric.
    • density: Relative density of the insect. String.
    • stage: Growth stage of insect. String.
    • percent_of_field: Percent of the field affected. Numeric.
    • location: Point location (in latlong NAD83) where this insect was found. String, must conform to OGC WKT format for point geometry.
    • region: Area location (in latlong NAD83) where this insect was found. String, must conform to OGC WKT format for polygon geometry.
    • photoids: Array of IDs of geotagged photos associated with this entry. Integer array, IDs are as returned by upload_geotagged_photo().
    • analysisids: Array of IDs of analyses associated with this entry. Integer array, IDs are as returned by save_analysis().
    • editedimageids: Array of IDs of edited image associated with this entry. Integer array, IDs are as returned by save_edited_image().
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry. String array, handles are as returned by the vector creation methods.
    • comments: Freeform comments about this entry. String.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry. Keys and values must be strings. These values are not checked for validity!
  • weeds: Array of weeds found. Optional, but if present, required elements are noted. Weed record structs are as follows:
    • weedid: ID number for this weed. Refer to master weed table from get_scouting_master_tables(). Required.
    • tr: Triazine resistant. Boolean.
    • gr: Glyphosate resistant. Boolean.
    • alsr: Acetolactate synthesis resistant. Boolean.
    • accaser: Acetyl-CoA carboxylase inhibitor resistant. Boolean.
    • size: Size of weed plants. Numeric.
    • size_units: Units for size. String, must be a unit symbol from get_fielddata_units(). Required if size is set.
    • rating: Rating of the plant's occurrence in the field per area measured. Numeric.
    • rating_units: Units for rating area. String, must be a unit symbol from get_fielddata_units(). Required if rating is set.
    • percent_of_field: Percent of the field affected. Numeric.
    • count: Count of weeds found per location or region. Numeric.
    • density: Relative density of the weed. String.
    • stage: Growth stage of the weed. String.
    • location: Point location (in latlong NAD83) where this weed was found. String, must conform to OGC WKT format for point geometry.
    • region: Area location (in latlong NAD83) where this weed was found. String, must conform to OGC WKT format for polygon geometry.
    • photoids: Array of IDs of geotagged photos associated with this entry. Integer array, IDs are as returned by upload_geotagged_photo().
    • analysisids: Array of IDs of analyses associated with this entry. Integer array, IDs are as returned by save_analysis().
    • editedimageids: Array of IDs of edited image associated with this entry. Integer array, IDs are as returned by save_edited_image().
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry. String array, handles are as returned by the vector creation methods.
    • comments: Freeform comments about this entry. String.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry. Keys and values must be strings. These values are not checked for validity!

Event type "soiltesting":

  • testentries: Array of test entry record structs. Optional, but if present, required elements are noted. Test entry record structs are as follows:
    • location: Point location (in latlong NAD83) where testing was performed. String, must conform to OGC WKT format for point geometry.
    • region: Area location (in latlong NAD83) where testing was performed. String, must conform to OGC WKT format for polygon geometry.
    • photoids: Array of IDs of geotagged photos associated with this entry. Integer array, IDs are as returned by upload_geotagged_photo().
    • analysisids: Array of IDs of analyses associated with this entry. Integer array, IDs are as returned by save_analysis().
    • editedimageids: Array of IDs of edited image associated with this entry. Integer array, IDs are as returned by save_edited_image().
    • vectorids: Array of handles of vectors (spreadmaps, soilmaps) associated with this entry. String array, handles are as returned by the vector creation methods.
    • comments: Freeform comments about this entry. String.
    • additional_attribs: A structure of additional, arbitrary keys and values set on this entry. Keys and values must be strings. These values are not checked for validity!

Event type "tillage":

  • area_tilled: Area tilled. Numeric.
  • area_tilled_units: Units for area_tilled. String, must be a unit symbol from get_fielddata_units(). Required if area_tilled is set.

If the client program passes in other keys in the event record struct, that are not recognized for the given event type, or do not exist for any event type, those keys and their values will be silently dropped.

Returns an array of structs describing the identifying keys of the new events. The structs have three fields: "id", the event's ID; "version", the version of the event; and "create_date", the creation timestamp for the event. The array will be ordered identically to the input EVENTS array, so that the corresponding new identifying keys are in the same array positions. If the record could not be created because of errors, the error string will be returned instead. Check the type of the array value and examine the error string to determine the issue.

Use of this method requires the "set_fielddata" privilege, and "append" access to the given objects.




Tags:

exception:  INSUFFICIENT_PRIVILEGES User does not have the "set_fielddata" privilege.
exception:  PARAMETER_CONSTRAINT_VIOLATION EVENTS array is empty.
exception:  MULTIPLE_ERRORS_DETECTED Multiple errors were found with event records, see reported errors for details.
access:  public


Parameters:

integer   $cropyear   Crop year for the events.
array   $events   Array of event description structs, as above.

[ Top ]

static method save_vector_to_object [line 6542]

static boolean save_vector_to_object( string $vechandle, string $name, string $objecttype, integer $objectid, [string $type = 'spreadmap'])

Permanently saves the vector table VECHANDLE to the database, under the name NAME, attached to the object identified by OBJECTTYPE and OBECTID. The object must be one to which the user has "append" access.

TYPE is used to identify what type of vector dataset this is; currently, the types supported are 'spreadmap', 'spreadpoint', 'multibandpoint', 'grid', 'soilmap', and 'testpoint'. After calling this function, the vector table will appear in the struct returned by get_saved_datasets_for_objects().

Returns true.

Use of this method requires the "save_datasets" privilege, and "append" access to the object to which the vector will be saved.




Tags:

exception:  VECTOR_NOT_FOUND Vector handle does not exist.
exception:  BAD_TABLE_PARAMS Name cannot be empty.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "save_datasets" privilege.
exception:  ACCESS_DENIED Object not accessible to user, or user does not have "append" access to object.
access:  public


Parameters:

string   $vechandle   Vector handle.
string   $name   Descriptive name for this vector dataset.
string   $objecttype   Type of object ('boundaries', 'locations', or 'paths').
integer   $objectid   Permanent object ID for the object for this vector.
string   $type   Dataset type for the vector. Defaults to 'spreadmap'.

[ Top ]

static method search_and_prepare_autoanalysis_matches_and_jobs [line 10449]

static integer|boolean search_and_prepare_autoanalysis_matches_and_jobs( array $boundaryids, [struct $criteria = array()])

Queries for scenes using the boundaries identified in array BOUNDARYIDS, using the criteria in CRITERIA. For each scene found that contains one or more boundaries in BOUNDARYIDS, prepares a new match record, with corresponding job, for the current user. The match record will contain the sceneid of the matched scene, and the boundary ids of the matched boundaries within that scene. The boundaries must be accessible to the current user; however, the user does not need to be subscribed to the boundaries, in order for the matches and jobs to be created by this method.

Each new match record will also have a new autoanalysis job, which can be run using approve_autoanalysis_jobs(). Additional jobs can be prepared from the existing match records using prepare_new_autoanalysis_jobs_from_matches(). The match records, and their jobs, will be visible as a notification in the 'icue' category, using get_notifications(). Use of this method will generate a notification even if the user is not subscribed to icue notifications; additionally, this method will generate a new notification immediately, regardless of whether the user's subscription is set to "digest" or "immediate".

CRITERIA is a struct of criteria to narrow the search. It accepts the following keys:

  • startdate: Scenes shot on or after this date. ISO-8601 format.
  • enddate: Scenes shot on or before this date. ISO-8601 format.
  • scenetypes: Array of scene types, such as Landsat or RapidEye. See get_available_scenes_for_extent_and_date_range().
  • sceneids: Array of scene ids to use. Overrides search, only these scenes will be checked.

If no criteria are set, the default is to search from the beginning of the current year, up to the current date, for all scene types. The "startdate" cannot be after the "enddate" criterion. If "sceneids" is set, no search is performed, and those specified scenes are queried.

Returns the number of boundaries matched for each scene, as a sum (e.g., if five scenes match three boundaries each, returns 15).

If no matches are found, returns boolean false.

Use of this method requires the "autoanalysis" privilege.




Tags:

exception:  PARAMETER_CONSTRATION_VIOLATION Invalid startdate or enddate, or startdate after enddate.
exception:  ACCESS_DENIED User does not have permission to access boundaries.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "autoanalysis" privilege.
access:  public


Parameters:

array   $boundaryids   Array of boundary ids.
struct   $criteria   Criteria struct.

[ Top ]

static method select_by_object_type_and_id [line 1071]

static struct|boolean select_by_object_type_and_id( string $mapcontext, string $type, array $ids, [boolean $toggle = false])

Selects (hilites) the objects of type TYPE, listed in IDS, from the corresponding layer of map MAPCONTEXT. TYPE must be one of "boundaries", "locations", or "paths". IDS must be a ids of the corresponding object type to select. The given objects must be accessible to the current user. An invalid (nonexistent or not accessible) object id triggers an error.

This method only selects on saved objects, not on base layers such as CLUs.

If TOGGLE is TRUE, then already-hilited objects within the current extents will be removed from the hilite layer.

Returns the resulting hilite info struct, as returned by get_hilites(). This struct includes info on all hilited shapes, not just ones which were selected in a particular call to this function.




Tags:

exception:  ACCESS_DENIED Object not accessible to user.
exception:  MAP_NOT_FOUND Map context does not exist.
exception:  PARAMETER_CONSTRAINT_VIOLATION Invalid object type.
access:  public


Parameters:

string   $mapcontext   The map context.
string   $type   Type of object.
array   $ids   List of object ids.
boolean   $toggle   TRUE to toggle hilited shapes. Defaults to FALSE.

[ Top ]

static method set_attributes_for_vector [line 6311]

static boolean set_attributes_for_vector( string $vechandle, array $attriblist, [string $criterion = 'zone'])

Sets the values of attributes in vector table VECHANDLE according to the attribute value structs in array ATTRIBLIST. Attribute value structs are defined as follows:

  • name: Name of the column for this value. Letters, numbers, and underscores allowed, first character must be a letter. No other characters allowed. Uppercase letters will be changed to lowercase.
  • match: Value to match against for the CRITERION. If 'row', this is the primary key (gid); otherwise, an attribute value.
  • value: Value to set for the column, based on MATCH. This must match the data type of the attribute column (although strings can hold anything).

CRITERION is used to determine for which rows in the attribute table the columns should be set, by comparing MATCH against the given column. This may be 'row' to match against the primary key (gid), or an attribute name to match against that attribute.

If an attribute value struct does not exist with a MATCH value for every distinct value of the column checked under CRITERION, the column will remain null for those rows. This is not an error, but probably not desired.

It is an error if the vector is saved and belongs to an object in use by more than one session.

If any errors are signalled, no attributes will be set.

Returns true.

If the vector is saved, use of this method requires the "modify_datasets" privilege, and "modify" access to the object to which the vector is saved.




Tags:

exception:  VECTOR_NOT_FOUND Vector handle does not exist.
exception:  ACCESS_DENIED Vector belongs to object not accessible to user, or user does not have "modify" access to object.
exception:  BAD_TABLE_PARAMS Attribute list empty, or invalid name, or match value invalid for criterion, or value type invalid for attribute, or trying to set reserved attribute, or named attribute not in table.
exception:  CONCURRENCY_VIOLATION Vector belongs to object currently in use by more than one session.
exception:  INSUFFICIENT_PRIVILEGES User does not have the "modify_datasets" privilege and method called on a saved dataset.
access:  public


Parameters:

string   $vechandle   Vector handle.
array   $attriblist   List of attribute specifier structs.
string   $criterion   Criterion to set values: can be 'row' or an attribute. Defaults to 'zone' for spreadmaps.

[ Top ]

static method set_objects_access_controls [line 2179]

static boolean set_objects_access_controls( array $objects)

Sets the access controls for the geospatial objects in array OBJECTS. Use of this method requires the "change_object_acls" privilege.

OBJECTS is an array of access control structs, defined as follows:

  • object_type: Object type. String, can be one of "boundaries", "locations", or "paths".
  • objectid: Object ID. Integer. Must be accessible to the current user.
  • accessor_type: Type of entity granted access. String, must be "GROUP". Can be omitted, since only group access is supported now.
  • accessorid: ID of the accessor, must be a groupid (group access only). Must be accessible to the current user.
  • append: Boolean. Allows the accessor to append new datasets or records to the object, subject to their privileges. Optional, defaults to false.
  • modify: Boolean. Allows modifications of existing datasets, or the object itself, by the accessor, subject to their privileges. Optional, defaults to false.
  • clear: Boolean. Revokes an existing access control entry, instead of granting new access or updating existing entries. If this is set, the "append" and "modify" flags are ignored.

Users may not change the access control entries for parent groups. Users also may not change their own access to objects.

Note: When granting access to child groups, the objects' region must not be private.

Returns true if the access controls were set, otherwise signals an error.




Tags:

exception:  INSUFFICIENT_PRIVILEGES Cannot change access controls, or user attempted to change own access to objects.
exception:  ACCESS_DENIED Given group is not accessible to current user, or given object is not accessible to current user.
exception:  DATABASE_ERROR Database reported an error.
exception:  PARAMETER_CONSTRAINT_VIOLATION Missing required keys, or invalid accessor type, or invalid object type.
access:  public


Parameters:

array   $objects   Array of object access control structs.

[ Top ]

static method set_objects_notification [line 10091]

static struct set_objects_notification( struct $objects)



Tags:

deprecated:  

This method is no longer needed, as all objects notify.

Sets or clears the notification flag ("realtime_notifier") on the objects identified in OBJECTS. OBJECTS is a struct keyed to the object type ("boundaries", "locations", or "paths"), with values being flag structs. The flag structs are keyed to the object ID, with values being boolean flags. The value of "realtime_notifier" will be set to the flag value for each object.

The objects must be accessible to the current user.

Returns a struct keyed to the object type, with values being object ids of the objects whose "realtime_notifier" flag was set to true by this method. If none of the objects of a given type had their flag set to true (all set to false), the value will be boolean false for that object type.

Use of this method requires the "modify_geoobjects" privilege, and "modify" access to the objects specified.

exception:  INSUFFICIENT_PRIVILEGES User does not have the "modify_geoobjects" privilege.
exception:  ACCESS_DENIED Object not accessible to user, or user does not have "modify" access.
access:  public


Parameters:

struct   $objects   Objects and flags to set.

[ Top ]

static method subscribe_groups_to_objects [line 9865]

static struct subscribe_groups_to_objects( struct $specification, [struct $options = array()])

Creates subscriptions for customer groups to imagery types (such as RapidEye) for objects, as specified in SPECIFICATION. Subscription costs are deducted from the credit balances of the customer groups, and the new balances are returned.

SPECIFICATION is a struct specifying the subscriptions; it is keyed to the groupids of the customer groups to subscribe (each of which must be visible to the current user), with values being structs keyed to the object type; values of those structs are structs keyed to each objectid, with values being arrays of imagery data sources, which are string values. Valid imagery source names are found in the pricing plan description returned by get_my_user_info(). The entire SPECIFICATION struct will look something like this:

   Struct(groupid => Struct("boundaries" => Struct(objectid => Array("landsat", "rapideye",...),
                              objectid => Array("aster", "landsat", "rapideye",...),
                              objectid => Array("aster", "landsat", "rapideye", "spot",...),
                             ),
                    ...
                  ),
        groupid => Struct(...),
        ...)

All of the groupids at the top level of the struct must identify customer groups visible to the current user, and all objectids specified must identify objects accessible to the current user. Furthermore, objects specified under a particular customer group must be accessible to that customer group.

Each of the given customer groups is charged for subscription of the given objects according to the per-acre costs of the given imagery sources; subscription of location or path objects is charged for a 100-meter buffer.

OPTIONS is a struct of optional parameters and settings, for use by administrators. No options are currently defined.

Returns a struct, keyed to the groupids of the customer groups, with values being the new balances for those groups.

NOTE: This method is atomic: any error returned means that no subscriptions were recorded and no customer groups were charged.




Tags:

exception:  REQUESTED_ITEM_NOT_FOUND Given group, object, or imagery source does not exist.
exception:  ACCESS_DENIED Given group or object is not accessible to current user, or given object not accessible to given group.
exception:  INSUFFICIENT_BALANCE Given group does not have sufficient balance to pay for subscription charges.
exception:  PARAMETER_CONSTRAINT_VIOLATION Given group is not a customer group.
access:  public


Parameters:

struct   $specification   Specfication struct.
struct   $options   Options struct.

[ Top ]

static method transfer_credits_between_customer_groups [line 9617]

static struct transfer_credits_between_customer_groups( integer $fromid, integer $toid, numeric $amount, [ $comment = null])

Transfers AMOUNT credits from the customer group identified by FROMID, to the customer group identified by TOID.

FROMID and TOID must both identify customer groups (with the "customer" flag set to true) to which the current user has access. FROMID or TOID may be the current user's group, if it is a customer group, or may be child groups of the current user's group. FROMID and TOID cannot identify the same group.

AMOUNT is a positive number of credits to transfer from customer group FROMID to customer group TOID. AMOUNT can be floating point, but will be rounded to two decimal places.

COMMENT, if set, is a comment on the transfer transaction.

NOTE: Transfers are not permitted to bring a group's balance below 0.

Returns a struct with two keys: FROMID, and TOID. The values will be the new balances of those customer groups after this transfer is complete.

Use of this method requires the "make_payments" and "view_financials" privileges. Additionally, the current user must be an administrator or a member of a customer group (which may be FROMID, TOID, or a parent of both of them).




Tags:

exception:  REQUESTED_ITEM_NOT_FOUND Group identified by FROMID or TOID does not exist.
exception:  ACCESS_DENIED Group identified by FROMID or TOID is not accessible to the current user.
exception:  PARAMETER_CONSTRAINT_VIOLATION FROMID and TOID identify the same group, or amount is zero or negative, or FROMID or TOID do not identify customer groups, or transfer would leave FROMID or TOID with a negative balance.
exception:  INSUFFICIENT_PRIVILEGES User not permitted to make payments and view financials, or current user's group is not a customer group.
access:  public


Parameters:

integer   $fromid   Groupid of the source customer group.
integer   $toid   Groupid of the destination customer group.
numeric   $amount   Number of credits to transfer.
   $comment  

[ Top ]

static method update_group_info [line 1021]

static boolean update_group_info( integer $groupid, struct $info)

Updates the information for the group GROUPID, using the information struct INFO. GROUPID must be the ID of either the current user's group, or that of a subgroup of the current user's group. Use of this method requires the "create_groups" privilege.

Only the fields specified in the information struct will be changed, all others will retain current values. Valid fields for the information struct are as follows:

  • name: String. The name of the group.
  • description: String. A textual description of what sort of business entity or organizational grouping this group represents.
  • contactusers: Array of user IDs of users who are the primary contacts for this group. Usually group members, but not required to be; they could be members of a child group, or even a parent group.
  • address: Street or mailing address, if applicable. Customer groups should always have this, others may or may not.
  • city: City.
  • state_province: State or province.
  • zip_postcode: ZIP or postal code.
  • country: Country.
  • phone: Phone number.
  • customer: Boolean. True if this group represents an entity which is a customer of Agri ImaGIS, and thus has its own accout balance. May only be set by administrators or by users with the "set_group_customer" privilege. In any case, cannot be set or cleared on the current user's group.
  • privileges: Group privilege flags, as described in Privilege Flags. Cannot be changed for the current user's group.
  • pricingplan: Struct. If this group is a customer group (see "customer", above), this field allows administrators to set the group's pricing plan. May only be set by administrators. Struct contains two fields: "plancode", the plan code, and "comment", an optional comment left by the administrator.

Returns true if the information was updated successfully. Otherwise, an error is signalled.




Tags:

exception:  INSUFFICIENT_PRIVILEGES Attempted to set group privileges on user's current group, or attempted to set privileges that current user does not possess, or attempted to set customer flag on own group or without privilege, or non-administrator attempted to set pricing plan.
exception:  REQUESTED_ITEM_NOT_FOUND Given group does not exist.
exception:  ACCESS_DENIED Given group not accessible to current user.
exception:  PARAMETER_CONSTRAINT_VIOLATION Invalid pricing plan specification.
access:  public


Parameters:

integer   $groupid   Group ID of the group to update.
struct   $info   Info struct containing the information to update.

[ Top ]

static method update_notifications [line 13453]

static boolean update_notifications( struct $criteria, [string $which = "viewtime"])

Updates the notifications identified in struct CRITERIA, setting the metadata specified in WHICH.

WHICH can have the value "viewtime", in which case the "viewtime" field of the notification is set, "visible", in which case the "visible" flag is set to true, or "hidden", in which case "visible" is set to false. The "viewtime" has no special significance, but can be used to filter notifications by whether or not they have been viewed (however a client chooses to define "viewing"), or sort by when they were viewed. If "visible" is set to false, then the notification will not be returned by calls to get_notifications() unless specifically requested (see documentation for get_notifications(), in particular the "include_hidden" option).

CRITERIA is a struct which specifies which notifications should be updated. It can accept the following keys:

  • ids: Array of notification IDs.
  • categories: Array of category names. Categories are as given in Notification Categories: What to Report.
  • starttime: Timestamp after which notifications will be updated; this is compared against the notification's creation time, not completion time. ISO 8601 format is preferred to avoid ambiguity. Timestamps should include time zone information, or else be in US Central Time, for best accuracy.
  • endtime: Timestamp before which notifications will be updated. As for "starttime", this is compared against creation time.

If "starttime" and "endtime" are both set, it is an error if "starttime" is after "endtime", if "starttime" or "endtime" are not valid dates, or if "starttime" is in the future. Invalid category names in "categories" will also trigger an error, as will passing in IDs for notifications to which the current user does not have access (users only access their own notifications).

With no keys set in CRITERIA, all of the current user's notifications will be updated. This may or may not actually be desired.

Returns true.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION Invalid category names, or starttime or endtime not valid dates, or starttime after endtime, or starttime in future.
exception:  ACCESS_DENIED Given notification IDs not accessible to current user.
access:  public


Parameters:

struct   $criteria   Criteria to search for notifications.
string   $which   Metadata field to update. Defaults to "viewtime".

[ Top ]

static method update_region [line 2011]

static boolean update_region( integer $regionid, struct $info)

Updates the info for the region identified by REGIONID, using the information struct INFO. The region to modify must be owned by the current user, or by a user visible to the current user. If the creator of the region is not the current user, the region must not be private.

Valid fields for the information struct are as follows:

  • name: Name of the region.
  • description: A textual description of what sort of area of interest this region represents, such as a farm, unit, sales region, etc.
  • deleted: Boolean. Set to true to delete this region, making it inaccessible. Deleting a region does not affect the objects contained within it. However, if this region is the only region containing at least some of the objects within it, it cannot be deleted.
  • private: Boolean. Set to true to prevent users in groups below the current user's group from seeing the region, and prevent anyone but the creator from modifying this region. Can only be set by region owner. Cannot be set if users in subgroups of the current user's group have access to objects in the region AND those objects do not exist in any other region visible to the users.
  • groupid: ID of the group this region is associated with. By default, this will be the creator's group.
  • additional_info: Struct of key-value pairs representing miscellaneous information about the region. These keys and values are not checked for validity, they are only stored.
  • objects: Struct of objects to add to or remove from this region. Keyed to the object type; valid keys are "boundaries", "locations", or "paths". Values are structs keyed to the objectid, with values being boolean true to add the object (if not present) or false to delete (if present). The specified objects must already be accessible to the current user. Note also that removing an object from its only region is not allowed; all objects must be contained in at least one region.

Passing other keys into the struct will have no effect: this function ignores all invalid keys.

Returns true if the values were successfully updated, otherwise an error is signalled.




Tags:

exception:  DATABASE_ERROR Database reported an error.
exception:  PARAMETER_CONSTRAINT_VIOLATION Empty strings passed in for NAME or DESCRIPTION, or invalid object type in OBJECTS.
exception:  MULTIPLE_ERRORS_REPORTED Given objects in OBJECTS are not accessible to the current user.
access:  public


Parameters:

integer   $regionid   ID of the region to update.
struct   $info   Info struct containing the info to update.

[ Top ]

static method update_user_info [line 8487]

static boolean update_user_info( integer $userid, struct $info)

Updates the information for the user USERID, using the information struct INFO. USERID must be the ID of either the current user, or that of a user accessible to the current user.

Only the fields specified in the information struct will be changed, all others will retain current values. Valid fields for the information struct are as follows:

  • firstname: First name.
  • lastname: Last name.
  • password: User's password.
  • address: Street address.
  • address2: Additional street address part.
  • city: City.
  • state: State/province.
  • zip: ZIP/postal code.
  • phone: Phone number.
  • fax: Fax number.
  • email: Email address.
  • disabled: Boolean value: TRUE disables logins for this user. Defaults to FALSE. Cannot be changed for the current user, by the current user.
  • Any of the privilege flags described under Privilege Flags. All are boolean values; true grants the privilege, false revokes it. Can only be changed for users who are members of subgroups of the current user's group. User privilege flags are checked against the flags of the user's group: if the group has a privilege set to GRANT, it cannot be revoked for group members, and if the group has a privilege set to DENY, it cannot be set for group members. Further, the current user cannot set privileges on a user that the current user does not possess.
  • notification_settings: Struct describing changes to the user's notification subscription settings. Struct keyed to the notification category (see Notification Categories: What to Report), with values being the notification settings for that category, as follows:
    • mode: Delivery mode. String. One of "immediate", "digest", or "off". Setting this to "off" will cause the user to unsubscribe from this category.
    • interval: Interval to collect changes for digests. String. One of "1 day", "1 week", "7 days" (equivalent to "1 week"), or "1 month".
    • timeofday: Time of day to deliver digest. Time string, in ISO 8601 format, with time zone. Clients should specify the user's local time zone to ensure delivery at the desired time.
    • dayofweek: Day of week to deliver weekly digest. String. Must be a named day of week. Can be a three-letter abbreviation, in any case, but cannot be an integer.
    • dayofmonth: Day of month to deliver monthly digest. Integer. Must be between 1 and 31.
    • send_email: Whether or not to send a notification email for this category. Boolean.
    • icue_autorun: Whether or not new icue "match" notifications should be automatically run when created. If true, email will not be sent for the new matches (regardless of send_email, above), and autoanalysis jobs will automatically be run for each "match" in the notification. Charges for analysis will be assessed as normal. Boolean.
    Can only be changed if USERID equals the id of the current user.
  • notifying: Struct describing geospatial objects to which the user wishes to request notification, or stop notification. Struct keys are object types, must be one of "boundaries", "locations", or "paths". Values are object description structs, fields are as follows:
    • id: Object ID of the object (boundary, location, or path) in question.
    • notify: Boolean. True to request notification, false to stop notification.
    • startdate: Starting date for the date range for scene notification. ISO-8601 format.
    • enddate: Ending date for the date range for scene notification. ISO-8601 format.
    The month and day of these dates determine the range of scene dates for which the user will receive notifications of new scenes. Object IDs must identify objects to which the current user has access. Can only be changed if USERID equals the id of the current user.
  • presets: Struct of preference settings for autoanalysis jobs. These saved settings will override the system defaults for an autoanalysis. Administrators can change these settings for any user; other users may only change their own settings. Struct definition is as follows:
    • types: Array of analysis types, as for the TYPE parameter for classify_multiband_analyses(). Any combination of the allowed types is permitted; duplicates will be removed.
    • mode: One of "standard", "minmax", or "custom", as the MODE parameter for classify_multiband_analyses().
    • numzones: Number of zones, as the NUMZONES parameter for classify_multiband_analyses(). Must be at least 2, and cannot exceed the maximum for the given colortable (default colortable max is 31). Will be set, but ignored, if "mode" is set to "custom".
    • colortable: Index number for the color table to use, as the COLORTABLE parameter for classify_multiband_analyses(). Will be set, but ignored, if "mode" is set to "custom".
    • custom_classifications: Struct keyed to analysis types (as in "types" array), with values being the names of saved custom clasifications (as in "classifications" attribute of user info), which must be defined for the given analysis band. This parameter can be set regardless of mode, but MUST be set if "mode" is set to "custom" and this parameter was previously empty.
  • classifications: Struct of saved classifications, usable with classify_multiband_analyses(). Struct keys are band names (NIR, NDVIR, NDVIG, REDEDGE, NDVIREDEDGE); each band name key's value is a struct of named classifications, with the names as keys and the classification structs as values. Classification structs are structured as described for classify_multiband_analyses(). Classification structs and band names will be checked for validity. This struct can be manipulated in four ways: new classifications can be saved, or old ones can be updated, renamed, or deleted. Saving a new classification, or updating an old one with a new classification struct, is done simply by assigning the classification struct as the value of the desired name key, under the appropriate band key: if the named classification did not exist before, it will be saved, while if it did exist, it will be overwritten with the new struct. To rename an existing classification, set an additional key in the classification struct (the struct under the name key) with the key name "name", and the value of the new name; to delete an existing classification, set a key in the classification struct named "delete", with any value. These additional keys will not be saved as part of the classification struct; they are only used to determine what operation to perform on a saved classification.
  • client_preferences: Struct of preference settings for different client program to use. Keyed to the client names, with values being structs of preferences. The special client name "all" is used to indicate global preferences which should be honored by all clients. These preferences are not checked for validity by the server, and have no effect on server functionality by themselves; the intention is for this information to be used by various clients to control client-side preferences or presets for server method calls. Keys may be arbitrary strings; values must be structures to be set, or boolean false to be cleared. The keys and values of those structures are arbitrary and not checked.

Passing other keys into the struct will have no effect: this function ignores all invalid keys.

Note that the login name of a user, once created, is immutable.

Use of this method to change information on a user other than the current user requires the "create_users" privilege.

Returns true if the values were successfully updated, otherwise an error is signalled.




Tags:

exception:  PARAMETER_CONSTRAINT_VIOLATION Password too short, or email invalid, or state not recognized.
exception:  INSUFFICIENT_PRIVILEGES Attempted to set user privileges on self, or attempted to set privileges that current user does not possess, or attempted to use icue features without autoanalysis privilege.
exception:  ACCESS_DENIED Given user not accessible to current user.
access:  public


Parameters:

integer   $userid   User ID of the user to update.
struct   $info   Info struct containing the information to update.

[ Top ]


Documentation generated on Wed, 19 Aug 2026 18:55:25 -0500 by phpDocumentor 1.4.4