Using GPS info to find Location data

Started by BenAW, August 22, 2013, 03:23:02 PM

Previous topic - Next topic

BenAW

In several places you should be able to find Location info (eg. country code, country, city etc.)
using GPS data. Edit Location, Metadata templates and also the GeoNames App don't work for me.
I never see one of the mentioned fields filled with data, except in the Metadata panels, when data is already available in IPTC.

Has this to do with the Communication error reported for the Map Panel?

cytochrome

I am not sure I get it right: do you mean IMatch should access Geonames and retrieve the Location info and write it in the metadata?

Geosetter does it, but I saw no mention of of it in the Help (I still have a lot to read, though)

Francis

Mario

 Edit Location had a communication problem with Google, fixed for 108.
The GeoNames App worsk (I just used it). Do you have your own Geonames.org user name filled in? If you use the "demo" account, it will usually fail because the limit of the demo account is exceeded quickly.

Can you detail the Metadata Template problem?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

jch2103

The Geonames appp works (here, at least), if you have a Geonames user name. The issue for me is that the Geonames app is really a demo of how to write apps, and consequently only handles one image at a time. For multiple images, using Geosetter makes a more efficient workflow.
John

Mario

This App is indeed a demo to show how to use web services from an IMatch App.

Extending the sample to update multiple files is of course possible. The UI will be a bit more tricky, because it may need to offer alternatives, move forwards and backwards. Something somebody who has free time can do over a rainy Sunday afternoon... ;)

I would have added this functionality to the Map Panel, but Google's policy changes prevented me from doing that.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

BenAW

Quote from: cytochrome on August 22, 2013, 03:36:18 PM
I am not sure I get it right: do you mean IMatch should access Geonames and retrieve the Location info and write it in the metadata?

In at least the 3 places I mentioned some geonaming is possible, only not yet working for me.

BenAW

#6
Quote from: Mario on August 22, 2013, 06:04:32 PM
The GeoNames App worsk (I just used it). Do you have your own Geonames.org user name filled in? If you use the "demo" account, it will usually fail because the limit of the demo account is exceeded quickly.

Can you detail the Metadata Template problem?
I tried both the "demo" account and my own account which works to login the website.
I do need a password though. Could this be the problem?

In the Edit Metadata Templates you can select "Location". (see screenshot)

I assume that the "Assign Location....) template will try to fill all tags in the tags window.
I haven't been able to accomplish this yet.



[attachment deleted by admin]

BenAW

Quote from: BenAW on August 22, 2013, 08:38:55 PM
I tried both the "demo" account and my own account which works to login the website.
I do need a password though. Could this be the problem?
I revisited the GeoNames website and found I was still logged in, but probably more important:
the account wasn't enabled yet.
GeoNames App now works fine for me.

Mario

QuoteIn the Edit Metadata Templates you can select "Location". (see screenshot)
I assume that the "Assign Location....) template will try to fill all tags in the tags window.

I think this is a misunderstanding.  This feature uses the existing locations defined in your database (via the Map Panel). If a location matching the coordinates in the file is found, the location data is assigned to the file. Optionally, also the GPS coordinates in the location can be assigned to the file, to unify all coordinates.
This feature will not use a call out to a web service like Google (fee-based) or GeoNames to match the GPS coordinates to a location.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

cytochrome

#9
It is not a misunderstanding... it works. It just filled city, country etc.. not as I would have filled it, but it works exactly like in geosetter. Nice...

One has only  to prepare the template with the empty metadata fields  ({File.MD.Composite\City\City\0}, etc) and have an active geonames account.

Thanks to Benaw, without his question I would not have found this (is it in the documentation?)

Francis

PS Well, I have second thoughts!! it is possible that I had already entered this Location data with Geosetter, was "hiden" for some reason, cause now, with other images it no longer works... here at least. Lest hope Benaw has the good setting.

