Skip to content

Commit

Permalink
Add geometry/location fields to CSV importers
Browse files Browse the repository at this point in the history
  • Loading branch information
mstenta committed Mar 27, 2024
1 parent 6cf3c1b commit 34e63f8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
19 changes: 19 additions & 0 deletions modules/core/import/modules/csv/migrations/csv_asset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ process:
source: parents
- plugin: asset_lookup

# Is location/fixed booleans.
is_location:
plugin: boolean
source: is_location
is_fixed:
plugin: boolean
source: is_fixed

# Intrinsic geometry.
intrinsic_geometry: intrinsic_geometry

# Asset status.
status:
- plugin: get
Expand All @@ -36,10 +47,18 @@ third_party_settings:
columns:
- name: name
description: Name of the asset. Required.
- name: intrinsic_geometry
description: The intrinsic geometry of the asset in WKT format (typically used for fixed locations).
- name: parents
description: Parents of the asset. Accepts asset names, ID tags, UUIDs, and IDs. Multiple assets can be separated by commas with the whole cell wrapped in quotes.
- name: notes
description: Notes about the asset.
- name: is_location
description: Whether this asset is a location. Accepts most boolean values. Leave this blank to use the default for this asset type.
- name: is_fixed
description: Whether this asset has a fixed location. Accepts most boolean values. Leave this blank to use the default for this asset type.
- name: intrinsic_geometry
description: The intrinsic geometry of the asset in WKT format. This is only used if the asset has a fixed location.
- name: status
description: 'Status of the asset. Allowed values: active, archived. Defaults to active.'

Expand Down
14 changes: 14 additions & 0 deletions modules/core/import/modules/csv/migrations/csv_log.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ process:
- plugin: term_lookup
bundle: log_category

# Geometry.
geometry: geometry

# Is movement boolean.
is_movement:
plugin: boolean
source: is_movement

# Log status.
status:
- plugin: get
Expand All @@ -97,6 +105,8 @@ third_party_settings:
description: Assets referenced by the log. Accepts asset names, ID tags, UUIDs, and IDs. Multiple assets can be separated by commas with the whole cell wrapped in quotes.
- name: locations
description: Location assets where the log took place. Accepts asset names, ID tags, UUIDs, and IDs. Multiple assets can be separated by commas with the whole cell wrapped in quotes.
- name: geometry
description: The geometry of the log in WKT format.
- name: quantity
description: Numeric quantity value. Accepts integers or decimals.
- name: quantity measure
Expand All @@ -109,6 +119,10 @@ third_party_settings:
description: Notes about the log.
- name: categories
description: Log category taxonomy terms. Multiple terms can be separated by commas with the whole cell wrapped in quotes.
- name: geometry
description: The geometry of the log in WKT format.
- name: is_movement
description: Whether this log represents an asset movement. Accepts most boolean values. Leave this blank to use the default for this log type.
- name: status
description: 'Status of the log. Allowed values: pending, done. Defaults to done.'

Expand Down

0 comments on commit 34e63f8

Please sign in to comment.