rand256 / valetudo

Valetudo RE - experimental vacuum software, cloud free
Apache License 2.0
667 stars 73 forks source link

Accessing map data as json with /api/map/latest #233

Closed Fynmar91 closed 4 years ago

Fynmar91 commented 4 years ago

Hi, I am playing around with valetudo and valetudo RE and I am having trouble with /api/map/latest. When I call /api/map/latest on valetudo 0.5.1 I get a nice json with x,y coordinates. Doing the same on 0.8.x or 0.9.x I get a file without ending that doesn't seem to hold useful data.

Not sure what I am doing wrong. I am probably being stupid. Best Regards

rand256 commented 4 years ago

Doing the same on 0.8.x or 0.9.x I get a file without ending that doesn't seem to hold useful data.

This "file without encoding" contains all the useful data and takes multiple times less bandwidth. Some reasoning behind that change was published in changelog for 0.4.0.-RE6.

Fynmar91 commented 4 years ago

Thank you for the fast reply. *"file without ending" I am sure it is encoded I just cant figure out how to decode it. I figured it was gzipped, since I read that somewhere, but no luck so far. I can probably find out how to decode it by checking out valetudo-mapper? Sorry for the bother

rand256 commented 4 years ago

Yes, there its content is ungzipped and then put into PARSE() from RRMapParser.js.

Fynmar91 commented 4 years ago

Very nice, thanks!