Obtain geolocation data from Image (1 Viewer)

MickJav

It wasn't me
Local time
Today, 14:14
Joined
Nov 28, 2005
Messages
2,237
I've spent the last few days working on my picture library and after a lot of help from isladogs Have a working system but being one of those who like to push the limits I have been looking into Obtaining geolocation data from Image and then viewing it on maps or other programs already built by isladogs.


I have had good look at the available properties and also

https://docs.microsoft.com/en-us/previous-versions/windows/desktop/wiaaut/-wiaaut-imagefile
But haven't had any luck finding the latitude and longitude.


I can get the info by referencing a 3rd party program here:
https://stackoverflow.com/questions...der-and-get-gps-info-exif-of-each-files-in-it


I don't really want to use a 3rd party program as It means I'll have to install it when the installer downloads which I'm a total virgin at lol
so Is there a way of getting at the required info??


thanks mick


Other topic of interest
https://www.access-programmers.co.uk/forums/showthread.php?t=299932&highlight=geolocation
 

isladogs

CID VIP
Local time
Today, 14:14
Joined
Jan 14, 2017
Messages
14,015
Now that's clever!
I tried to to do this a couple of years ago using the extended property 'Location' but it never seemed to be populated so I gave up.

Wayne Phillips' code gets the latitude & longitude from the EXIF properties of JPEG files. I just tested on a few files then plugged in the values to my GetCurrentGeolocation app and it worked perfectly. Having said that many of my older JPG files don't have that information

I'm interested enough to merge the two set of code together & hopefully will have a working version in the next couple of days.

However, as is the case for my existing app, it will require the use of a Google API key to get the map from the co-ordinates using VBA

Thanks Mick for suggesting the idea - will get back to you on this
 
Last edited:

MickJav

It wasn't me
Local time
Today, 14:14
Joined
Nov 28, 2005
Messages
2,237
Now that's clever!
I tried to to do this a couple of years ago using the extended property 'Location' but it never seemed to be populated so I gave up.

Wayne Phillips' code gets the latitude & longitude from the EXIF properties of JPEG files. I just tested on a few files then plugged in the values to my GetCurrentGeolocation app and it worked perfectly. Having said that many of my older JPG files don't have that information

I'm interested enough to merge the two set of code together & hopefully will have a working version in the next couple of days.

However, as is the case for my existing app, it will require the use of a Google API key to get the map from the co-ordinates using VBA

Thanks Mick for suggesting the idea - will get back to you on this


It's one of my missions as I have loads of pictures Taken on long distance rides and would love to find out where they we're taken.
looking forward to it.


mick


P.S.I can send you some images as have loads of landscapes around kent
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 14:14
Joined
Sep 21, 2011
Messages
7,112
Hell, I can send you some images from Cozumel in Mexico and see what they produce.? :D
 

isladogs

CID VIP
Local time
Today, 14:14
Joined
Jan 14, 2017
Messages
14,015
Hell, I can send you some images from Cozumel in Mexico and see what they produce.? :D

Now you're just showing off :rolleyes:
If you know the files will have geolocation data attached, do upload an example file for use in testing.
Similarly other photos from around the world could be helpful.
I reserve the right to include any uploaded images with the app...

A reminder that this only works for some JPG files. My Olympus digicam is about 6 years old and doesn't include this in the EXIF data.
However recent mobile phone images do seem to include geolocation data
 

Gasman

Enthusiastic Amateur
Local time
Today, 14:14
Joined
Sep 21, 2011
Messages
7,112
No not really. :eek:

If you can tell me where this data is located, I'll inspect some files and see if it does show correctly using your geolocation app.
If so, then I'll send a few for you to test.

FWIW I use a Canon Powershot A470IS camera, so not sure what that provides, as it is quite old, as is most of my gear. :)

A lot of the pictures will be underwater, so not sure how that all works?
 

MickJav

It wasn't me
Local time
Today, 14:14
Joined
Nov 28, 2005
Messages
2,237
I'll upload 5 they should all have the location data as they come of one of my phones.


If you need them in a zip file let me know.


mick
 

