![]() Latn, lonn = pixelstolatlon(ulx + dxn, uly - dyn - bottom/2, zoom) # calculate pixel dimensions of each small imageįinal = Image.new("RGB", (int(dx), int(dy))) # calculate total pixel dimensions of final imageĬols, rows = int(ceil(dx/maxsize)), int(ceil(dy/maxsize)) Lrx, lry = latlontopixels(lrlat, lrlon, zoom) ![]() There's no way to import a bunch of TomTom coordinates to create a map w/ pins. Ulx, uly = latlontopixels(ullat, ullon, zoom) After you've made all your pins you can click 'Link to this Map' to share the link, with pins, with whomever. # convert all these coordinates to pixels Lrlat, lrlon = map(float, lowerright.split(',')) Ullat, ullon = map(float, upperleft.split(',')) Zoom = 18 # be careful not to get too many images! ORIGIN_SHIFT = EQUATOR_CIRCUMFERENCE / 2.0 Prints the current map coords for the player. position CMap.GetPlayerMapPosition(uiMapID, unitToken) Arguments uiMapID number : UiMapID unitToken string : UnitId Returns position Vector2DMixin Example. INITIAL_RESOLUTION = EQUATOR_CIRCUMFERENCE / 256.0 Returns the location of the unit on a map. = import Image, urllib, StringIOįrom math import log, exp, tan, atan, pi, ceilĮQUATOR_CIRCUMFERENCE = 2 * pi * EARTH_RADIUS I ended up solving the problem another way, using Google Maps Static API and some formulas to convert from Coordinate space to Pixel space, so that I can get precise images that "stitch" nicely together.įor anyone interested, here is the code. So, the question lingers: how could I do some useful stuff from all this stuff in Python in order to get the map image?ĮDIT: this link appears to contain some pretty relevant info on how Google Maps tiles their maps: For the people (like me) wondering how to get to the bottom part of the map, theres a flight route via a Flayedwing Transporter next to Alexandros in Keepers Respite. The result was a lot of javascript code, which I think has to do with the Google Maps JavaScript API. (My rationale is: if the browser can get and render such image content, then Python should be capable of doing it, too).ĮDIT: this is the content of the HTML file that shows my sample map: ĮDIT: I did as suggested by Ned Batchelder, and read the content of an urllib.urlopen() call using the src address taken from the iframe above. More specifically, I would like to define a rectangular area from a bounding box (upper-right and lower-left coordinates), and get the corresponding image, with an appropriate zoom factor.īut my question is: How can I use Python to get the "pixel content" of this map as an image object? The image size can be adjusted to be very large, so I am interested in getting som big images as single. I have noticed that, from Google Maps page, you can get an "embed" link to put inside an iframe and load the map in a browser.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |