How to visualize GPS coordinates on a map using Node red? - gps

I'm trying to track the location of an object/vehicle for this, I'm using a GY-GPS6MV2 module for getting GPS coordinates. I'm streaming those values to Bluemix - Internet of Things cloud platform and trying to visualize the data on maps from node red using the WorldMap node. But while doing so I couldn't map them on the OpenStreetMap.
I have gone through the documentation on WorldMap node. But couldn't get the insights which are useful for me. Can you please help in this context?
Link :WorldMap NodeRed

From the worldmap node docs:
Usage
Plots "things" on a map. The map will be served from
{httpRoot}/worldmap
The minimum msg.payload must contain name, lat and lon properties,
e.g.
{name:"Joe", lat:51, lon:-1.05}
name must be a unique identifier across the whole map. Repeated location updates to the same name move
the point.
At the moment your msg.payload is a string with lat, then 2 new lines and then the lon value. You need to build a msg.payload that matches what's in the doc. This is probably best done directly from the output of the IBM IoT node as it looks to already be a JSON object which will make it easier to extract the correct values.

Related

FIWARE: GPS DATA ON CrateDB AND VISUALIZATION ON GRAFANA

Actually, I am experimenting with FIWARE and IoT systems and I need to visualize on Grafana the localization of a specific device using a GPS. All data that GPS sends to Orion Context Broker (OCB) is latitude, longitude, altitude and they are in Cayenne LPP Format. My DataBase is based on CrateDB and QuantumLeap allows me to subscribe to changes in the OCB and copy them to the database
The request from Insomnia is here
For the beginning, I used the following post to subscribe the IoT LoRaWan Agent to the platform that supports this protocol (The Things Network Or ChirpStack)
After the subscription, the system automatically generates a table with data type float and only works with The Things Network, the problem is as soon as I add a second GPS device it is of type "String" instead of being of type "Object" so latitude, longitude, and altitude data do not appear.
Later, I used the data type "geo: point" instead of "float" and it is possible to record GPS data in CrateDB, because it is 2D location but the data is stored in String and Grafana cannot use this type of data Does anyone know what can be the ideal configuration?
Note: CrateDB don't support 3D geolocalization just 2D geolocalization
Solved!!
I added a new object with a new two-variable (latitude and longitude) these ones are created based on the original variable gps_1 type geo_point
Solution create new object

Mapbox API requests for Static Map and Polyline

