Organizing Geospatial Data

By Sandra Schloen, October 2014

Updated May 2017; November 2020

OCHRE uses the Mapping API provided by Esri ArcGIS Runtime SDK for Java so that geospatial data can be fully integrated with other project data. This article offers some strategies for managing such data within an OCHRE project.

A key concept in OCHRE is that any spatially-aware object, or other geo-enabled item, can (should!) know how to draw itself. This gives the ultimate flexibility for drawing query-based maps and views based on a variety of criteria. Geo-enabled items, that is, those that have some kind of geospatial representation, e.g. Locations & Objects, Persons & Organizations, Resources, can be represented by coordinates, shapes (e.g. points, lines or polygons in the familiar shapefile format), or raster images.

Geospatial Resources in OCHRE

Raster Images

See the article Supported Geospatial File Formats for details on using georeferenced raster formats within OCHRE. Also review the Strategies for Creating Raster Images to ensure that your raster image options are well chosen for use in OCHRE.

Geodatabase

There are a variety of geodatabase formats. OCHRE supports only the Esri Runtime geodatabase (.geodatabase) format. See Creating a Geodatabase for details on using this format with OCHRE.

Shapefiles

A shapefile can be treated like any other external resource in OCHRE. Simply set its Type to geospatial and provide the .shp ending on the File URI. Although you only identify the primary shapefile, OCHRE understands that the shapefile comes with assorted side-car files. As long as these files are contained together with the primary shapefile in the same folder, OCHRE will find them.


Map Options -- Contextual geodatabase or shapefile

In The Importance of a Basemap we discuss how a basemap is set up in OCHRE using the Map Options on the Resource Inbox for the Project. Each hierarchy that contains geo-enabled items, e.g. Locations & Objects, Persons & Organizations, Resources, has its own Map Options. It is here that you can link in a geodatabase or shapefile that includes shapes of the items within the current hierarchy. A shapefile, for example, may have polygon-shapes outlining each of the loci of excavation described within the hierarchy, or it might specify point-shapes identifying the location of places listed in the hierarchy.

Each shapefile must have a field in its attribute table which identifies the OCHRE item to which the shape applies. This field can contain values that match on the OCHRE item's Name, Abbreviation or any of its aliases. On the Map Options, specify both the Shapefile (represented as a linked Resource item) and the Field in which the items will be identified to OCHRE. OCHRE will query this specified Field to find the shape(s) on demand for any given item in OCHRE. By default OCHRE will look for a field called Name (NAME, name) in the attribute table. If a geodatabase is used instead of a shapefile, the Table in the geodatabase that contains the Field whose values will match to OCHRE items will also need to be specified. (This is not necessary for a shapefile as it will only have 1 attribute table.)

Whether a geodatabase or shapefile is used as the source, if the intended field for matching to OCHRE items is labeled something other than "Name," or if multiple geodatabase or shapefiles are linked to a hierarchy's Map options, you will need to tell OCHRE which Table/Field to use on the Preferences of the specific Resource items that represent the geodatabase(s) and/or shapefile(s).

Linking Shapes

One interesting, and potentially helpful strategy, is to use a Resource image as the backdrop for a list of linked items that are related to that image. Here, the Loci of excavation that are related to the scan of an excavation Top plan drawing, are added as Links to the Resource item representing the Top plan. On the View of the Resource item, OCHRE will use the source image of the item being viewed as the bottom-most layer of the map, overlaying the linked items' individual shapes on the underlying map.

Point (Coordinate) Data

OCHRE has a special "coordinate" variable type that allows you to create a variable that represents a geographic coordinate; see Variables of Type Coordinate for more information. This is a good alternative to having to create, import and link point-based shapefiles to represent a simple coordinate of an item, for example, a find-spot of an artifact. Rather, create a coordinate variable, call it Findspot for example, and assign it to each artifact along with the appropriate x, y, and z values. This is in the spirit of ensuring that each item knows how to draw itself on a map. Items having a coordinate-style value can use that data to plot themselves on a OCHRE-based map.

To learn more about coordinate variables and strategies for entering coordinate-type data into OCHRE, see also Managing Point Coordinates.