-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for bing map url quadkey in ros1 branch #126
base: ros1
Are you sure you want to change the base?
Conversation
Cool! Would you mind making the same change for ROS2? |
Sorry. I am not familiar with ROS2 now. Hope the ROS1 commit can be merged to the branch. haha |
Alright, I'll do a review and forward port myself. |
@@ -45,6 +45,11 @@ std::string tileURL(TileId const& tile_id) | |||
boost::replace_all(url, "{x}", std::to_string(tile_id.coord.x)); | |||
boost::replace_all(url, "{y}", std::to_string(tile_id.coord.y)); | |||
boost::replace_all(url, "{z}", std::to_string(tile_id.zoom)); | |||
|
|||
/* Added by Peixuan Shu to handle bing map */ | |||
boost::replace_all(url, "{q}", TilesToQuadkey(tile_id.coord.x, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes {q}
from the url. Doesn't this break all other providers except bing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No influence on other map providers as there is no '{q}' in their urls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, good point.
Would you mind naming it {quadkey}
in the url? Because {q}
is often used for quaternion in the context of coordinate systems and ROS.
std::stringstream quadkey; | ||
for (int i = z; i > 0; i--) { | ||
char b = '0'; | ||
int mask = 1 << (i - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very magical function. Do you have a source for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how quadkey converted to tile xyz defined by Microsoft bing map team. Please refer to https://learn.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, would you mind adding that link in the function description for future reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'm good!
Two minor things left. Thanks for you patience and cooperation!
@@ -45,6 +45,11 @@ std::string tileURL(TileId const& tile_id) | |||
boost::replace_all(url, "{x}", std::to_string(tile_id.coord.x)); | |||
boost::replace_all(url, "{y}", std::to_string(tile_id.coord.y)); | |||
boost::replace_all(url, "{z}", std::to_string(tile_id.zoom)); | |||
|
|||
/* Added by Peixuan Shu to handle bing map */ | |||
boost::replace_all(url, "{q}", TilesToQuadkey(tile_id.coord.x, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, good point.
Would you mind naming it {quadkey}
in the url? Because {q}
is often used for quaternion in the context of coordinate systems and ROS.
std::stringstream quadkey; | ||
for (int i = z; i > 0; i--) { | ||
char b = '0'; | ||
int mask = 1 << (i - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, would you mind adding that link in the function description for future reference?
The bing map uses quadkey rather than tile xyz. The new commit adds support for the bing map quadkey in ros1 branch. For example, you can use the following bing satellite map url now:
http://ecn.t3.tiles.virtualearth.net/tiles/a{q}.jpeg?g=1
, where
{q}
is the quadkey.