Appendix

Output Formats

There are multiple formats in which OCGIS output can be saved on disk: shapefiles ('shp'), comma separated values ('csv'), a combination of shapefiles and csv ('csv-shp'), netCDF ('nc') and GeoJSON ('geojson'). The OcgOperations output_format parameter determines which format is used. Additional options are available through the output_format_options (not all output formats expose options).

NetCDF Output

netCDF is a binary file format widely used in the climate community. It is self-descriptive in the sense that it carries metadata describing the file content. netCDF files created by OCGIS carry the original file’s metadata in addition to updating the file’s history attribute. Spatial and temporal subsetting or aggregation operations will modify the original dimensions of the file but retain all relevant data and metadata on the temporal and spatial coordinates, time and level dimensions. New variable created by OCGIS are named after the calc operation that defined it.

There are two modes for netCDF output, one handling gridded data and another handling multiple unioned geometries. For example, if geom is a list of world countries, calc is the annual average and dataset stores globally gridded daily temperature and aggregate is set to True, then the annual average temperature for each country would be stored in a variable with dimensions (time, ocgis_geom_union), where the ocgis_geom_union dimension indexes each individual country. Metadata about the geometries (for example its name), will be stored in variables spanning this spatial dimension. Although the netCDF file does not include each region’s geometry (point or polygon), the region’s centroid coordinates are stored in the latitude and longitude variables. Instead of ocgis_geom_union, users can change the name of the discrete geometry dimension by setting the output_format_options called geom_dim.

Spatial Operations

Note

Differences between point and polygon geometry representations are discussed in the respective sections. The greatest differences between how the geometries are handled occurs in the way point aggregations are constructued (see Aggregate (Union)).

Spatial Masking

OpenClimateGIS manages spatial masking independent from data masking. Following a spatial operation, a new variable is added to a grid’s variable collection if a any geometries are masked. This variable’s default name is constants.VariableName.SPATIAL_MASK.

The spatial mask variable allows masking to be tracked independently from data variable masking. The spatial mask is stilled hardened into the data array following a subset. A spatial mask variable will not be created if no geometries within the subset were masked.

If present on an input dataset, the spatial mask variable will always be respected. It may be ignored by setting it to None in a request dataset’s DimensionMap.

Intersects (Select)

Returns True if the boundary of two spatial objects overlap. This differs from the classical set-theoretic definition of intersects for spatial analysis. In OpenClimateGIS, geometric objects that touch only are excluded.

_images/intersects.png

The intersects operation returns only overlapping geometries.

Clip (Intersection)

A clip operation is synonymous with an intersection. If the source data may only be represented as points, then an intersects operation is executed (see Intersects (Select)).

_images/clip.png

The clip operation creates new geometries by cutting features given the boundary of another feature.

Aggregate (Union)

Aggregation or union is the merging of feature geometries to create a new geometry. For polygons, this will result in a single features. For points, the result is a multi-point collection.

_images/aggregate.png

Multiple polygons are combined into a single polygon during spatial aggregation.

Point Selection Geometries

When selecting data with a point, the point is automatically buffered according to search_radius_mult. This may result in multiple geometries or cells being returned by a request.