4.5 KiB
Dynamic segmentation function
A function that exposes the dynamic segmentation algorithm for the pipeline use case.
This function will recompute the segmentation for all pipelines based on the provided segmentation configuration
Segmentation is the process of taking local data, crossings, and facilities on the pipeline and creating pipeline segments where this local data changes (a cut line).
In fathom we support dynamic segmentation where the user is able to configure the properties they would like to consider when segmentizing and to support re-segmentizing the pipeline at any point such as when new data is available from an ILI report.
Segmentation can be dynamically configured to consider the following properties
- pipeline diameter (currently required)
- wall thickness (currently required)
- material grade
- coating type
- design factor
- high consequence area
- unusual sensitive area
- join type
- soil type
- soil ph
Additionally the following crossing types can be considered
- Road
- River
- Railroad
- Overhead
- Highway
- Pipeline
Finally, the following facilities can also be used to create cut lines
- Valves
- Insulation joints
- Repairs
The user is able to configure which the the local properties and which of the crossing and facility types they would like to consider for creating the segmentation. For the purpose of the analytics required later in the process we require the user segments on diameter and wall thickness. The other properties are optional.
Example
diameter ├──────────────────────────┼────────────────────────────────────┤
40 inch 42 inch
wall thickness ├───────┼─────────────────────────────────────────────────┼─────┤
12.0 9.0 12.0
material grade ├──────────────────────────┼──────────────────────────────┼─────┤
L290 L320
design factor ├─────────────────────────────────────────────────────────┼─────┤
L72
road crossing ├──┤ ├──┤
river crossing ├──┤ ├──┤
valve │ │
repair ├─┤
segments ├─┼──┼──┼──────────┼──┼────┼────┼─┼──────────┼──┼──┼──┼───┼──┼──┤
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Input
Arguments
org_id: as string which should be a validuuidfor the organizationproject_id: the id of the data project where the pipeline data is foundfacilities: an array ofstringeach value should be one ofinsulation_jointrepairvalve.
crossings: an object with key for each supported crossing type and values as objects representing the selected valueslocal_data: an array ofstringeach value should be one ofmaterial_gradecoating_typedesign_factorhigh_consequence_areaunusual_sensitive_areajoint_typesoil_typesoil_ph
Creating the function on the platform
To create this function on the platform using the cli set up the port forwarding as shown in README.
Then run the following command to create the function.
cargo run functions create \
-f functions/segmentation \
-d "Runs the segmentation algorithm for the provided pipelines" \
-i org_id=string \
-i project_id=string \
-i pipeline_id=array \
-i facilities=array \
-i crossings=object \
-i local_data=array
Testing the function locally
You can run and test the function locally by running
cargo run
Then you can check it work with curl as follows
curl localhost:8080 -d $(jq '. | tojson' functions/segmentation/example_input.json)