I'm rewording a question I asked earlier in hopes that it will get me some feedback.
I need to generate a static map from Mapbox that shows two end points and the polyline route between them. The method outlined below is what I'm using. It sometimes works and sometimes doesn't--and that is what's driving me crazy.
First, I use the two GPS end points to make an API request that generates the polyline. Then I use a second API request with the two end points and the polyline to generate the static map. The first part always seems to work. I get an encoded polyline that I can run through an online decoding tool and it shows the various points along the path just fine, but the second step to generate the map from Mapbox sometimes gives me the expected map and sometimes gives me an error code. The code is usually {"message":"Not Found"}, but sometimes I get a {"message":"Not Authorized - No Token"} error code.
I use this API with the two end points to get a JSON file that has a polyline:
https://api.mapbox.com/directions/v5/mapbox/driving/POINT1;POINT2?access_token=TOKEN
Then, once I have the polyline, I am using this API to generate the map:
https://api.mapbox.com/styles/v1/mapbox/streets-v11/static/pin-s-a+9ed4bd(POINT1),pin-s-b+000(POINT2),path-5+f44-0.5(POLYLINE)/auto/500x300?access_token=TOKEN
This works fine...
Point 1 = -87.321536,36.584454
Point 2 = -104.793676,38.749513
Polyline = }kh~Ez{}sO|HUuHmj#uhHbOyAla#kisAdelC|aMf~w#egO|uaAahfBr{|#w_#sAozkCcwFsp#v]__w#hjFjf#bdCkaJhmzAiyXtzb#fJ|{#{p[|~yErtBdacE{x^vkvHrZfuKo[tpBfxSrcuBocGpi_AqhCvjb#wgAvfsDhyc#fkrD~mD~bkDayD~ywCsui#vjmEoyBpk|AiOhHrvEdueApda#huoA|v[zuhFsySvwaAvbDwqHxXpwDYj#riJULheEfXh^tdAj~I^gIhAkEY~#kHseBlGyC^kA
Map API request = https://api.mapbox.com/styles/v1/mapbox/streets-v11/static/pin-s-a+9ed4bd(-87.321536,36.584454),pin-s-b+000(-104.793676,38.749513),path-5+f44-0.5(}kh~Ez{}sO|HUuHmj#uhHbOyAla#kisAdelC|aMf~w#egO|uaAahfBr{|#w_#sAozkCcwFsp#v]__w#`hjFjf#bdCkaJhmzAiyXtzb#fJ|{#{p[|~yErtBdacE{x^vkvHrZfuKo[tpBfxSrcuBocGpi_AqhCvjb#wgAvfsDhyc#fkrD~mD~bkDayD~ywCsui#vjmEoyBpk|AiOhHrvEdueApda#huoA|v[zuhFsySvwaAvbD`wqHxXpwDYj#riJULheEfXh^tdAj~I`^gI`hAkEY~#kHseBlGyC^kA)/auto/500x300?access_token=TOKEN
Map (yay!)
This does not work...
Point 1 = -87.321536,36.584454
Point 2 = -85.855218,37.690038
Polyline = }kh~Ez{}sO|HUtCurC}xCkhC}~BqvIuc_#o~l#oaI}aUrs#kkL}~Iso\qHoyGsiKaTpQcRdlGusK_DEiz#w^cwOakJurAizT{hCugF_bBenSsOclZkdCw]mgEwyDogLgfBatEubCmkGxa#icLe_Do_Spf#cw]}sEgOaDgT{[zFyIk~Bts#
Map API request = https://api.mapbox.com/styles/v1/mapbox/streets-v11/static/pin-s-a+9ed4bd(-87.321536,36.584454),pin-s-b+000(-85.855218,37.690038),path-5+f44-0.5(}kh~Ez{}sO|HUtCurC}xCkhC}~BqvIuc_#o~l#oaI}aUrs#kkL}~Iso\qHoyGsiKa`TpQcRdlGusK_DEiz#w^cwOakJurAizT{hCugF_bBenSs`OclZkdCw]mgEwyDogLgfBatEubCmkGxa#icLe_Do_Spf#cw]}sEgOaDgT{[zFyIk~Bts#)/auto/500x300?access_token=TOKEN
No Map :-(
This is a small part of a much bigger project where I am automating the process for generating project reports, but the problem isn't with my jQuery/AJAX code. It's a problem with my APIs and/or Mapbox. If there is a better/faster/easier way to get these maps, then I am absolutely open to suggestions, because this does not seem like the most efficient way to do it. I will be generating these reports from a computer. I am not worried about bandwidth or scaling down for a phone application. The file can be as cumbersome as it wants to be as long as I can consistently generate a map every time.
Steve's comment hints at the right solution, but just to make it absolutely clear - this is happening because you are not properly encoding the path polyline in your request. Polylines in particular have a nasty habit of including reserved characters that will break URIs unless properly encoded at the time of the request.
When I encode the polyline portion of your path overlay with a simple tool like url encode decode, I'm able to make your request work as expected:
https://api.mapbox.com/styles/v1/mapbox/streets-v11/static/pin-s-a+9ed4bd(-87.321536,36.584454),pin-s-b+000(-85.855218,37.690038),path-5+f44-0.5(%7Dkh~Ez%7B%7DsO%7CHUtCurC%7DxCkhC%7D~BqvIuc_%40o~l%40oaI%7DaUrs%40kkL%7D~Iso%2FqHoyGsiKa%60TpQcRdlGusK_DEiz%40w%5EcwOakJurAizT%7BhCugF_bBenSs%60OclZkdCw%5DmgEwyDogLgfBatEubCmkGxa%40icLe_Do_Spf%40cw%5D%7DsEgOaDgT%7B%5BzFyIk~Bts%40)/auto/500x300?access_token=MAPBOX_ACCESS_TOKEN
⚠️ disclaimer: I currently work at Mapbox ⚠️

Unable to create labels for WebGL Feature Layer, esriGeometryPolyline is not supported

I publish service from arcgis server and I am using it with the arcgis js 4.9. But one of Feature Layer I faced error :
[esri.views.2d.engine.webgl.WGLMeshFactory] ,
mapview-labeling:unsupported-geometry-type,
Unable to create labels for WebGL Feature Layer, esriGeometryPolyline is not supported"
Now I can not show Label of layer. How can I solve it?
Looking at the 4.9 source code, the esriGeometryPolyline geometry type have "null" for value of possible label placements, and this will give you the error mentioned.
You could try to upgrade to 4.11, which has the "center-along" value available for esriGeometryPolyline.
I am currently researching an error where a user has gone from 4.4 to 4.11 and has gotten various display problems, which are probably related to some setting of labels in the web map and label placement for polylines.

How To: Save JMeterVariable values to influxdb with the sampleresults

I'd like to store some JMeterVariables together with the sampleResults to an influxdb using a BackendListenerClient for influxdb (I am using package rocks.nt.apm.jmeter to get the raw results).
My current test logs in for a random customer requests some random entities and logs out. Most of the results are within a range, I'd like to zoom in to certain extreme sample results, find out for which customer / requested entity these results are. We have seen in the past we can find performance issues with specific configurations this way.
I store customer and entity ID in a variable. My issue is that the JMeterVariables are not accessible from the BackendListenerClient. I looked at the sample_variables property, but this property will store the variables in the sampleEvent, which is not accessible in the BackendListener.
I could use the threadName, or sample label to store the vars, but I saw the CSVwriter can actually write the var values from the event, which is a much nicer solution.
Looking forward on your thoughts,
Best regards, Spud
You get it right - the Backend Listener is not customizable in terms of fine-shaping the data you're sending to Influx.
Alas.
However, there's a Swiss Army Knife always available in JMeter: the JSR223 components.
The JSR223 listener, in your case.
The InfluxDB line protocol is simple as simple could be, the HTTP/Rest libraries are
in abundance (Apache HTTP must have been already included with standard JMeter, to my recollection, no additional jars needed) - just pick it all up, form your timeseries as you like, toss it towards your InfluxDB REST endpoint, job's done.

How to use osrm properly

I am having a route consisting of 2 points
I would like to find all GPS coordinates in the route but I want get GPS coordinate every 4 km... Is this possible please? I am lost here, I want to use this:
https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md
What I tried is used route service
http://router.project-osrm.org/route/v1/driving/49.209243,18.757936;48.158645,17.106259?steps=false&geometries=geojson&overview=full&annotations=true
But How to specify the distance? or at least how could I specify I want only 40 GPS points? Thank you.
I don't think you can specify how many points you want returned, or how far apart they should be. I believe you would need to perform this operation in your own code after requesting ALL the points from OSRM. Because you have specified annotations=true in your request you will receive data about the distance for each Waypoint. Using this you should be able to process the data to only contain one Waypoint every 4km.