-
Notifications
You must be signed in to change notification settings - Fork 4
GPS Draw Tool
This document outlines core functionality of the Map drawing tool that leverages the Users GPS To create GeoShapes. The tool currently supports workflows for Polygons and LineStrings.
---
title: Sequence Diagram for GPS Draw Tool
---
sequenceDiagram
actor User
participant Frontend
participant Redux
participant Callback
User->>Frontend: User Selects draw me tool
Frontend->>Redux: Dispatch Action Fired
Redux->>Frontend: new prompt added to Prompt[]
Frontend->>User: User Prompted for GeoShape
User->>Frontend: User Selects LineString
Frontend->>Callback: Callback action performed
Callback->>Redux: Dispatch action fired
Redux->>Frontend: Tracking started
Redux->>Frontend: Alert added to Alert[]
Frontend->>User: User sees tracking has begun
loop While user tracking
Frontend->>Redux: GPS Fires Update
Redux->>Frontend: Coordinate appended, UI Updates
end
User->>Frontend: User Stops Tracking
Frontend->>Redux: Dispatch action fired
Redux->>Redux: Validation Performed
alt is errors
Redux->>Frontend: Errors pushed to Alert[]
Frontend->>User: User sees alert errors
User->>Frontend: User Corrects errors, presses Stop Tracking
Frontend->>Redux: Dispach Action Fired
end
Redux->>Frontend: new prompt added to Prompt[]
Frontend->>User: User Prompted for buffer radius
User->>Frontend: User inputs "5 meters"
Frontend->>Callback: Callback Action performed
Callback->>Redux: Dispatch action called
Redux->>Frontend: Shape & UI Updated, Tracking stopped
-
Shape Selection: Users initiate the drawing process by selecting the Track me Button followed by the Draw Type (Polygon or Linestring) from a prompt
-
GPS Data Collection: Once a shape is chosen, the tool begins collecting the GPS Coordinates, storing them in an array. These coordinates are continuously plotted on the map to provide real-time visual feedback
-
Shape Completion: Users finalize the shape by toggling the draw tool button. The tool then validated the shape based on the selected type. Some checks include:
- Minimum number of coordinates
- No intersecting sections
- Minimum area covered by the shape
-
Shape Editing: Users can edit shapes while on the go my simply selecting the shape on the map. They can adjust points or add new ones.
-
Linestring Buffering: For Linestrings, a post-drawing prompt allows users to add a buffer margin, converting the Linestring into a Polygon