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

Regions and Objects

Description of regions, objects, and access controls

Avi Blackmore Head Programmer/Administrator 2013 Agri ImaGIS Technologies, Inc.

Table of Contents

Regions

Regions are the mechanism to group together boundaries and other geospatial objects. Like groups, they are flexible and generalized; a region could represent a farm, a crop insurance unit, a set of farms, a sales region, or any other collection of objects. Unlike groups, regions don't have any direct relationship with each other; that is, there is no "parent region" and "child region". Rather, regions relate to each other spatially, based on whether or not they contain the same objects, or overlap in extent. Objects can exist in more than one region, and can contain more than one type of object. Also, unlike groups, there is no privilege flag which controls creating regions: they can be defined by any user, to contain any set of objects that the user can see.

Regions have a few attributes: the name, description, and containing objects. The name and description work in similar fashion as for groups: name identifies the specific region, while description is intended to identify the purpose of the region. A region representing a farm, for instance, could have "Farm" as its description, while a crop insurance unit could have the unit type. Other that this information, a region is just a container for geospatial objects.

Only the user who created a region can modify that region, changing its name, description, or objects that it contains. Other users can see the region, if they can access any of the objects that it contains; however, they have no ability to modify the reigon itself. They can, of course, define their own regions to contain objects to which they have access.

It's important to note here that access controls apply to the objects themselves, not to the regions: regions are just a collection mechanism. Client programs can present an interface which allows users to change the access controls on all the objects contained in that region (provided they have that privilege) by choosing the region itself, but the region does not actually have access controls.

However, regions can be designated as "private", in which case they are only visible to the creator, and to users in parent groups of the creator's group. This means that users in child groups of the creator's group will not be able to see that region. This does not meant that those users cannot see objects within the region (that is controleld by the object access controls); however, if the region in question is the only one containing the objects, and those users have access to them, then the region cannot be marked as private. Nor can access to objects in a private region be granted to users in child groups of the creator, unless those objects exist in another region that those users can see. This mechanism exists to allow users in parent groups to have regions which do not appear to users in child groups, for privacy of information or to avoid confusing the lower-level users.

Regions are created with the method create_region(), and updated using update_region(). The set of regions and objects accessible to the user can be obtained by calling get_accessible_regions_and_objects(). One important note about this method: the set of regions and objects for a particular user may be large. Client programs should consider using the filtering parameters to ensure the size of the returned structure is manageable.

Geospatial Objects

There are three types of geospatial objects used in the Satshot system: boundaries, locations, and paths. Boundaries, which can represent fields or other polygonal shapes, are defined as the MULTIPOLYGON Simple Feature type in the OGC Simple Features specification. Locations represent single point locations, and are defined as the POINT Simple Feature type. Paths represent linear paths or tracks, defined as the MULTILINESTRING Simple Feature type. These three object types are intended for different purposes, but all can be used with (mostly) the same functionality: analysis, fielddata records, dataset storage, and so forth. Unless otherwise specified, any method which works with one type of object will work with the other types, as well; the only exception is that there are a few methods which have not yet been updated to work with objects other than boundaries.

Creating these objects requires first placing them in hilites, which acts as the "working set" of objects for a session. Once objects are hilited, the next step is to call save_hilited_objects(), which will save the hilites to permanent storage. (It bears noting that, if the hilites were already saved, they can be updated with new geometries by this method.) It does not matter if multiple types of objects are hilited at once; save_hilited_objects() can distinguish between boundaries, locations, and paths, and saves them to the proper permanent layers.

Objects can be created in multiple ways. One method is to select on existing, "base" boundary layers, such as the CLU or attributed CLU layers in the US. The methods select_by_point(), select_by_pixel_point(), and select_by_extents() can be used for this purpose; with attributed CLUs, hilite_customer_clu_boundaries() or hilite_clus_by_criteria() allow for searching the attributed CLU database to find the desired boundaries.

Another method for creating objects is to insert them into hilites as OGC Well-Known Text. Using create_hilite_objects_from_wkt(), clients can upload any number of new WKT geometries, or update existing hilites with new WKT geometries. Coordinate systems can be automatically translated, if the source WKT strings are not in standard latlong, as long as the coordinate system used is provided.

The API also supports upload of objects in common vector formats, via upload_objects_to_hilites(). This method can take an entire vector file, in multiple formats, and import it into the hilites. The vector files can be ESRI Shapefiles, OGC GML, Google Earth KML, GeoJSON, or even Mapinfo MIF/MID files. Again, provided the coordinate system is specified, the vectors will be transformed automatically for internal storage.

Finally, for working with hilite geometries to create new objects, the Satshot API supports several "advanced geometry" methods, which can be used on MULTILINESTRING or MULTIPOLYGON geometries (not on POINT locations). These methods treat the geometries as point sets, performing union (make_geometric_union_of_hilited_shapes()), intersection (make_geometric_intersection_of_hilited_shapes()), or symmetric difference (make_geometric_symdifference_of_hilited_shapes()) operations on a set of objects to create a new, derived object; this results in merging a set of objects into one, "clipping" one object to the limits of another, or "punching holes" in one object with another. The main limitation here is that all of the objects operated on must be of the same type: make_geometric_union_of_hilited_shapes(), for instance, can operate on a set of boundaries, or a set of paths, but not a set containing both.

Existing permanent objects can be selected (hilited) by a number of means, such as the spatial query methods select_by_point(), select_by_pixel_point(), and select_by_extents(). They can also be selected by type and ID, using select_by_object_type_and_id(). This is necessary in order to access the objects' datasets or fielddata records, or to create new datasets or fielddata records.

Access Controls

Geospatial objects are only visible to users who have permission to view them. These permissions, called access controls, determine what objects a user can see, and what that user is allowed to do with them. Access controls can grant access to a single user, or to all members of a group. A grant of access to a particular group does not grant access to that group's parent, or child groups.

Access controls govern three aspects of accessing an object: reading it and its data, writing new data to it, or modifying the object or its existing data. Read access is governed by having an access control entry; the presence or absence of such an entry is what determines if the given user or group can read the object. Writing is governed by two flags on the access control entry, "append" and "modify". The "append" flag allows the given user or group to save new datasets, fielddata records, photos, or other information to an object, but not to modify or delete existing datasets, or modify or delete the object. The "modify" flag governs modifying the object or its datasets, but does not allow saving new datasets to the object.

Setting both "append" and "modify" flags to false makes an object "read-only" for the group or user in question. Setting "append" true, but "modify" false, results in an "append-only" situation, in which the group or user granted access cannot modify existing datasets. Setting "append" false and "modify" true probably does not make much sense, as this would result in the group or user being unable to add new datasets, but fully capable of modifying or deleting existing ones, or the object itself; if that does make sense for a particular use case, however, the system does not forbid it. (Client programs, however, are free to forbid this in their interfaces, of course.) Note that in all cases, however, the grant of access gives full ability to read existing data; there is no such thing as "write-only" access.

If a user doesn't have the privilege to perform an operation which requires either the append or modify flag, of course, that user cannot perform the operation anyway. Object access is checked after privileges are checked. So, for example, a user without the "save_datasets" privilege cannot save new datasets to an object even if that object's append flag is true for them. Privileges determine what actions the user can perform, access controls determine what objects the user can act upon.

Access controls are set using the method set_objects_access_controls(). They can also be set when a new permanent object is saved, using save_hilited_objects().

Method Reference

Region and object creation and access:

Prev Up Next
Groups and Users Understanding and Using the Satshot Services API, Version 2 Scenes and Analysis

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