DJTommek / better-location

Telegram bot for parsing and generating various of location formats.
https://t.me/BetterLocationBot
MIT License
7 stars 2 forks source link

MapyCz service - place ID #1

Closed DJTommek closed 4 years ago

DJTommek commented 4 years ago

If there is used id=??? as integer in link from MapyCz, that is probably some place ID which might be in different location than different than x=xxx and y=yyy which refers to position of map. For example, in this case, location of ID is the same as coordinates: https://en.mapy.cz/zakladni?x=16.1559058&y=50.5331523&z=17&source=base&id=2258106 -> 50.533152,16.155906 But in this case coordinates are little bit off as user in browser moved map a little bit so result location is somewhere else: https://en.mapy.cz/zakladni?x=16.1493719&y=50.5321566&z=17&source=base&id=2258106 -> 50.532157,16.149372 If you are sending location to some point, that is not place, there are coordinates in id=yy,xx which is correctly processed even if map itself is little bit off as previous link: https://en.mapy.cz/zakladni?x=16.1549563&y=50.5331455&z=18&source=coor&id=16.155578570500182%2C50.53311479225323 -> 50.533115,16.155579

Options:

  1. resolve ID to coordinates. Currently there is no official backend API so only way to simulate frontend requests - tried, it is probably possible but hard since they are using some custom Fast RPC. Sources:
  2. add warning, that coordinates from MapyCz might be inaccurate if id=?? is available and it's not coordinates (temporary solution of course)
DJTommek commented 4 years ago

Created issue #4 for rewriting to PHP to remove this workaround.