dceejay / RedMap

A web map app for Node-RED to put blobs on
Apache License 2.0
110 stars 60 forks source link

WorldMap tracks #110

Closed ChristopherO1 closed 5 years ago

ChristopherO1 commented 5 years ago

As requested

Report into Worldmap tracks, as discussed in https://discourse.nodered.org/t/worldmap-gps-tracking/13895/17

Tracks sometimes not displaying in the trace When the trace points reaches the specified max in the tracks node, the trace is deleted to restart, rather than just removing the oldest point

GPS data, used to plot traces, as requested AbeewayData.txt DraginoData.txt

there are two devices in the second file

dceejay commented 5 years ago

Hi

this is my test flow

[{"id":"acff489f.c561b8","type":"worldmap","z":"a68cca8a.e5ba98","name":"","lat":"","lon":"","zoom":"","layer":"OSM","cluster":"","maxage":"","usermenu":"show","layers":"show","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"false","coords":"deg","showgrid":"true","path":"","x":390,"y":480,"wires":[]},{"id":"d54e493a.56cce8","type":"worldmap-tracks","z":"a68cca8a.e5ba98","name":"","depth":"6","layer":"separate","x":370,"y":440,"wires":[["acff489f.c561b8"]]},{"id":"ebd4a1dc.3aff5","type":"function","z":"a68cca8a.e5ba98","name":"Add icons and colour","func":"if (msg.payload.name === \"LGT92-01819092\") {\n    msg.payload.icon = \"male\";\n    msg.payload.color = \"#000\",\n    msg.payload.iconColor = \"green\"\n}\nif (msg.payload.name === \"LGT92-01819094\") {\n    msg.payload.icon = \"twitter\";\n    msg.payload.color = \"#44A\",\n    msg.payload.iconColor = \"cyan\"\n}\nreturn msg;","outputs":1,"noerr":0,"x":180,"y":400,"wires":[["66d2df66.92ab","d54e493a.56cce8","acff489f.c561b8"]]},{"id":"66d2df66.92ab","type":"debug","z":"a68cca8a.e5ba98","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":390,"y":400,"wires":[]},{"id":"83ca4e74.17293","type":"change","z":"a68cca8a.e5ba98","name":"","rules":[{"t":"move","p":"payload.DeviceName","pt":"msg","to":"payload.name","tot":"msg"},{"t":"move","p":"payload.Latitude","pt":"msg","to":"payload.lat","tot":"msg"},{"t":"move","p":"payload.Longitude","pt":"msg","to":"payload.lon","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":340,"wires":[["ebd4a1dc.3aff5"]]},{"id":"c2c4f04b.f5351","type":"json","z":"a68cca8a.e5ba98","name":"","property":"payload","action":"","pretty":false,"x":270,"y":340,"wires":[["83ca4e74.17293"]]},{"id":"99b1e032.0c395","type":"delay","z":"a68cca8a.e5ba98","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"2","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":110,"y":340,"wires":[["c2c4f04b.f5351"]]},{"id":"fd9fe4e9.ee12a8","type":"file in","z":"a68cca8a.e5ba98","name":"","filename":"/Users/conway/Downloads/DraginoData.txt","format":"lines","chunk":false,"sendError":false,"encoding":"none","x":370,"y":280,"wires":[["99b1e032.0c395"]]},{"id":"9f5fd8ea.52e5e8","type":"inject","z":"a68cca8a.e5ba98","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":280,"wires":[["fd9fe4e9.ee12a8"]]}]

It seems to work OK for me - displaying last 5 positions as a track for each of the devices in the second dataset

dceejay commented 5 years ago

Pushed as version 2.0.19 to check we are using identical versions

ChristopherO1 commented 5 years ago

Hi Dave

I loaded your test flow, and run it. All seemed ok, could see the tracks being drawn on the map. Increased the number of points to 20, all still good. could see the oldest trace point being deleted as time passed.

Your flow is drawing new points every second Mine is dependant on the GPS devices, minimum time is 5 min, and out to ~30min this may have been causing my missing traces in the track.

Upgraded the Worldmap to 2.0.19, and now have a problem Just have a white screen for the maps. The menu doesn't expand out either

this is an issue for both your test flow, and my original flow as well

[image: image.png]

is there any way I can revert back to 2.0.18? Or is there something missing in my config?

[image: image.png]

I've stopped and restarted the server a couple of times, to no avail.

Thanks

Chris

On Wed, 7 Aug 2019 at 21:58, Dave Conway-Jones notifications@github.com wrote:

Pushed as version 2.0.19 to check we are using identical versions

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dceejay/RedMap/issues/110?email_source=notifications&email_token=AJ2BDAX7IX6A4YRK7EDHFVDQDMZNRA5CNFSM4IJTWTOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3ZV7YA#issuecomment-519266272, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ2BDAT7LDIWWCRLHLGZNBDQDMZNRANCNFSM4IJTWTOA .

--

MULTITONE ELECTRONICS PLC

Shortwood Copse Lane

Kempshott

BASINGSTOKE

HANTS

RG23 7NL

Tel: 01256845156

Fax:01256462643

chris.oultram@multitone.com

--


Disclaimer

This e-mail is confidential and may contain privileged information. If you are not the addressee or if you have received the e-mail in error, it may be unlawful for you to read, copy, distribute,  disclose or otherwise use the information which it contains.  Under these circumstances, please notify us immediately by returning this mail to  postmaster@multitone.com mailto:postmaster@multitone.com and deleting this e-mail from your system.

In addition, any views expressed by an individual within this e-mail do not necessarily reflect the views of Multitone Electronics PLC. Whilst we have taken reasonable steps to ensure that this e-mail and attachments are free from viruses, recipients are advised to subject this mail to their own virus checking, in keeping with good computing practice. 

If this e-mail refers to a quotation for the supply of goods and/or services,  it does not enter Multitone Electronics Plc into a legally binding contract nor does it commit Multitone Electronics Plc to accepting such an offer. All quotations are sent based on the terms and conditions and exclusions of Multitone Electronics Plc which are available either, on request, or found on our website at  http://www.multitone.com/terms-conditions/ http://www.multitone.com/terms-conditions/.

Head Office & Registered Address: Multitone House, Shortwood Copse Lane, Kempshott, Basingstoke, Hampshire, RG23 7NL.  UK Registered in England Number 256314. VAT Registration Number 232 1507 09.  This email was scanned for viruses, vandals and malicious content


ChristopherO1 commented 5 years ago

Hi Dave I managed to get my Maps to display. Small typo in /worldmap/worlmap.js line 1681

edit was //if (cmd.map.hasOwnProperty("fit") && cmd.map.fit === true)) { map.fitBounds(overlays[cmd.map.overlay].getBounds()); }

to if (cmd.map.hasOwnProperty("fit") && cmd.map.fit === true) { map.fitBounds(overlays[cmd.map.overlay].getBounds()); }

Chris

dceejay commented 5 years ago

Doh - mea cupla - will fix... Meanwhile do you have the marker timeout set - default is 600s (10 mins) - image

set to 0 to disable timeout.

v 2.0.20 now up...

ChristopherO1 commented 5 years ago

still got a missed trace point image

this is the file of the track points, for that device Dragino92Trax.txt if it helps

ChristopherO1 commented 5 years ago

Think I may have sussed out why, or at least a potential cause of, the missed track(s) in the trace This is an ongoing development project. I've just changed something and deployed it, and looking at the map, I have a missing track in the trace.

dceejay commented 5 years ago

can you confirm ? can we close this issue now ?

INDRANI125 commented 3 years ago

Can I have more than 20 points in track node that comes with nodered? As my object is moving, there can be more than 20 points.What can be maximum value for number of points in track?

dceejay commented 3 years ago

you can set the number of points to whatever you like. The only limit is the memory on your server and browser

INDRANI125 commented 3 years ago

you can set the number of points to whatever you like. The only limit is the memory on your server and browser

Hi.. Thank you for your reply :-) 1.Is there any way to see memory consumption data or chart based on changing track points? 2.Also when I redeploy nodered flow old tracks I am not able to see.Is there any work around for that or not? 3.In tracking node, do we have any property to make the lines curved like route like we have in draw layer of polygon?using tracking node I want to see lines like route instead of straight line.Can you suggest?

dceejay commented 3 years ago

1) usual operating system tools and browser console tools 2) you could maybe use a modified nodes deploy option to only stop/start those that have changed ? otherwise no - you would need to store old points yourself somewhere like a database or file. 3) which version of worldmap do you have - there should be a smooth curve option already image

INDRANI125 commented 3 years ago

For point number 3 upgraded to new version and ticked that but still getting straight lines not routes like we get in google map. I want path like we get in drawing layer after we draw polylines and finish with route. path setting_track pathroute

dceejay commented 3 years ago

tracks won't use routes as it doesn't know if you are walking, a car or a plane etc.. so it just smoothes the lines between the points you give it. If you record more points as you travel it will plot them on the route you take. I'm not quite sure what you actual requirement is as we can't assume the object takes any particular road.

dceejay commented 3 years ago

There are several online route generators you could call including http://project-osrm.org/ and https://developer.here.com/products/routing for example - that you can call with your points and get back a polyline. I'm not going to expose that in the tracks node as making too many calls to those will be against their Ts&Cs - but you can easily call them yourself.

INDRANI125 commented 3 years ago

for example I am having some car whose coordinates are changing and I want to track in map. Currently tracking is happening. I just want to know can we change straight line like curved line shown in third image via tracking node?

dceejay commented 3 years ago

simple answer is no - the track node does not do that... it just draws line (or curve) between the actual measurement points. If you are tracking at say 1 point per second it should be pretty good - but yes will totally depend on your update rate. If you really need it on roads then yes you will need to save the points outside fo Node-RED - call a routing service like above, and then send the generated line in instead.

INDRANI125 commented 3 years ago

Thank you for your reply. As you mentioned track node draws line( or curve).currently I am drawing line.but i want curve like you mentioned.to get curve instead of line what parameter should I change or feed to track node?

dceejay commented 3 years ago

for curves tick the smooth tracks checkbox as you have above.

image