If I cut my connexion, there is no error message when I use this template, while there is one if I try to load the map by F9,P... so look not good :(

[attachment deleted by admin]

BenAW

Quote from: Mario on August 22, 2013, 06:39:38 PM
I would have added this functionality to the Map Panel, but Google's policy changes prevented me from doing that.
Did you see this post?
https://www.photools.com/community/index.php?topic=638.msg3628#msg3628

I think that keeping the Map panel, but then as a separate App,  should be OK, but only for those users willing to request a Google Maps Key and who enter that key in their "personal" Map App.

BenAW

Quote from: cytochrome on August 22, 2013, 10:54:58 PM
PS Well, I have second thoughts!! it is possible that I had already entered this Location data with Geosetter, was "hiden" for some reason, cause now, with other images it no longer works... here at least. Lest hope Benaw has the good setting.

If I cut my connexion, there is no error message when I use this template, while there is one if I try to load the map by F9,P... so look not good :(
I will try this later, but for the time I must assume Mario knows what he has written into IM5  ;)

Mario

I had to fix some issues in the Location area for the 108 but now it's working again as it should. You'll run into these issues if your user locale uses a numeric format with decimal comma instead of decimal point.

The Locations in IMatch are part of the transient Map panel and hence not documented.
The general idea behind a location is to combine a GPS coordinate, a radius and location data like Country, City, Street etc. By applying such a stored location to an image you can set the GPS coordinates and fill out the corresponding metadata tags at once.

Using the GPS coordinate as the center and the radius entered in the Location allows IMatch to find images within that radius and to automatically assign them (e.g. when you use the Metadata Template Assign Location based on GPS data in the file.). The GPS Filter also uses Locations.

Locations do not replace a functionality like reverse geo-mapping, where you send a GPS coordinate pair to Google, Bing or GeoNames and get back a set of one or more addresses, which then can be filled into the metadata of the selected image(s). Such a functionality is currently only available on a per-location basis, and in the GeoNames App.

All Geo services (Google Maps, Bing Maps) only allow to use their geo-coding service under very strict conditions, or require 'paid' accounts. This is not an issue for Multi-Billion dollar companies like Adobe, but it is for me. Since IMatch is considered a commercial application, I have to follow other rules as a free application like, for example, GeoSetter. GeoSetter can use Google Maps free of charge, I cannot. Unless I give away IMatch for free (nope!) or I or the user pays for the services rendered by Google Maps.

I'm still looking into possible ways to handle this in a legal way.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

BenAW

QuoteI'm still looking into possible ways to handle this in a legal way.
If users of the Map Panel have their Personal Google Maps Key when using the Map Panel, how would that be illegal?

Mario

I'm not sure if personal google map keys exist, and if these can be used in a commercial application like IMatch. This is all legal stuff and very complicated. Do you have a reference where Google comments on this?

I'm sure it's not in Google's interest to hand out thousands of API keys so that IMatch users can use them to access their Maps. The Google API not longer requires API keys (that's how I use it now). They handle it via the IP address I think.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

BenAW

#15
Quote from: Mario on August 23, 2013, 08:21:10 PMDo you have a reference where Google comments on this?
Have a look here

QuoteYour New Key

There are two significant changes to keys in the Google Maps JavaScript API v3 release. First, a key is no longer required during early development. Second, the API uses a new key system.
So INITIALLY a Key is no longer required. Which I read as: after a certain period a Key WILL be required.
But I have my own key, and I suppose I can use that legally to access the API from within the App panel.

pmbvw

#16
I have installed V5.0.108 and hoped I get results from GeoNames.
(Land, Ländercode Stadt usw.) The coordinates are ok, because Irfanview and the map panel are showing the correct position

But no chance with GeoNames App and my own account.
and I believe that as example Mt. Rushmore is a known place.

Do I make something wrong or am I missing something?

ericmuzy

I did geotag one of my test pictures with approximately the same Lat/Long you had on your screenshot, and geonames does return the following information for me:
US/United States/South Dakota/Keystone/Keystone.
So the geoname reverse lookup does work, at least with my configuration.
Also, by experience, I found that geonames is OK for retrieving Country code, Country name, State and City, but is not always very precise when retrieving detailed location information. (That's the main reason why you get Keystone in the location tag, same as the City tag, and not "Mt Rushmore" as you could possibly expect.



[attachment deleted by admin]

cytochrome

This is the problem with Geonames, in most cases Location is duplicated from City, the database lacks the finer details. When i use geonames and I don't remember the exact Location I export the data on a topo map in a Garmin Bqecamp or Mapsource.

Takes a lot of time, not even sure my kids, friends etc will ever look at it...

Francis

Mario

#19
Quote from: pmbvw on August 26, 2013, 10:50:30 PM
But no chance with GeoNames App and my own account xxxxx


You should never publish your user name in a public forum. Spammers can use it to break GeoNames, or at least get your account closed very quickly. I suggest you edit your post and also your screen shot.

Do you get results from GenNames for other files or does it fail on your machine for all files?

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

pmbvw

Quote from: Mario on August 27, 2013, 08:06:25 AM
Quote from: pmbvw on August 26, 2013, 10:50:30 PM
But no chance with GeoNames App and my own account XXXXXX


You should never publish your user name in a public forum. Spammers can use it to break GeoNames, or at least get your account closed very quickly. I suggest you edit your post and also your screen shot.

Do you get results from GenNames for other files or does it fail on your machine for all files?

Hi Mario, please remove my account name from your Quote  ;),
I have removed it from my original  post.

