Location-based services (LBS) uses real-time location or geo-data from devices to monitor and track devices. The geo extension in WSO2 IoT Server provides real-time information about geospatial objects. It processes spatial data from an external source of events and analyzes/manipulates this data to produce meaningful information to end users. You can interact with it to generate a variety of alerts and warnings.
...
- Click on the Add Geofence Exit Alert button.
Define a geo area.
Expand title Click to see more information Panel borderColor #11375B bgColor #ffffff borderWidth 2 There are two ways to define a geofence area.
- Draw area - Draw an area on the map to set the boundaries of the geofence.
- Enter area - Enter a geoJSON containing coordinates to set the boundaries of the geofence. You can import a geofence using this option.
Draw area
- Click Draw Area.
- Select a shape (pentagon or square) on the drawing palette found on the left corner of the map.
Select points on the map to draw a pentagon geofence, or click and drag to draw a square or circle geofence.
Enter an appropriate name for the geofence, and click Save.
Enter area (Import area)
To enter or import an area using a geoJSON, you have to first draw an area using the map, as shown above, and then export it.Infotip Entering an area using a geoJSON is particularly useful when you want to import the exact same geofence for another device or another system. You can draw the geofence in the first device and then copy over the same fence with the exact coordinates to define the same geofence for a different device.
- Draw an area using the map, as shown above.
- Enter an appropriate name for the geofence and click Export. A geoJSON file will be downloaded on to your machine.
- Open the JSON file and copy the JSON code.
- Click Enter Area.
Do one of the following to import the geofence:
Click Choose File and select the JSON file you exported in step b. Click Import.
Enter the JSON you copied in step c to define the geofence boundary and click Import.The code block below shows a sample JSON.
Code Block { "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 79.85129186650738, 6.910663750244661 ], [ 79.85129186650738, 6.911776767011602 ], [ 79.85373804112896, 6.911776767011602 ], [ 79.85373804112896, 6.910663750244661 ], [ 79.85129186650738, 6.910663750244661 ] ] ] } }
...
- Click on the Add Geofence Enter Alert button.
Define a geo area.
Expand title Click to see more information Panel borderColor #11375B bgColor #ffffff borderWidth 2 There are two ways to define a geofence area.
- Draw area - Draw an area on the map to set the boundaries of the geofence.
- Enter area - Enter a geoJSON containing coordinates to set the boundaries of the geofence. You can import a geofence using this option.
Draw area
- Click Draw Area.
- Select a shape (pentagon or square) on the drawing palette found on the left corner of the map.
Select points on the map to draw a pentagon geofence, or click and drag to draw a square or circle geofence.
Enter an appropriate name for the geofence, and click Save.
Tip To adjust the coordinates or the geofence.
Enter area (Import area)
To enter or import an area using a geoJSON, you have to first draw an area using the map, as shown above, and then export it.Infotip Entering an area using a geoJSON is particularly useful when you want to import the exact same geofence for another device or another system. You can draw the geofence in the first device and then copy over the same fence with the exact coordinates to define the same geofence for a different device.
- Draw an area using the map as shown above.
- Enter an appropriate name for the geofence and click Export. A geoJSON file will be downloaded on to your machine.
- Open the JSON file and copy the JSON code.
- Click Enter Area.
Do one of the following to import the geofence:
Click Choose File and select the JSON file you exported in step b. Click Import.
Enter the JSON you copied in step c to define the geofence boundary and click Import.The code block below shows a sample JSON.
Code Block { "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 79.85129186650738, 6.910663750244661 ], [ 79.85129186650738, 6.911776767011602 ], [ 79.85373804112896, 6.911776767011602 ], [ 79.85373804112896, 6.910663750244661 ], [ 79.85129186650738, 6.910663750244661 ] ] ] } }
...
- Click on the Add Stationary Alert button.
Define a geo area.
Expand title Click to see more information Panel borderColor #11375B bgColor #ffffff borderWidth 2 There are two ways to define a geofence area.
- Draw area - Draw an area on the map to set the boundaries of the geofence.
- Enter area - Enter a geoJSON containing coordinates to set the boundaries of the geofence. You can also import a geofence using this option.
Draw area
- Click Draw Area.
- Select a shape (pentagon, square, or circle) on the drawing palette found on the left corner of the map.
Select points on the map to draw a pentagon geo-fence, or click and drag to draw a square or circle geofence.
Enter the following details and click Save.
- Fence name - Enter an appropriate name for the geo area.
- Fluctuation radius - Specify a radius. The fluctuation radius is used to minimize the fluctuation effect of the device.
- Time - The device should be stationary for the number of seconds specified in this field to generate a pop-up alert.
Enter area (Import area)
To enter or import an area using a geoJSON, you have to first draw an area using the map, as shown above, and then export it.infoTip Entering an area using a geoJSON is particularly useful when you want to import the exact same geofence for another device or another system. You can draw the geofence in the first device and then copy over the same fence with the exact coordinates to define the same geofence for a different device.
- Draw an area using the map as shown above.
- Enter an appropriate name for the geofence and click Export. A geoJSON file will be downloaded on to your machine.
- Open the JSON file and copy the JSON code.
- Click Enter Area.
Do one of the following to import the geofence:
Click Choose File and select the JSON file you exported in step b. Click Import.
Enter the JSON you copied in step c to define the geofence boundary and click Import.The code block below shows a sample JSON.
Code Block { "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 79.85129186650738, 6.910663750244661 ], [ 79.85129186650738, 6.911776767011602 ], [ 79.85373804112896, 6.911776767011602 ], [ 79.85373804112896, 6.910663750244661 ], [ 79.85129186650738, 6.910663750244661 ] ] ] } }
...