Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

what are the coordinates of a generated .PNG map #5018

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 10 comments
Closed

what are the coordinates of a generated .PNG map #5018

openstreetmap-trac opened this issue Jul 23, 2021 · 10 comments

Comments

@openstreetmap-trac
Copy link

Reporter: james_7114737
[Submitted to the original trac issue database at 12.33am, Tuesday, 22nd October 2013]

Greetings, [[BR]]

I am writing a Android app which will use static map images, and was hoping to refer to http://OpenStreetMap.org as a source of maps. However for the maps to be of use in my app the map corner coordinates need to be known. [[BR]] [[BR]]
Issue: [[BR]]
The old openstreetmap.org website allowed for the generated of static map images (e.g. .png). The coordinates of the map image generated were obviously displayed on the website.[[BR]]
[[BR]]
The new openstreetmap.org website still allows for generation of static map images, but the coordinates of the map image are unknown.

Steps:
[[BR]]
Go to: http://www.openstreetmap.org/ [[BR]]
Zoom in on the map [[BR]]
Click the Share button on the right. [[BR]]
Check Set Custom Dimentions [[BR]]
Drag box edges as desired. [[BR]]
Adjust the scale as is desired. [[BR]]
Click Download. [[BR]]
A wonderful map has been generated, but I do not know what the coordinates are. Are they elsewhere on the web page and I am not seeing it, or embedded in the image or anything? [[BR]] [[BR]]

CU, [[BR]]
james

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 7.15pm, Tuesday, 22nd October 2013]

Well you shouldn't be hooking up an app to that interface anyway - that is for one time exports by users interacting directly with our web site and not for any sort of programmatic use.

@openstreetmap-trac
Copy link
Author

Author: RobJN
[Added to the original trac issue at 9.17pm, Tuesday, 22nd October 2013]

@TomH : I don't mean to be negative as you all do great work on OSM, but I would be interested in the reason why?. If we are allowing people to get tiles, then what is so different about the png export feature as long as it's for "fair use" only?

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 9.21pm, Tuesday, 22nd October 2013]

Because it's a very expensive call for us - every call to that script is a custom render from the database.

@openstreetmap-trac
Copy link
Author

Author: pnorman
[Added to the original trac issue at 10.33pm, Tuesday, 22nd October 2013]

The export call can't take advantage of any tile caching, either on the edge cache servers or the render servers. Some back of the napkin calculations put it as about as expensive as 5000 tiles in terms of server resources.

The [http://wiki.openstreetmap.org/wiki/Tile_usage_policy tile usage policy] covers the export call.

Aside from all of this if the server load is above a certain point the export call shuts down to prioritize tile rendering.

That being said, there probably is room for UI enhancements so that you know where you're rendering.

@openstreetmap-trac
Copy link
Author

Author: james_7114737
[Added to the original trac issue at 4.13am, Wednesday, 23rd October 2013]

Greetings,

The users of my app would be using the OpenStreetMap web interface above on their computer and then copying any generated static map image data to their mobile devices manually. The reason that my app is using static maps is for use in regions that do not have access to mobile data - i.e. no cell phone service...

Presuming the underlying tile data is conveniently gridded: to ease computing resources, would an option would be to grow the requested map a bit to exactly match the underlying tile edges so that the coordinates are a more straightforward lookup? i.e. use 100% of all required tiles for the smaller requested area? I am typing in ignorance on this suggestion, but it is something I would check for if I was coding this as a quick and easy solution...

CU,[[BR]]
james

@openstreetmap-trac
Copy link
Author

Author: woodpeck
[Added to the original trac issue at 5.44am, Wednesday, 23rd October 2013]

If your application would do the calculations (which tiles required for the static map in question) and then download these tiles and combine them into an image itself, then you wouldn't need the custom rendering capabilities of the web site and your application would be more resource friendly. Your application would still have to abide by the aforementioned tile usage policy, and take care not to run afoul of bulk downloading rules. There are some "static map" scripts out there that already do the maths, or you could check out http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames for code about how to get from coordinates to tile numbers.

@openstreetmap-trac
Copy link
Author

Author: RobJN
[Added to the original trac issue at 5.38pm, Wednesday, 23rd October 2013]

In regards to the bug request, then I agree with pnorman that UI improvements would be nice (but probably low priority for most people). You could even have the PNG files georeferenced by including a .wld "World File" with the download.

@TomH : Thanks.

@james_7114737 : It seems to me that your best option is to use the tile servers to get tiled map images. This way your users won't have to do a manual load into the app. All they will have to do is have the app cache a small number of tiles for offline use whilst on a wifi network. Tiles are served up using the TMS standard/service.

@openstreetmap-trac
Copy link
Author

Author: james_7114737
[Added to the original trac issue at 9.52pm, Wednesday, 23rd October 2013]

Greetings,

My app does not even support Internet communication (no sockets), so unfortunately SW changes in my app are not a solution: it is not the point of communication with openstreetmap, or any other mapping resource. People would use static internet access and web browser of choice to download whatever static map imagery is of interest to the user (street map data from openstreetmap, bathymetry and satellite imagery from other websites, etc.).

People in cities already have access to multiple GEO solutions through their data plans; my app doesn't fit into that category. Agreed that this request is not the largest user base.

One point I am confused about: the user is actively selecting an area of interest in the website when exporting'' or when ''sharing. The coordinates are displayed/enterable when exporting, and are not displayed when sharing. I even tried without success to draw the same selection areas simultaneously to determine the coordinates of the shared area...

The other point to make: it was there before in the previous website... 8-).

CU,[[BR]]
james

@openstreetmap-trac
Copy link
Author

Author: woodpeck
[Added to the original trac issue at 9.59pm, Wednesday, 23rd October 2013]

True it was there before, and I for one do miss the coordinate display on image export selection, but I guess we're the minority here. I could think of a number of ways in which you could probably solve the issue but discussing this in a trac bug report becomes awkward. Would you mind switching to the dev[at]openstreetmap.org list and simply ask your question there in short form? That would also increase the chance of others chiming in with a good idea or two.

@openstreetmap-trac
Copy link
Author

Author: Andy Allan
[Added to the original trac issue at 12.19pm, Wednesday, 16th October 2019]

Thanks for the original discussion, but we don't intend to implement any display of the coordinates of the corners of exported images at this time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant