none
static map: bounding box discrepancies RRS feed

  • Question

  • Bing static maps created using a bounding box (mapArea=) are noticebly different from maps supplied by other map providers based on the same coordinates.  The Bing map is tighter.  Is there a reason for this? 

    I've tried with the size map I am interested in (360x360, as well as a few others).  Then I thought perhaps Bing simply wanted to do bounding boxes with its default size (350x350), so I redid them all.  The maps from other providers are all very, very close to one another.  The Bing map is different on all sides around, and, as I say, much tighter.  This poses a problem when overlaying, eg, text on the screen based on computed x,y positions, which are derived from the assumed bounding box coordinates and the map size.  I'm calculating x and y positions from bounding coordinates which are not actually represented by the map.

    Does anyone know if there is, perhaps, a constant factor being used for bounding box maps?  Eg, whatever the "mapArea=" coordinates requested, the returned map will be 5% less all around, or whatever the factoring might be.  Has anyone else noticed?    

    -go

    Saturday, June 23, 2012 1:56 AM

Answers

  • Your first post gives no examples of the "other map providers" to which you were comparing - I was assuming that you might be looking at Bing Maps compared to a map image from a WMS server based on a different projection, which might have confused you; now that we know you're only comparing to other providers that use the Web Mercator projection (such as Google) then we don't need to worry about projection differences as a possible explanation.

    The second confusion arises from your use of words such as "padding" and "truncation", which suggest discrepancies in the x/y dimensions. However, having seen the images it's very clear what the difference is, and that is that the Bing Maps image is shown at a higher level of magnification (z15) than the corresponding Google Maps image (z14).

    If you request a Bing Maps image at zoom level 14 of the same area, you'll see that it corresponds to the Google Maps image:


    twitter: @alastaira blog: http://alastaira.wordpress.com/

    • Marked as answer by Ricky_Brundritt Monday, June 25, 2012 12:36 PM
    • Unmarked as answer by drgottjr Monday, June 25, 2012 5:29 PM
    • Marked as answer by drgottjr Monday, June 25, 2012 5:31 PM
    Sunday, June 24, 2012 7:47 AM
    Moderator

