Orthoimagery and Well Photos

All our Orthoimagery, as well as our Well Photos, Videos, and Panoramics, are captured using a Drone Mapping Software known as DroneDeploy.

This section will be covering CarbonPath’s integration of the DroneDeploy API.

Overview

There are four types of media being fetched from DroneDeploy for display in Carbonpath’s interface: Map Plans, Photo Plans, Pano Plans, and Video Plans.

In CarbonPath’s Marketplace interface, these are the following:

  • Map Plans - An aerial orthoimagery of a well, that is shown on the map itself. The user can toggle this on and off by clicking on the Map Settings button at the bottom-right corner of the screen, and clicking the switch beside “Drone Imagery”.

  • Photo Plans - A set of drone photos of a well, taken from different angles. When clicking on a Well Marker Well Marker, assuming the well has Photo Plans associated with it, the Photo Markers Photo Marker will appear on the map, and the user can click them to view the Photo Plans.

  • Pano Plans - The panoramic view of a well. If available, these are accessible from the pop-up window that appears when clicking on a Well Marker Well Marker.

  • Video Plans - A video of a well. If available, these are accessible from the pop-up window that appears when clicking on a Well Marker Well Marker.

API

Our API uses the Django REST Framework (DRF). There are models for each of the four types mentioned above, with the additional model for Photo, which represents an individual photo from a Photo Plan.

Celery Tasks

Since our DroneDeploy collection will be populated as time goes, there needs to be a way for our API to automatically process new Plans. This is done by utilizing Celery Tasks. All code for the tasks are found in tasks.py and utils.py under api/carbonpath/dronedeploy.

The functions used in the Celery Tasks (located in utils.py) are the following:

  • fetch_and_create() - Fetches all existing CarbonPath data from DroneDeploy using GraphQL, and stores them as objects in our API. This also refreshes download links of existing objects, in case they expire.

  • download_photos() - Runs through all download links of Photo objects, downloads and stores each of them in their respective objects. This is done for faster loading times.

  • download_all_orthoimagery() - For every existing Map Plan object, it fetches and stores new data (download paths, file formats, etc.) using GraphQL. It then downloads the Map Plan file which is a zip that contains a KML file, and either a JPEG or a GeoTIFF file. After unzipping, the KML file is parsed to get the exact coordinates of the orthoimagery, and the image file is processed so that it is transparent.

For all of these, it is important for the Well name in our API to be exactly the same as the Well name in DroneDeploy, as this is how our API pairs each Plan object to a Well.

The actual tasks run by Celery are located in tasks.py, but they are simply just one or a combination of the utils functions described above. A standard update task for DroneDeploy data is done every week, and it just runs through each of the functions above in order.

Endpoints

There are only two endpoints in our API related to DroneDeploy, and these are simple GET endpoints for fetching data, as most of the work is done in the Celery tasks. These are the following:

  • api/v1/dronedeploy/fetch_image_links [GET] - Fetches a list of all Plan objects sorted by type, with all existing data including download links provided by DroneDeploy, and for Photo Plans, also includes a link to the file itself in our API. This list omits objects without a download link.

  • api/v1/dronedeploy/[well_id]/fetch_specific_well_image_links [GET] - Fetches the same list as above, but only for a specific well. Entering an invalid well_id (e.g. doesn’t exist) will result in an error.

Marketplace

Most of the code relating to DroneDeploy integration can be found in the MarketplaceMap, MapPopup, and MapPopupMobile widgets.

Map Plans

Map Plans are handled in the MarketplaceMap widget.

A Map Plan, if it exists, will only appear on the map if the Drone Imagery toggle is on (accessible by clicking on the Map Settings button at the bottom-right corner), and if a Well is selected.

A Map Plan that is already displayed will be removed if the Drone Imagery toggle is off, or if no Well is selected.

Our Marketplace Map uses Mapbox GL through React Map GL. Adding of Map Plans is done by using the map.addLayer() and map.addSource() functions. Similarly, removing of Map Plans is done by using the map.removeLayer() and map.removeSource() functions. The map object in these cases is obtained from a ref of the ReactMapGL instance, using mapRef.current.getMap().

For additional information regarding Layers and Sources, please refer to the Mapbox GL JS docs.

Video Plans and Pano Plans

Both the Video Plans and the Pano Plans are handled in the MapPopup and MapPopupMobile widgets.

The Map Popup is a window that pops up when selecting a Well, either by clicking on a Well Marker Well Marker on the map, by clicking on the dropdown of the searchbar, or by clicking ‘View Now’ in the search results.

The Video Plan and Pano Plan for a specific well are loaded as modals along with the Map Popup, and will only show when clicking on the video thumbnail at the top, or the “Show panoramic view” hyperlink at the bottom.

The panoramic view is displayed using React Pannellum, with config and style parameters set in pannellumConfig and pannellumStyle constants respectively. A full list of config parameters is provided by the React Pannellum readme

The video is displayed using the standard HTML video tag.

Photo Plans and Photos

The Photos are handled in MapPopupTimeline and MapPopupTimelineMobile under the MapPopup and MapPopupMobile widgets respectively.

The photos are displayed in a carousel on the Landscape Timeline section of the Map Popup, accessible by clicking on the History icon.

Each photo can be accessed in three ways: using the carousel arrows, clicking one of the carousel dots, or clicking one of the Photo Markers Photo Marker. All of these will update the position of the carousel.

Below the carousel, there is also a toggle switch for “Before” and “After”. This can be toggled to see two different photos taken from the same angle but on the earliest date (Before) and the latest date (After). If there is only one photo taken from that angle, it is displayed on “Before” by default, and the “After” picture will just be black.