The basis of habitat reporting in MarineMap is knowing how much habitat is captured within each MPA. Habitats can be represented as points, lines, or polygons. These habitat features generally come to us as shapefiles with wildly varying schemas. The intersection app assists in the process of resolving these various schemas into single feature shapefiles.
Once the habitat features are in simple single feature shapefiles, the intersection app lets you import them in into the database as intersection features. The features are then available to do intersections with. However, the more common use case will be to define an organization scheme first. Organization schemes let you define the order in which feature results are reported and let you combine existing features of the same type (two or more polygon features, for instance) into a single result.
Once the feature data is loaded into the intersection application and the organization scheme is defined, intersection results may be obtained either by directly calling a method of the OrganizationScheme object in the intersection app with a polygon or geometry collection as an argument or through an http request that includes a polygon in the URL.
In order to find out how much of a particular feature intersects with a given polygon, we first have to get the intersection feature into the database. Having each intersection feature represent a single habitat (as opposed to representing different habitats specified by an attribute) provides the greatest flexibility and constancy. The primary format for habitat data (in our experience so far) are shapefiles. The schemes of these shapefile data sources vary considerably.
Sometimes, as is the case with the MLPA linear kelp data sets, the presence of geometry indicates the presence of the habitat. We’ll refer to this type of shapefile as a Single Feature Shapefile.
In other cases, a shapefile may contain geometries that represent any number of different habitats according to how each individual geometry is attributed. An example of one of these Multi Feature Shapefiles is available here. That example is a portion of the substrate data set used in the South Coast MLPA process. The shapefile consists of polygons with a sub_depth attribute (among others). Some values of this attribute are ‘Hard 0 - 30m’, ‘Soft 30 - 50m’, etc. If we want to know, for instance, how much hard substrate with a depth of 0 - 30 meters is within a given polygon, we want to intersect that polygon with a set of geometries that represent just that habitat type. In other words, we want to intersect with a single feature rather than a multi feature.
The intersection app admin can take a zipped multi feature shapefile that has been uploaded and split it into the necessary number of zipped single feature shapefiles. Once the intersection app is installed and running, you may want to follow these steps in order to acquaint yourself with the app:
When you click the submit button, you will be taken to the list of single feature shapefiles and you will see that one single feature shapefile has been created for each distinct value in the field that you split on.
Once we have a single feature shapefile, whether it was started life as a single feature shapefile and was imported as such or it started as a multi feature shapefile and was split by the admin tool, we can add it to the Intersection Features model and make it available for intersections. The following assumes that you’ve followed the steps above:
This will take you to the list of Intersection Features and you’ll see that each of those single feature shapefiles have been imported into the database.
You may want to play around with the intersection app independently of the other apps in your project. You can do that in a couple of different ways. You can draw polygons and get results for the intersection features you have loaded into the application. You can also create test polygons in the admin tool, save them, and get intersection results on them repeatedly. This helps in evaluating how results are cached.