This System Template provides geospatial computation and spatial data interpretation.
It is functional out-of-the-box and is highly extensible.
This is an ipm package, which contains one or more reusable assets within the ipm Community. The 'package.json' in this repo is a ipm spec's package.json, here, which is a superset of npm's package.json spec, here.
- Connect your devices to ClearBlade Platform
- Publish to
/locationMQTT Topic using configurable Message JSON Schema - Configure your geofence in
RTAssetConfiguration
Note: Updates to Message schema requires changes to the location_logs and tags Collection schemas
- Devices publishes to
/locationtopic:
{"id":"<TAG_ID>","lat":<LATITUDE>,"long":"<LONGITUDE>}
- Geofence When a position is within a geofence, a response message is published on the
geofencetopic:
Point with ID: 2b is within geofence
npm i
npm run buildGraph
RTAssetTrackingPortal- Holistic view of your Real-Time Asset Tracking System, with a 3D Map of Tags
- Interactive 3D Map of New York City's Manhattan
- Pie Chart of Anomalies Detected
- Bar Chart of Zone Activity
- Time-Series Multi-Line Graph of activity
- Message Logs
- Monitoring Enable Switch
- Edge Selection
RTAssetLogLocation- creates row in location_logs collectionRTAssetUpdateTagLocation- updates tags collection with latest positionRTAssetCheckGeofence- checks if tag is within configured geofenceRTAssetRESTIntegration- Sends a configurable HTTP POST request
RTAssetConfiguration- Configuration for the SystemRTAssetUtil- Reusable utility methods for System
/location- Tags publish their position using configurable Message structure/geofence- Publishes status whether a tag is inside the geofence
location_logs- History of all MQTT Messages receivedtags- Latest location of all tags
RTAssetCheckGeofence_location- Runs RTAssetUpdateTagLocation upon publish to /location topicRTAssetLogLocation_location- Runs RTAssetLogLocation upon publish to /location topicRTAssetUpdateTagLocation_location- Runs RTAssetUpdateTagLocation upon publish to /location topic
- RTAssetCheckGeofence()
Performs real-time geofence functionalities
Triggered by /location topic
Status of a tag (inside or outside) is published the GEOFENCE_ALERT_TOPIC
- RTAssetHTTPIntegration()
Opportunity to integrate with a REST endpoint using location data
Triggered by /location topic
- RTAssetLogLocation()
Insert a row into COLLECTION_NAME upon a publish message to /location
Triggered by /location topic
- RTAssetRESTIntegration()
Opportunity to implement a REST-based integration to your Real-Time IoT Solution
A placeholder URL is used as an example
Triggered by /location topic
- RTAssetUpdateTagLocation()
Keeps track of a tag's most recent location
Triggered by /location topic
If a Tag with the corresponding ID is not found in the COLLECTION_NAME, a new row is created
Performs real-time geofence functionalities
Triggered by /location topic
Status of a tag (inside or outside) is published the GEOFENCE_ALERT_TOPIC
Opportunity to integrate with a REST endpoint using location data
Triggered by /location topic
Insert a row into COLLECTION_NAME upon a publish message to /location
Triggered by /location topic
Opportunity to implement a REST-based integration to your Real-Time IoT Solution
A placeholder URL is used as an example
Triggered by /location topic
Keeps track of a tag's most recent location
Triggered by /location topic
If a Tag with the corresponding ID is not found in the COLLECTION_NAME, a new row is created
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| id | string |
ID for a tag |
| lat | number |
Latitude in decimal degrees, ex. 30.266822 |
| long | number |
Longitude in decimal degrees, ex -97.742462 |
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| NWCorner | Point |
Northwest Corner |
| NECorner | Point |
Northeast Corner |
| SECorner | Point |
Southeast Corner |
| SWCorner | Point |
Southwest Corner |
Kind: global typedef
Link: geo library Point Object
Kind: global typedef
Link: geo library Coordinate System
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| messageSchema | Message |
Schema for MQTT JSON Message |
| geofenceBounds | GeofenceBounds |
Bounds for the geofence |
| Polar | CoordinateSystem |
coordinate system, can be changed to Cartesian |
RTAssetUtil.verifyMessageSchema(unparsed) ⇒ Message | false
Kind: static method of RTAssetUtil
Returns: Message | false - parsed message, false if failed
| Param | Type | Description |
|---|---|---|
| unparsed | string |
message body, needs to be JSON format |