Skip to content

Site operations

CREATE_SITES

Used to add new sites to the platform in bulk.

Operation structure:

json
{
    "operation": "CREATE_SITES",
    "params": {
        "cross_operator_match_distance_m": 100
    },
    "data": [
	      ...
    ]
}

Parameters:

  • cross_operator_match_distance_m: cross operator matching distance

Data fields (all fields are required, even if empty!):

ParameterTypeExample
ownerOperator name (as stored in platform)N100
site_namestringBakerfield S-12
date_of_installationdate2022-10-12
operator_statusstringACTIVE
subpart_w_segmentstringOOOOb
operator_unique_idstringDPST-12345
other_operator_idsstringALS-123,TGBD-1234
geometryString representation of GeoJSON or WKT. Accepts only Polygon and Point geometries!{\\"type\\": \\"Point\\",\\"coordinates\\": [-106.84455467396093, 34.78297044770471]} POINT (-106.84455467396093 34.78297044770471
geometry_sourceOne of UNKNOWN, BRIDGER, OPERATOR_PROVIDED, DRAWN_BY_AERSCAPE, SCRAPED_FROM_PUBLIC_DATA, GROUND_SURVEYGROUND_SURVEY
start_datedate2022-10-12
end_datedate2022-10-12
change_transactionsList of objects (any valid JSON object is accepted)[{}, {}] [{"date": "2020-10-12", "operation": "import from operator DB"}]
site_data_sourcestring"operator GIS database" "bridger import"
site_type_from_imagerystring"well_site" "processing_facility"
equipmentA list of equipment, containing ALL parameters from the CREATE_EQUIPMENT operation, with the exception of owner and site since these will be taken from the parent site.See Data fields (all fields are required, even if empty!)
Any other fieldsstring (will be stored inside extra_data){}

UPDATES_SITES

Similar to the previous operation, but with the goal updating data for already existing sites.

Operation structure:

json
{
    "operation": "UPDATE_SITES",
    "params": {
        "cross_operator_match_distance_m": 100
    },
    "data": [
        ...
    ],
}

Parameters:

  • cross_operator_match_distance_m: cross operator matching distance
    • The cross-operator matcher will run only if the geometry column is provided.

Data fields:

ParameterTypeExample
idstring - ID of site already in the database12345678-1234-5678-1234-567812345678
ownernon-editable (don't send or send blank)
All other propertiesSame as the the CREATE_SITES operationSee previous operation table.

Only send the fields you want to modify (empty fields will be changed to empty values if provided!).

TRANSFER_SITES

Transfers sites to a new owner by creating copies with the new ownership while deactivating the original sites.

This operation will:

  1. Validate all site IDs exist in the system before proceeding.
  2. Create new site records under the new owner, with a start date of either today or the specified move_date.
  3. Transfer all equipment from original sites to the new sites, updating ownership information.
  4. Deactivate original sites by setting their end_date to the transfer date.
  5. Record transfer history in the change_transactions field of new sites.
  6. Copy emission records and marks them as completed, without bringing any inputs from the previous operator.

Operation structure:

json
{
    "operation": "TRANSFER_SITES",
    "params": {
        "new_owner": "N345",
        "move_date": "2020-01-01"
    },
    "data": [
        "aerscape-id-1",
        "aerscape-id-2",
        ...
    ]
}

Parameters:

  • new_owner: (Required) Company code/name of the new owner. Must exist in the system.
  • move_date: (Optional) Date when the transfer should be recorded, in YYYY-MM-DD format. Defaults to current date if not provided.

Data: An array of site IDs to transfer to the new owner. All IDs must be valid site primary keys in the database.

Error Conditions:

  • Fails if the specified company (new_owner) doesn't exist.
  • Fails if any site ID in the data array is invalid.
  • Fails if the provided move_date is not in a valid ISO format.

MERGE_SITES

Merges multiple sites from the same owner into a single new site.

This operation will:

  1. Create a new site with the provided properties
  2. Reassign all equipment from the original sites to the new site
  3. Move all aerial images from the original sites to the new site
  4. Update all emission records to reference the new site
  5. Update all site matches in emission records
  6. Delete the original sites

Operation structure:

json
{
    "operation": "MERGE_SITES",
    "params": {
        "site_data": {
            "owner": "CompanyName",
            "site_name": "Merged Site",
            "date_of_installation": "2025-01-01",
            "operator_status": "Active",
            "subpart_w_segment": "OOOOb",
            "start_date": null,
            "end_date": null,
            "operator_unique_id": "TS1",
            "other_operator_ids": "TS1-ALT,TESTCO-TS1",
            "geometry": {"type": "Point", "coordinates": [-103.475, 31.765]},
            "geometry_source": "OPERATOR_PROVIDED",
            "change_transactions": [{"type": "create", "date": "2025-01-01"}],
            "site_data_source": "Import Source",
            "extra_field": "Extra Value"
        }
    },
    "data": [
        "site-id-1",
        "site-id-2",
        "site-id-3"
    ]
}

Parameters:

  • site_data: (Required) A complete specification for the new site that will be created to replace the merged sites. This should contain all the same fields as would be used when creating a new site.

Data: An array of site IDs to merge. All sites must:

  • Be valid site IDs in the database
  • Belong to the same owner
  • The owner must match the owner specified in the site_data

Error Conditions:

  • Fails if any site ID in the data array is invalid
  • Fails if the sites to be merged have different owners
  • Fails if the new site owner doesn't match the owner of the sites to be merged
  • Fails if the site_data is invalid or missing required fields

Effects:

When this operation runs successfully:

  1. A new site is created with the properties from site_data
  2. All equipment from the original sites is moved to the new site
  3. All aerial images from the original sites are moved to the new site
  4. All emission records that referenced the original sites are updated to reference the new site
  5. All site matches in emission records are updated, removing references to the original sites and adding a reference to the new site
  6. The original sites are permanently deleted

SPLIT_SITES

Splits a single site into multiple new sites, redistributing equipment, aerial images, and emission records.

This operation will:

  1. Create multiple new sites based on the provided specifications
  2. Redistribute equipment to specified new sites or to the nearest new site based on spatial proximity
  3. Reassign aerial images to the nearest new site based on spatial proximity
  4. Update emission records to reference the closest new site based on the emission location
  5. Update site matches in emission records to include all new sites
  6. Delete the original site

Operation structure:

json
{
    "operation": "SPLIT_SITES",
    "params": {
        "site_to_split": "site-id-to-split"
    },
    "data": [
        {
            "owner": "CompanyName",
            "site_name": "Split Site 1",
            "date_of_installation": "2025-01-01",
            "operator_status": "Active",
            "subpart_w_segment": "OOOOb",
            "start_date": null,
            "end_date": null,
            "operator_unique_id": "SS1",
            "other_operator_ids": "SS1-ALT,TESTCO-SS1",
            "geometry": {"type": "Polygon", "coordinates": [[[-103.475, 31.765], [-103.465, 31.765], [-103.465, 31.775], [-103.475, 31.775], [-103.475, 31.765]]]},
            "geometry_source": "OPERATOR_PROVIDED",
            "change_transactions": [{"type": "split", "date": "2025-01-01"}],
            "site_data_source": "Site Split Operation",
            "equipment": ["equipment-id-1", "equipment-id-2"]
        },
        {
            "owner": "CompanyName",
            "site_name": "Split Site 2",
            "date_of_installation": "2025-01-01",
            "operator_status": "Active",
            "subpart_w_segment": "OOOOb",
            "start_date": null,
            "end_date": null,
            "operator_unique_id": "SS2",
            "other_operator_ids": "SS2-ALT,TESTCO-SS2",
            "geometry": {"type": "Polygon", "coordinates": [[[-103.495, 31.785], [-103.485, 31.785], [-103.485, 31.795], [-103.495, 31.795], [-103.495, 31.785]]]},
            "geometry_source": "OPERATOR_PROVIDED",
            "change_transactions": [{"type": "split", "date": "2025-01-01"}],
            "site_data_source": "Site Split Operation",
            "equipment": ["equipment-id-3", "equipment-id-4"]
        }
    ]
}

Parameters:

  • site_to_split: (Required) The ID of the site that should be split into multiple sites.

Data: An array of site specifications for the new sites that will be created from the split. Each site specification should contain all the same fields as would be used when creating a new site, plus:

  • equipment: (Optional) An array of equipment IDs from the original site that should be explicitly assigned to this new site.

Requirements:

  • All new sites must have the same owner as the site being split
  • All new sites must have a valid shape (geometry)
  • The site to split must exist in the database
  • All equipment without location must be explicitly assigned to new sites
  • All equipment IDs must belong to the original site

Error Conditions:

  • Fails if the site_to_split ID is invalid
  • Fails if any new site has a different owner than the site being split
  • Fails if any new site specification is missing a shape
  • Fails if the site specifications are invalid or missing required fields
  • Fails if any equipment ID in the equipment lists doesn't exist or doesn't belong to the original site
  • Fails if any equipment without location is not explicitly assigned to a new site

Effects:

When this operation runs successfully:

  1. New sites are created according to the provided specifications
  2. Equipment from the original site is reassigned to new sites:
    • Equipment explicitly listed in a site's equipment array is assigned to that site
    • Equipment not explicitly assigned is assigned to the closest new site based on spatial proximity
  3. Aerial images from the original site are reassigned to the closest new site based on spatial proximity
  4. Emission records that referenced the original site are updated to reference the closest new site based on the emission location
  5. Site matches in emission records are updated to include all the new sites
  6. The original site is permanently deleted