All replies

  • Hi,

    There are several factors I can think of that could explain why different map providers display apparently different maps of the same area. Remember that what you're asking for is a "square" image of an area of the earth's surface that is fundamentally not square.... and there are many valid approaches for "warping" the source data to create that image. If you could give some examples of the other map providers you're comparing to then perhaps it would be easier to compare any differences.

    Assuming that the projection parameters used are the same etc., then the inclusion of deliberate padding around the outside of the map is also certainly possible (like "bleed zones" used in printing). However, it sounds like your problem is that you've calculated a text placement algorithm based on a provider that does provide padding, and now you're trying to use that same algorithm on Bing Maps which doesn't use padding (hence why you describe it as "tighter"). In which case, don't you need to find out what the factor used by the other map providers is?


    twitter: @alastaira blog: http://alastaira.wordpress.com/

    Saturday, June 23, 2012 5:56 AM
    Moderator
  • Thanks for a quick response.  Your answer kind of threw me, so let me back up and restate the problem.  I may not have been clear enough in explaining the situation.

    Finding x,y points on a screen with a static map sitting there is, indeed, a problem.  Success in that exercise is based on many factors, some of which were mentioned by you.  Solving it requires having a frame of reference, ie the bounding box, plus knowledge of other factors, eg, padding. 

    The real problem is: If I feed the same bounding box coordinates to the 6 major map providers with a static maps API, 5 of them return what is essentially the same map.  The 6th - Bing - does not.  In addition, the map returned by the 5 others will include the 4 points which make up the bounding box.  Bing's map does not.

    In other words, 5 of the 6 return the map I am expecting: a map including the points which I specified as the bounding box.  For reasons which you allude to, padding in such circumstances is necessary.  But because the points are there, it is possible to deal with the padding to a certain degree.  In the case of Bing, the bounding
    coordinates are not on the map.  I tested this (See below.)  Without the bounding coordinates, there is no frame of reference.

    Since the other 5 are doing what I expect them to do, I thought I was right to post in this forum and to ask what Bing was doing and why.  Your suggestion that I go to the other 5 and ask them why they return maps that I am expecting from them is what threw me.

    If you do not use a static maps API, or if others reading this forum do not, then that pretty much concludes the matter.  I may well be the only person left who uses static maps.  For those who do use the static maps API, they
    should easily be able to see what I'm referring to.  Am I the only one looking into bounding boxes?

    I'm not saying the other providers are doing it correctly -  well, I am sort of saying that (they are, after all, returning what I'm expecting them to return) - but I am saying the difference is not trivial, and, more importantly, in the case of the Bing map, I don't know what I'm looking at because there are no points of reference anymore.

    Bing may not use "padding", as you say, but it's using something.  If it shows less than the requested bounded area, it's doing something.  Does anyone know how Bing decides to draw the box?  Using a square map (eg 350x350) was not my idea; it's Bing's default.  I think I'm right in suggesting that it should be able to return a map which includes the bounding coordinates and with the necessary padding to maintain the requested dimensions.  If not, why not?  The others do.  How can the Bing map be so different?

    I'm only permitted to upload 2 images, so I'll use bounding boxes from Google and Bing.  You'll have to take my word for it that the maps from Mapquest, etc all looked like the Google map.  As you can see, they are quite different, that is, the Bing map shows much less than the Google version.  The coordinates of the bounding box are nw 41.490154, -71.322548  se 41.475697,-71.303246.  If you go to Google or Bing and ask for a map (static or otherwise) showing the location at lat/lng 41.490154, -71.322548, you'll get one.  You'll see it's located on a dock in Newport harbor, just south of a "causeway".  If you refer to the Google bounding box map, you can spot that location up towards the upper left corner (on it and on all the others, except for Bing).  If you try it with the SE corner, you'll get the same results.  I happen to know the area in question; the Bing map truncates a lot.  Does any know: is there, perhaps, a constant?

    I chose the bounding box approach for a reason.  It might simply be unusable for my purposes, but let me see what others may have discovered.  I enjoy the Bing API, I believe I follow the rules, and I expect the expected.  That's not happening, and I'm wondering if anyone knows why.  Thanks.     

    Google BBBing BB

     

     

    Saturday, June 23, 2012 10:49 PM
  • Your first post gives no examples of the "other map providers" to which you were comparing - I was assuming that you might be looking at Bing Maps compared to a map image from a WMS server based on a different projection, which might have confused you; now that we know you're only comparing to other providers that use the Web Mercator projection (such as Google) then we don't need to worry about projection differences as a possible explanation.

    The second confusion arises from your use of words such as "padding" and "truncation", which suggest discrepancies in the x/y dimensions. However, having seen the images it's very clear what the difference is, and that is that the Bing Maps image is shown at a higher level of magnification (z15) than the corresponding Google Maps image (z14).

    If you request a Bing Maps image at zoom level 14 of the same area, you'll see that it corresponds to the Google Maps image:


    twitter: @alastaira blog: http://alastaira.wordpress.com/

    • Marked as answer by Ricky_Brundritt Monday, June 25, 2012 12:36 PM
    • Unmarked as answer by drgottjr Monday, June 25, 2012 5:29 PM
    • Marked as answer by drgottjr Monday, June 25, 2012 5:31 PM
    Sunday, June 24, 2012 7:47 AM
    Moderator
  • Thanks again.  Unfortunately, zoom levels are ignored when bounding boxes are involved.  If you were able to generate a bounding box map and specify a zoom level, I would be grateful if you said how you did it.  The API documentation indicates otherwise.

    If you send a bounding box request to Bing, Google, Mapquest, Mapquest/OSM, OSM, Nokia and Cloudmade - using their respective static map API's and giving them all the same coordinates for the bounding box - all but Bing will give you the same map, which map will include the 4 bounding coordinates.  Bing returns a map which covers noticeably less area and does not include the 4 bounding coordinates.  I simply wanted to know if anyone knew why.

     

    Monday, June 25, 2012 6:13 PM
  • The difference is that Bing Maps returns a map which matches your width and height dimensions that also fits your bounding box into view. The Google Maps example you gave above has smaller dimensions and as such needs to zoom out more to fit the bounding box into view.


    http://rbrundritt.wordpress.com

    Tuesday, June 26, 2012 10:42 AM
  • Thanks for the input.  I apologize; I originally posted an incorrect map.  I have been testing this for quite a while at a number of different sizes, and I mistakenly uploaded 2 images of different sizes. 
    So, to be clear, let me post 2 360x360 maps representing the same bounding box coordinates nw 41.490154, -71.322548  se 41.475697,-71.303246.

    In spite of what you say, the Bing map does not return a map which fits the bounding box into view.  It fits none of the bounding box into view.  Not one of the corners is kept.

    Forget, for the moment, what the other providers do.  That is, forget that all the others are able to return a map which fits the bounding box into view.  Just consider Bing's documentation.  It says:
    in order to do this: "Get a map that shows a specified map area.",
    do this: "http://dev.virtualearth.net/REST/v1/Imagery/Map/imagerySet?mapArea=mapArea&mapSize=mapSize&pushpin=pushpin&mapLayer=mapLayer&format=format&mapMetadata=mapMetadata&key=BingMapsKey"

    If you do what it says to do, you will not get a map that shows the specified map area.  You do not get what the documentation says you will get.  That is, the specified map area is not shown.  You get less than the specified area.

    If you were to look for a known, given location that fell within the bounding coordinates above and you used the Bing map to look for that position, your search could easily fail because the Bing map includes far less that the bounding coordinates.  This cannot happen with a map that includes the bounding coordinates.

    It should be clear that I want to use Bing, otherwise why would I bother to find out what I need to do to get the specified map area, as outlined in the documentation?

     

     

    Tuesday, June 26, 2012 8:56 PM
  • Did you ever figure this out?  I am running into the exact same problem.  I am using 4 lat/long coordinates as my "bounding box," and then querying several static map providers, with the intention to overlay the images.  Bing, as you point out quite clearly, returns an image that does not include the bounding coordinates, but rather an interior subset, making the image appear more "zoomed in."

    I would greatly appreciate any insight you were able to gather!  I'd prefer to continue using Bing.

    Tuesday, August 19, 2014 5:15 PM