I have never got a result from GeoNames, not with older versions and not with V5.0.108.
I have tested it with more photos taken from my CANON 40D or 5DMK3 with the GP-E2.

BenAW

QuoteI have never got a result from GeoNames, not with older versions and not with V5.0.108.
I had the same problem, until I went back to the GeoNames website and found my account wasn't "enabled" yet.
You may have the same problem.

pmbvw

Quote from: ericmuzy on August 26, 2013, 11:31:17 PM
I did geotag one of my test pictures with approximately the same Lat/Long you had on your screenshot, and geonames does return the following information for me:
US/United States/South Dakota/Keystone/Keystone.
So the geoname reverse lookup does work, at least with my configuration.
Also, by experience, I found that geonames is OK for retrieving Country code, Country name, State and City, but is not always very precise when retrieving detailed location information. (That's the main reason why you get Keystone in the location tag, same as the City tag, and not "Mt Rushmore" as you could possibly expect.

Thx for your answer,
so I know it must function.
I Know also from GeoSetter that the names are often like the example and Keystone, but the most time it ist more precise like directly in cities.
So I will test further or waiting on tips what can be the reason for my problem.

pmbvw

Quote from: BenAW on August 27, 2013, 08:46:02 AM
QuoteI have never got a result from GeoNames, not with older versions and not with V5.0.108.
I had the same problem, until I went back to the GeoNames website and found my account wasn't "enabled" yet.
You may have the same problem.

Thanks BenAW,
I have read your post from August 22, 2013 before posting ,
and had tested direct inside GeoNames with my account, so my account is enabled and functioning.

cytochrome

#24
Must be something in your setup. Here it functions without reactivating my geonames account since over a week. For the geonames username I use the email address I used to open the account.

This said, at least in France where the user base is maybe smaller the  results are often bizarre. I tested it just now and I got:

- Country: France  ==>  OK
- Code: FR   (I use FRA)
- Province/State: Franche-ComtĂ©  ==> OK
- City: Bureau de Poste de Arc Et Senans  ==> bad
- Location: Champagne-sur-Loue  ==> bad

City and Location are mixed up and false: the city is Arc & Senans and the location is well away from the post office (which is close to the town hall which may explain the curious tag). And Champagne is an other village some km away...

Francis

Mario

#25
Quote from: cytochrome on August 27, 2013, 11:23:19 AM
This said, at least in France where the user base is maybe smaller the  results are often bizarre. I tested it just now and I got:

The GeoSetter organization is run by volunteers. They gather their databases from public and official sources and cannot afford to spend dozens of millions of dollars to cleanup their data manually like Google or Microsoft do. GeoNames.org has a feature which allows you to correct bad data. If ever GeoNames user does this, their database will get better every day...

www.geonames.org/manual.html
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

BenAW

Quote from: cytochrome on August 27, 2013, 11:23:19 AM
- Country: France  ==>  OK
- Code: FR   (I use FRA)
- Province/State: Franche-ComtĂ©  ==> OK
- City: Bureau de Poste de Arc Et Senans  ==> bad
- Location: Champagne-sur-Loue  ==> bad
I had a look at the GeoNames website, and they have two lists with country codes, alpha2 and alpha3.
Haven't figured out if at all possible and how to get the alpha3 codes iso alpha2.

For the location you can specify a range that Geonames uses to find a location around your gps position.
Reducing this range could result in better matches, or no matches when no data is available.

Mario

You can control the radius directly in the GeoNames App. The default is 5 KM.

In the HTML file of the app, the GeoNames queries start at line 180.
I use PostlCodesJSON and PlaceNameJSON to query the GeoNames database.
There are other databases and queries available, with maybe better data for specific purposes.

My main goal with this App was to show how to use the cool JQuery library to interface with web services and how to send and retrieve JSON data. And how to update metadata from inside a HTML App. GeoNames.org was good for that because they use a simple web service interface and the App is also useful all by itself. Pretty cool for a sample  ;D

I did not add all possible features to the app because I want it to be as simple as possible  - so users can dig into it, learn and reuse parts of it for their own apps.

A full-fledged GeoNames app would naturally provide a UI with "likely" addresses to select from, some means to to select which GeoNames service/database to use, and more...  ;)

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

cytochrome

Thanks for all the info. I had experimented with the radius, It doesn't often retrieve better results, mostly no result if R < 2 km, and the nearest town if R > 5 km.

