Update Dev Notes
parent
5526532d97
commit
90f7f0c22c
@ -1,11 +1,12 @@
|
||||
## 20240117
|
||||
|
||||
Example SQL query to create a `qgis_friendly` view that converts Cayenne GPS location into PostGIS point, includes RSSI, time, and gatewayId, and filters on gatewayId:
|
||||
Example SQL query to create a `qgis_friendly` view that converts Cayenne GPS location into PostGIS point, includes unique ID, RSSI, time, and gatewayId, and filters on gatewayId:
|
||||
|
||||
```sql
|
||||
CREATE OR REPLACE VIEW qgis_friendly AS
|
||||
WITH data(gatewayId, time, alt, lat, lon, rssi) AS
|
||||
WITH data(id, gatewayId, time, alt, lat, lon, rssi) AS
|
||||
(SELECT
|
||||
deduplication_id,
|
||||
rx_info -> 0 ->> 'gatewayId',
|
||||
time,
|
||||
CAST (object -> 'gpsLocation' -> '1' ->> 'altitude' AS FLOAT),
|
||||
@ -14,6 +15,7 @@ WITH data(gatewayId, time, alt, lat, lon, rssi) AS
|
||||
CAST (rx_info -> 0 ->> 'rssi' AS INTEGER)
|
||||
FROM event_up)
|
||||
SELECT
|
||||
id,
|
||||
gatewayId,
|
||||
time,
|
||||
ST_SetSRID(ST_MakePoint(lon, lat, alt), 4326) AS location,
|
||||
|
Loading…
x
Reference in New Issue
Block a user