From 34e63f8f25ebf9923b0ab6a1711b332e22bdb959 Mon Sep 17 00:00:00 2001 From: Michael Stenta Date: Wed, 27 Mar 2024 06:49:45 -0400 Subject: [PATCH] Add geometry/location fields to CSV importers --- .../modules/csv/migrations/csv_asset.yml | 19 +++++++++++++++++++ .../import/modules/csv/migrations/csv_log.yml | 14 ++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/modules/core/import/modules/csv/migrations/csv_asset.yml b/modules/core/import/modules/csv/migrations/csv_asset.yml index ea18f9addb..4fde8211b5 100644 --- a/modules/core/import/modules/csv/migrations/csv_asset.yml +++ b/modules/core/import/modules/csv/migrations/csv_asset.yml @@ -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 @@ -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.' diff --git a/modules/core/import/modules/csv/migrations/csv_log.yml b/modules/core/import/modules/csv/migrations/csv_log.yml index 7741c9316a..07fb610332 100644 --- a/modules/core/import/modules/csv/migrations/csv_log.yml +++ b/modules/core/import/modules/csv/migrations/csv_log.yml @@ -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 @@ -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 @@ -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.'