My main goal with this App was to show how to use the cool JQuery library to interface with web services and how to send and retrieve JSON data. And how to update metadata from inside a HTML App. GeoNames.org was good for that because they use a simple web service interface and the App is also useful all by itself. Pretty cool for a sample  ;D

It shows how cool it is to those who already program in HTML. To the rest, like me, it shows that IM5 is full of features that are out of reach... When you put IM5 on the market you should include discount coupons for some crash course in html, vbscript and so on :D

Francis

Ferdinand

Quote from: cytochrome on August 27, 2013, 11:23:19 AM
- City: Bureau de Poste de Arc Et Senans  ==> bad

You were too deep in the salt mines?   ;)

Mario

Quote from: cytochrome on August 27, 2013, 03:06:26 PM
It shows how cool it is to those who already program in HTML. To the rest, like me, it shows that IM5 is full of features that are out of reach... When you put IM5 on the market you should include discount coupons for some crash course in html, vbscript and so on :D

The App panel is an immensely powerful tool. My sample Apps are not. Don't expect from a small sample app the same you can expect from a full-blown Geo-coding  like GeoSetter.

Also, if you use the Locations feature in IMatch you get reverse geo-coding via Google, which may or may not give you better results. Click on the Locations button in the Map panel for a start.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

pmbvw

Quote from: BenAW on August 27, 2013, 08:46:02 AM
QuoteI have never got a result from GeoNames, not with older versions and not with V5.0.108.
I had the same problem, until I went back to the GeoNames website and found my account wasn't "enabled" yet.
You may have the same problem.

This evening I have tested with the account "demo" and a few times I got results. So my installation seems to be ok.

It must have to do with my account, because with my own GeoNames account I never got results.
But I don't know why, because I can sign in successfully at GeoNames.org and work there.
Any ideas?

cytochrome

Quote from: Ferdinand on August 27, 2013, 04:54:47 PM
Quote from: cytochrome on August 27, 2013, 11:23:19 AM
- City: Bureau de Poste de Arc Et Senans  ==> bad

You were too deep in the salt mines?   ;)

Almost, in the Saline gardens :) I see you are a connoisseur..

Francis

cytochrome

Quote from: Mario on August 27, 2013, 04:57:36 PM
....
The App panel is an immensely powerful tool. My sample Apps are not. Don't expect from a small sample app the same you can expect from a full-blown Geo-coding  like GeoSetter.

I was not questioning the power of the App panel. My remark is that it, like other nice tools in iM5, requires special skills that most Imatch users are not likely to possess.

It makes IM5 into an elite tool, at least if it has to be fully exploited.  This might deter prospective users. Maybe an "IMatch SE" version, pre-configured for the everyday, non-specialist user would be enough for most, and less intimidating...  Just my two centimes.

Francis

jch2103

Quote from: cytochrome on August 27, 2013, 10:12:43 PM
...It makes IM5 into an elite tool, at least if it has to be fully exploited.  This might deter prospective users. Maybe an "IMatch SE" version, pre-configured for the everyday, non-specialist user would be enough for most, and less intimidating...  Just my two centimes.
The benefit of having the App panel is that users (not just an overloaded Mario) can contribute new applications for all the rest of us to use.
John

Mario

Quote from: cytochrome on August 27, 2013, 10:12:43 PM
It makes IM5 into an elite tool, at least if it has to be fully exploited.  This might deter prospective users.

The typical IMatch user uses maybe 30% of IMatch. But every user uses different 30%. Some will never use the App panel. Other users may purchase IMatch only because they want to use a specific script or app.

IMatch 5 is not only a DAM (plenty of them already around) but it is also a platform. It can be used to create functionality not available in other systems, not even the very expensive corporate-level DAM products. IMatch 3 has proven that already, and IMatch 5 is (hopefully) even better.

The general idea about the App panel is the same as with apps on your smart phone. 100% of all smart phone users use apps, but only ~0.0001% write apps.

As we've seen in IMatch 3,, scripts written by few were useful for many. For IMatch 5 I wanted something that is more mainstream, something that is based on the the HTML and JavaScript technologies which form 'the web'. Most web sites are written in HTML and JavaScript, and also apps for smart phones.

I think that there are a lot more people out there which can understand HTML and maybe a bit of JavaScript than classic old-school Visual Basic. Mix that with the App framework I provide in IMatch 5 and cool things can happen. Especially considering that 'the web' is so important today, and all major players offer 'web services' which can be utilized easily using JavaScript. This makes it much easier to write an App which interfaces with Flickr, Facebook, Instagram, Twitter, smugmug, etc.

If one user writes such an App, thousands of other users can use it.

