MapView - Layer with street and town names

Ask about the individual Gambas components here.
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: MapView - Layer with street and town names

Post by stevedee »

01McAc wrote: Monday 15th March 2021 1:16pm ...How do you know the URLs? I haven't found any documention re Google Maps. Common knowlege?
I did a lot of searching. Seem to get lucky on sites where users are quoting this stuff for other programming languages.
01McAc
Posts: 75
Joined: Sunday 24th January 2021 8:25pm

Re: MapView - Layer with street and town names

Post by 01McAc »

I would be interested in finding the error and sorting it. Can you let me know what Distro you are running, what you did to create the error, what and where it is.
Here it is.
Screenshot_20210315_192926.jpg
Screenshot_20210315_192926.jpg (213.67 KiB) Viewed 6458 times
I attached the jpg image which caused the errror. I suppose someone has lost his armchair.
Attachments
L1008442-1.jpg
L1008442-1.jpg (1.57 MiB) Viewed 6458 times
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: MapView - Layer with street and town names

Post by cogier »

Thanks for the reply and the picture, but I could not recreate the error. Expensive camera!!

Image
01McAc
Posts: 75
Joined: Sunday 24th January 2021 8:25pm

Re: MapView - Layer with street and town names

Post by 01McAc »

cogier wrote: Tuesday 16th March 2021 2:35pm Thanks for the reply and the picture, but I could not recreate the error.
I think it's not actually a bug rather than a national interpretation of numbers. When the 'error' occurs I've got the following numbers
fLat = Val(sLatArray[0]) + (Val(sLatArray[1]) / 60) + (Val(sLatArray[2]) / 3600)
sLatArray[2] = 37.58
Val(sLatArray[2]) = NULL

So why NULL? In Germany Val("37,58") is equal to 37,58 (which is correct)
I might switch to English but I don't find the settings in the IDE.
cogier wrote: Tuesday 16th March 2021 2:35pmExpensive camera
Once in a lifetime. I presume I am the one of five people in the world using this camera, post process with open source with Linux ;)
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: MapView - Layer with street and town names

Post by cogier »

So why NULL? In Germany Val("37,58") is equal to 37,58 (which is correct)
I didn't think of that. Can you try adding the 'New' code below, and let me know if that works for you in your German setup. If it does it should work for other languages as well.
  sLatArray = Split(sLat, " ")
  sLongArray = Split(sLong, " ")

  If IsNull(Val("2.2")) Then                        ''New
    sLatArray = Replace(sLatArray, ".", ",")        ''New
    sLongArray = Replace(sLongArray, ".", ",")      ''New
  Endif

  fLat = Val(sLatArray[0]) + (Val(sLatArray[1]) / 60) + (Val(sLatArray[2]) / 3600)
  fLong = Val(sLongArray[0]) + (Val(sLongArray[1]) / 60) + (Val(sLongArray[2]) / 3600)
Once in a lifetime. I presume I am the one of five people in the world using this camera, post process with open source with Linux ;)
Good for you. Puts my Canon 6D MkII in its place! I also use Linux for all my photography.
01McAc
Posts: 75
Joined: Sunday 24th January 2021 8:25pm

Re: MapView - Layer with street and town names

Post by 01McAc »

Weird, the condition IsNull(Val("2.2")) is never true
When I type Val("2.2") into the console the result is "02.02.2021 00:00:00"

Then I replaced your condition with the code
InStr(sLatArray[2], ".") 
This condition becomes true but
sLatArray = Replace(sLatArray, ".", ",")
expects a string: an error occurs. I guess you need to go through the array in a loop and then replace the values one by one.


The following code works but I suppose it is not very elegant:
If InStr(sLatArray[2], ".") Then                        ''New
    sLatArray[0] = Replace(sLatArray[0], ".", ",")        ''New
    sLatArray[1] = Replace(sLatArray[1], ".", ",")        ''New
    sLatArray[2] = Replace(sLatArray[2], ".", ",")        ''New
    sLongArray[0] = Replace(sLongArray[0], ".", ",")      ''New
    sLongArray[1] = Replace(sLongArray[1], ".", ",")      ''New
    sLongArray[2] = Replace(sLongArray[2], ".", ",")      ''New
Endif
All in all this is actually the application I was looking for. I just need to enhance it to raw files.
01McAc
Posts: 75
Joined: Sunday 24th January 2021 8:25pm

Re: MapView - Layer with street and town names

Post by 01McAc »

01McAc wrote: Tuesday 16th March 2021 5:15pm The following code works
Continued some tests. My code is not reliable, sorry. It doesn't work for all jpg's. I don't know, why.

I did notice you are using exiftool to extract the exif tags. I use the following parameter to get the correct "GPS Position"-tag in degrees (e.g. 54.989667). No calculation is necessary:
aCommand = ["exiftool", "-c", "%+6f", "-x", "Arp", FileChooser1.SelectedPath, "|", "sort"]
Exec aCommand To myGPS
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: MapView - Layer with street and town names

Post by cogier »

I have set up my laptop with German as the main language and have tried various code changes to stop this problem, but there is always a knock on effect. I think I will leave it as it is for now.
01McAc
Posts: 75
Joined: Sunday 24th January 2021 8:25pm

Re: MapView - Layer with street and town names

Post by 01McAc »

No worries. Don't get lost in German language on your computer.
I am currently working on my own Exif2Map app;) Just for fun. Sure, eveybody needs his own app! In the meantime I figured out which long way round it needs to preview raw file in the imageview class (e.g. *DNG). But what I haven't manage so far is to preview raw files in FileView class although Nautilus and Dolphin are able to show the embedded jpg immediately.
I copied one or another idea from your project PhotoEXIF. In particular I embraced the AutoResize and Expand functionality which I was (and still am) not familiar with. I'll provide an early beta version in Project Showcase subforum in the next few days.
Post Reply