Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tum-gis/FROST-on-a-map
Basic examples for bringing SensorThingsAPI Locations and HistoricalLocations to web maps as markers or trajectories.
https://github.com/tum-gis/FROST-on-a-map
2d-map frost-server historicallocations js leaflet locations ogc sensorthings sensorthingsapi web-map web-mapping
Last synced: about 1 month ago
JSON representation
Basic examples for bringing SensorThingsAPI Locations and HistoricalLocations to web maps as markers or trajectories.
- Host: GitHub
- URL: https://github.com/tum-gis/FROST-on-a-map
- Owner: tum-gis
- License: cc-by-sa-4.0
- Created: 2020-10-26T09:49:50.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-28T14:09:42.000Z (almost 4 years ago)
- Last Synced: 2024-08-04T05:01:33.584Z (5 months ago)
- Topics: 2d-map, frost-server, historicallocations, js, leaflet, locations, ogc, sensorthings, sensorthingsapi, web-map, web-mapping
- Language: JavaScript
- Homepage:
- Size: 1010 KB
- Stars: 4
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-sensorthings-api - SensorThingsAPI Locations on a map
README
======================================
SensorThingsAPI ``Locations`` on a map
======================================This repo contains some basic examples on how to query ``Locations`` and ``HistoricalLocations``
from an `OGC SensorThingsAPI `_ conform service,
as for instance `FROST-Server `_ instance and place them
on a web map using Open Source mapping APIs like `Leaflet.js `_.****************
Location markers
****************Plot the last ``Locations`` of all ``Things`` on a map and add a popup to the markers with basic
informations on the ``Thing``. To cluster markers at the same location
`Leaflet MarkerCluster `_ is used.Adapt line 16 of ``js/locationMarkers/locationMarkers.js`` to change the FROST instance.
.. code-block:: javascript
// Configure FROST instance
var frostBaseURL = 'https://my.frost.server.de/FROST-Server/v1.1';Open ``locationMarkers.html`` in a browser to view the results.
.. image:: docs/img/locationMarkers.jpg
:width: 600
:alt: Locations markers with clustering for markers at same locations.***************************************************************
Trajectory with directional arrows from ``HistoricalLocations``
***************************************************************Query the last n ``HistroicalLocations`` from a given ``Thing`` in a time period (optional)
and plot a trajectory with `ArrowHeads `_
from it.Adapt lines 15-18 of ``js/trajectory/trajectory.js``:
.. code-block:: javascript
// FROST server, Thing, number of HistoricalLocations, time filter (optional)
var frostBaseURL = 'https://my.frost.server.de/FROST-Server/v1.1';
var thingIotID = 16;
var nHistoricalLocations = 10;
var timeIntervalFilter = '$filter=time%20gt%202020-10-20T00:00:00.000Z%20and%20time%20lt%202020-10-22T23:59:59.999Z';Open ``trajectory.html`` in a browser to view the result.
.. image:: docs/img/example-trajectory.jpg
:width: 600
:alt: Example trajectory from FROST HistroicalLocations