Attachments

  • IMAG0144.jpg
    IMAG0144.jpg
    87.5 KB · Views: 21
  • 20180827_133907.jpg
    20180827_133907.jpg
    97.9 KB · Views: 22
  • IMAG0138.jpg
    IMAG0138.jpg
    102.5 KB · Views: 27
  • IMAG0068 1.jpg
    IMAG0068 1.jpg
    99.1 KB · Views: 29
  • IMAG0069.jpg
    IMAG0069.jpg
    100.4 KB · Views: 25

MickJav

It wasn't me
Local time
Today, 14:14
Joined
Nov 28, 2005
Messages
2,237
I have it just not had time to get it working I was thinking of using a link to google maps on web I'll try and sort in on my program tomorrow
 

isladogs

CID VIP
Local time
Today, 14:14
Joined
Jan 14, 2017
Messages
14,015
I'll upload 5 they should all have the location data as they come of one of my phones.

Just tried all 5 files. Unfortunately, none contain EXIF data

Below is an example using a photo taken on my iPhone



On the left is Wayne's EXIF reader data. On the right is my Geolocation map app.
It should be easy enough for me to combine the two and include the image as well. Hopefully will start on it tomorrow.
 

Attachments

  • PhotoLocation.jpg
    PhotoLocation.jpg
    96.6 KB · Views: 157

Gasman

Enthusiastic Amateur
Local time
Today, 14:14
Joined
Sep 21, 2011
Messages
7,112
Thinking about it, there would be no reason for my camera to record that info.?
Modern cameras might do it now, but as I mentioned, mine is quite old, you cannot buy them anymore except second hand, so I have a few backups. :D

I did download that mdb just to check and sure enough, all those fields are empty.
 

isladogs

CID VIP
Local time
Today, 14:14
Joined
Jan 14, 2017
Messages
14,015
My digicam doesn't do so either but my mobile (iPhone5) does

The app is almost ready for release.
Here's an example using an image I took at Taunton Flower Show in August.



Just one problem to fix: all the images taken in portrait mode are being rotated by 90 degrees :banghead:
Hopefully I can fix that. Otherwise I have written code to rotate the displayed image in 90 degree intervals
 

Attachments

  • GetPhotoLocation.jpg
    GetPhotoLocation.jpg
    96.7 KB · Views: 141
Last edited:

MickJav

It wasn't me
Local time
Today, 14:14
Joined
Nov 28, 2005
Messages
2,237
I have the same problem with portrait images, thinking about the files I copied maybe the data is removed when copied ??
 

isladogs

CID VIP
Local time
Today, 14:14
Joined
Jan 14, 2017
Messages
14,015
I have the same problem with portrait images, thinking about the files I copied maybe the data is removed when copied ??

The image rotation issue is a common problem.
I've done a work round to manage this.

I've emailed lots of photos from my phone as a test.
The image EXIF data was retained
 

MickJav

It wasn't me
Local time
Today, 14:14
Joined
Nov 28, 2005
Messages
2,237
The image rotation issue is a common problem.
I've done a work round to manage this.

I've emailed lots of photos from my phone as a test.
The image EXIF data was retained


Maybe the phone I used didn't recored the data maybe my samgung s9+ will I'll try a few when you have your program sorted I always turn on the location service so thought it would have stored the info.


Go back to the images rotation problem I did notice it showed up in the deimension code from my istime post.


I did see code for a 180degree rotation but was still hoping for another Salution I did notice a lot of my images have corrected after i used a program to make thumbnails but haven't been able to repeat it so still have 600 ish that are incorrect.
I have a program the can batch correct them but It loses some info I want to keep so am just doing them one at a time.
 

isladogs

CID VIP
Local time
Today, 14:14
Joined
Jan 14, 2017
Messages
14,015

MickJav

It wasn't me
Local time
Today, 14:14
Joined
Nov 28, 2005
Messages
2,237
Thanks Isladogs Added the geolocation And was as simple as you said, found out why my samsung s9+ wasn't recording the location info I had turned the service on but not updated the settings in the camara :confused: sorted now though.




I've only added it to the form just to play but will add it to the import engine and store the details


thanks


 

Attachments

  • 2019-10-21 (1).jpg
    2019-10-21 (1).jpg
    42.5 KB · Views: 132

Users who are viewing this thread

Top Bottom