I have a pair of coordinates (lat, long).
I need to generate an image of displaying these coordinates on the map.
And then generate such images with other coordinates in the future without the Internet.
Please tell me whether there are solutions that allow you to display coordinates offline?
Upd: is there any opportunity to download maps offline , eg: gps tracker maps or something like that?
thank you
This is not possible while offline. To generate an image of the coordinate location you would most likely be using
os.system("open \"\" https://www.google.nl/maps/place/" + location)
and then generating a image of the location that is popped up. This is impossible to do while offline, I am very sorry.
The question is too broad to give a good answer. However:
There are several companies, such as TeleAtlas and NavTeq, that sell map data. I have no idea what buying the world from them at 1:1M resolution would cost, but I'd guess several thousand USD.
You could download data, or pre-rendered rasters, from Natural Earth. However, they don't have quite the resolution required for good 1:1M maps.
You could download data from OpenStreetMap. The data is free (as in beer, and as in speech), but using it is a major undertaking.
There are companies that offer pre-rendered maps in various formats from OpenStreetMap data. OpenMapTiles is the one I happen to have at the top of my head, but here are others.
Related
My goal is to find a way to download (with Python) satellite images given coordinates describing a rectangle. I've never really found a precise and free solution (no business here, just school stuff).
At first I tried Google Maps' API, which worked perfectly but turned out to be paying after a certain time. I then considered using OpenStreetMap, but again I had a lot of trouble finding information on how to obtain those.
Can you please help me with a simple solution?
OpenStreetMap only provides map data. OpenStreetMap doesn't have aerial imagery and thus also no satellite imagery API.
If you are looking for free aerial imagery then take a look at OpenAerialMap.
I have recently been looking at using Bing Maps API to return images of properties and was very interested in the oblique imagery provided by Bing.
It seems that the API does offer this imagery and there are examples of this working. However, when I go to implement it myself, I find that the birdseye view does not return the building of interest. It returns a view off centre of the point put into the url.
An example of this is the place below, which shows the URL for looking at the Leadenhall building in City of London:
aerial_url = http://dev.virtualearth.net/REST/V1/Imagery/Map/Aerial/51.5138,-0.0821/18?&key={api_key}
birdseye_url = http://dev.virtualearth.net/REST/V1/Imagery/Map/BirdsEyeV2/51.5138,-0.0821/18?&key={api_key}
You will notice that the build is top right of the second image, rather than centre as in the first image.
Is anyone able to help me resolve this, as ideally I would want it to be centre of the image?
Thanks
I took a look at it, and it looks to be centered correctly. It's hard to tell comparing at the same zoom level. Setting the aerial image to zoom level 17 helps provide a better overview so you can better match the images. Note that the coordinates are based on the ground, not building heights. Aerial images are captured looking straight down while birdseye are captured at approximately 45 degree angle.
I'm looking for several days now how to solve my problem.
I want to calibrate my CCD pictures (FITS files) so that I can generate the FITS headertopics to di astrometry ib them.
I have a number of stars of which I know RA and DEC and I want to use this data to calculate the parameters to calibrate my photo. I found a web page that does excact what I need but the source code is not online:
http://www1.phys.vt.edu/~jhs/SIP/astrometrycalc.html
In AstroPy coordinate and WCS I find all the functions that I need to do my job but they all assume a fully completed FITS header and I do not have one. (the photos come from an SLR camera in RAW format)
My question is whether I overlook a function or someone who can put me on the road to calculate the header parameters so that I can complete it with the necessary data?
Who can deliver me from my suffering.
tnx
It sounds like you want to plate-solve your image and write the coordinate information and possibly other details into the FITS header.
Have you considered using Astrometry.net? There is a python client here.
You will need to convert your image from raw. Astrometry can handle fits, jpg, gif, and png formats. You can then use Astropy to update the fits header with the results from the Astrometry API. Details on how to work with FITS headers can be found here.
I want to extract the geopgraphic coordinates from a smartphone picture. All our photos are georeferenced and that info is embedded in headers somewhere. Is there a matlab or python function that can tell me a pictures geographic coordinates?
I want to write a script which can calculate the distance between the two images, so if I can extract geographic coordinates of the two photos then I will be able to calculate the distance.
thanks
If you want to use MATLAB, there is a function called imfinfo that extracts the exif data from an image file and saves it in a struct. You can find the GPS information in the GPSInfo field. Example:
info = imfinfo('filename.png');
info.GPSInfo
Then, to access the individual Latitude and Longitude values (expressed in degrees, minutes, seconds) you can check the fields GPSLatitude and GPSLongitude:
info.GPSInfo.GPSLatitude
info.GPSInfo.GPSLongitude
I would suggest looking into http://python-pillow.org
The following pillow documentation gives you are starting point to get what you are looking for.
https://pillow.readthedocs.io/en/latest/reference/ExifTags.html#exiftags-module
Are you allowed to use external tool?
Use jpegsnoop or exiftools to extract a txt file. I can't remember the exact commands but you can find it easily. Both tools have executables and code available. Personally, I like jpegsnoop better.
system('jpegsnoop.exe image/path ... output_image.txt);
Read the txt file which contains geo-tags. There might be up to 7 tags, different camera brands use different tags. Among those, will choose geolocation (I cant recall the exact name but it contains longitute and lattitude in the name).
You can do this by a simple while loop:
while (line = readline) ~= EOF
if line.startsWith (geo-tags)
print line %or add to cell array etc.
To my experience, python is not as good as jpegsnoop.
As NaN mentioned, make sure the gps is on when you take the picture from the smart phone.
What I want to do is to generate a static image (e.g. a png) using python and using openstreetmap tiles as a background.
Mathplotlib and Basemap is almost what I'm looking for. The problem is being able to use OSM tiles as background. I'm not pleased by the approach suggested in http://stevendkay.wordpress.com/2010/02/24/plotting-points-on-an-openstreetmap-export/
The closest I found is in this answer but using R, and not python Plotting points from a data.frame using OpenStreetMap
Did I miss any obvious and easy solution?
Thanks for your help
EDITÂ : this questions suggests many tools, but none seems to match my needs How can I display OSM tiles using Python?
You overlooked the "Export" tab at the OSM website, which is capable of generating a static image with the dimensions and map extents you want. Have a look at http://wiki.openstreetmap.org/wiki/Export
Please be advised that generating static images is a resource-intensive process, and the OSM sysadmins will frown upon you if you do a large number of requests or abuse this feature. Unfortunately this means you'll have to find another solution if you're trying to do lots of images.
By the way, the data you're plotting on top is properly projected into EPSG:3857 and not just raw lat/lon coordinates, right? Raw lat/lon data will look distorted at large zoom levels.