Comments (7)
Beta and live maps work for me
from air-quality-web.
Fixed! Now I just need to deploy it.
from air-quality-web.
The fix should be deployed to the beta version, @bsimmo. Perhaps you could test it and confirm that it's fixed?
from air-quality-web.
from air-quality-web.
And me - live map is still there
from air-quality-web.
Ack! It shouldn't have done that. It should be fixed now @BNNorman @bsimmo
from air-quality-web.
Site is working, but the API list-devices-near is not quite working.
If I asked for 3 locations, I would get three before (as intended)
Now I just get the same one (nearest) three times.
Example Python3 code
import json
from urllib import request, parse
api_url = "http://sensors.connectedhumber.org/beta/api.php?action="
no_of_locations = 3
my_location = ( 53.750, -0.395 )
def get_nearest_sensors( my_location, no_of_locations ):
url = str( api_url ) + "list-devices-near&count=" + str( no_of_locations )
data = parse.urlencode( {'latitude': my_location[0], 'longitude': my_location[1]} ).encode()
req = request.Request( url, data=data )
response = request.urlopen( req )
return response
# ------- #
nearest_sensors = json.loads( get_nearest_sensors( my_location, no_of_locations ).read().decode('utf-8') )
print( nearest_sensors )
for line in nearest_sensors:
print( line['id'], line['name'], "is", round( line['distance_actual']*0.000621, 1), "miles away" )
print("----------")
Currently returns
[{'id': 36, 'name': 'CHASW-24AD43-1', 'latitude': 53.75642593, 'longitude': -0.36844245, 'distance_calc': 1886.588853560329, 'last_seen': '2020-03-08 21:32:06', 'distance_actual': 1892.19}, {'id': 36, 'name': 'CHASW-24AD43-1', 'latitude': 53.75642593, 'longitude': -0.36844245, 'distance_calc': 1886.588853560329, 'last_seen': '2020-03-08 21:32:06', 'distance_actual': 1892.19}, {'id': 36, 'name': 'CHASW-24AD43-1', 'latitude': 53.75642593, 'longitude': -0.36844245, 'distance_calc': 1886.588853560329, 'last_seen': '2020-03-08 21:32:06', 'distance_actual': 1892.19}]
36 CHASW-24AD43-1 is 1.2 miles away
36 CHASW-24AD43-1 is 1.2 miles away
36 CHASW-24AD43-1 is 1.2 miles away
Also as an aside, I thought
'distance_calc': 1886.588853560329
field was being removed as 'distance_actual' is the correct geodesic distance.
from air-quality-web.
Related Issues (20)
- Display the currently selected reading type on the heatmap when loading the device graph HOT 1
- Migration: Slow HTTP API calls HOT 9
- When clicking sensors on the AQ Map (sometimes) the map just zooms HOT 5
- Sensor filter HOT 12
- Mosquitto stuck Address in use (1883) HOT 3
- FTW says 6 hours ago but last reading was 12:00 (now 16:00) HOT 13
- Issue with web site on some devices HOT 22
- Repeated measurement types above chart HOT 5
- Can the charts be made to open with data rather than just say error: no data recorded HOT 1
- Slow charts HOT 5
- API action list-devices-near is not quite working - it returns only the same sensor HOT 8
- device.visible has no effect on the map HOT 7
- API and documents not working HOT 3
- Circles, on Opening the Map, don't disappear HOT 2
- Sensor not showing up correctly on current (0.14-dev) beta site HOT 5
- Last seen on chart is wrong HOT 6
- Wrong base URL in the API docs HOT 1
- graph not showing data for device bonus-a-abp HOT 5
- Integration with custom sensors and visual optimizations ? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from air-quality-web.