Quote from: cytochrome on August 27, 2013, 10:12:43 PM
Maybe an "IMatch SE" version, pre-configured for the everyday, non-specialist user would be enough for most, and less intimidating...  Just my two centimes.

We have discussed this occasionally during the Pre Beta phase.

What would you remove from IMatch 5 to dumb it down for normal users?
I think that the install defaults are pretty good already, at least for users with a typical Adobe/LR workflow. If you would like to suggest changes, other default settings, metadata layouts, pre-built thesauri,  etc., I'l all ears in the feature request board.

But would IMatch then not just compete with all the other entry-level SOHO "Mom and Pop" applications out there? Or with web sites like Flickr, Picasa, smugmug which give you super-simple image management for free?

IMatch 5 caters for a very specific user base. Users who are not satisfied with what other 'image management' software offers them. IMatch can do it all, but may require some initial thought and learning (sigh). It's what I call the 'Photoshop principle':  After spending lots of money buying Photoshop and installing it on your machine, you can do almost nothing with it. You have to learn it, fight it, read the docs, study on-line tutorials, take training courses and whatnot to get a grip on that software. An entire industry has formed around 'learning Photoshop'. But once you've mastered it, there are virtually no limits. And, similar to IMatch 5 scripts and apps, you can download, install and use Photoshop Actions written by others without knowing how to create actions yourself.

The App panel, as an example, does not add complexity to IMatch. Users can use existing Apps and never waste a thought about creating apps themselves. Or a user just closes the App panel and never looks at it again.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

pmbvw

Quote from: BenAW on August 27, 2013, 08:46:02 AM
QuoteI have never got a result from GeoNames, not with older versions and not with V5.0.108.
I had the same problem, until I went back to the GeoNames website and found my account wasn't "enabled" yet.
You may have the same problem.

I now have tried it with a second account in GeoNames. No success to get Country, city usw with my two accounts. Only with "demo" it works (sometimes).

Do I have to login parallel on the website of GeoNames or not? Do I have to fill the GeoNames password somewhere in IMATCH5?
What have you done Ben, that it worked?

jch2103

Quote from: pmbvw on August 29, 2013, 09:43:37 PM
Do I have to login parallel on the website of GeoNames or not? Do I have to fill the GeoNames password somewhere in IMATCH5?
You should only have to input your GeoNames username in the GeoNames App (no need for a password in IMatch, or to be logged in parallel in GeoNames, as far as I know). One way to narrow down your issue would be to try GeoSetter, and test the GeoNames look-up feature there (File/Settings/Internet - see the GeoNames section). That should allow you to see if your GeoNames account is working properly.

Be aware that sometimes the GeoNames servers get overloaded and time out.

John

BenAW

Quote from: pmbvw on August 29, 2013, 09:43:37 PMDo I have to login parallel on the website of GeoNames or not? Do I have to fill the GeoNames password somewhere in IMATCH5?
What have you done Ben, that it worked?
No need to login parallel, and no need for the password.
I "enabled" my account per the following instructions:
http://www.geonames.org/export/web-services.html

pmbvw

Quote from: jch2103 on August 29, 2013, 11:17:16 PM
Quote from: pmbvw on August 29, 2013, 09:43:37 PM
Do I have to login parallel on the website of GeoNames or not? Do I have to fill the GeoNames password somewhere in IMATCH5?
You should only have to input your GeoNames username in the GeoNames App (no need for a password in IMatch, or to be logged in parallel in GeoNames, as far as I know). One way to narrow down your issue would be to try GeoSetter, and test the GeoNames look-up feature there (File/Settings/Internet - see the GeoNames section). That should allow you to see if your GeoNames account is working properly.
Be aware that sometimes the GeoNames servers get overloaded and time out.

Thank you for your help. now all is running well
I have tested your tip with GeoSetter and there I got a message (see attach)

So, in GeoNames you have to activate your account per E-Mail-Link to sign on.
But to use the Free Web Services you have to enable this separately, see link in the attachment:

After done, I got results with GeoSetter and also inside IMATCH with the GeoNames app :) :) :)


[attachment deleted by admin]

pmbvw

Quote from: BenAW on August 29, 2013, 11:51:28 PM
Quote from: pmbvw on August 29, 2013, 09:43:37 PMDo I have to login parallel on the website of GeoNames or not? Do I have to fill the GeoNames password somewhere in IMATCH5?
What have you done Ben, that it worked?
No need to login parallel, and no need for the password.
I "enabled" my account per the following instructions:
http://www.geonames.org/export/web-services.html

Thank you Ben,
you also gave me the right tip, but I have not read the link carefully, so I haven't read that I have to enable the web service separately.