Skip Navigation

Photos in the correct location & in the wrong country

Travel Forums System Talk Photos in the correct location & in the wrong country


Last Post

11. Posted by katebum (Budding Member 100 posts) 2y

Ok.. now I understand... nothing you can really do quick.. and I think... from all of us... it makes YOU most crazy

12. Posted by Peter (Admin 5905 posts) 2y

Good news folks. I have FINALLY managed to get this database upgraded. All seems to have gone without any trouble and I now have access to all the geo functions I need to fix these problems.

The mapping should also have a nice speed improvement which will surely help with some saving issues we've had. The queries in question in some cases are down from several seconds to a few milliseconds. That's the kind of speed bump that makes a gigantic difference.

Do note: Countries currently not being counted in map stats will not be fixed automatically (I might look at a script for this), but let me know if I need to fix any of your trips manually.

13. Posted by Alain13 (Respected Member 102 posts) 2y

I confirm is not fixed automatically but it works fine now as soon I relocate the stops.
Masai-Mara is back in Kenya and Mekong falls back in Laos :)
Many thanks

14. Posted by katebum (Budding Member 100 posts) 2y



I tried with a very bad picture of mine:

It's located in France but very very near the border to Luxembourg.

Coords: 49.506280 , 6.194230

I uploaded the photo again but it's still resolved to Luxembourg instead of France

I know this is a very bad example of a picture near the border. But perhaps you're interested in.

15. Posted by katebum (Budding Member 100 posts) 2y

This photo is now in Cologne and not longer in Luxembourg :-))

So it seems your update was ;)successful in this case.

16. Posted by Peter (Admin 5905 posts) 2y

Happy to have a few edge cases to test. Let me give some background on how the border situations work. These can be fixed, but often will require a bit of manual tweaking.

Each country has a large shape that covers all its borders. This is really a giant polygon (sometimes more than one). Naturally, the more points are in the polygon, the more complex the queries become and there there end up being some storage limits. Sadly, not many countries have perfectly straight borders.

To work around this, corners are cut to reduce the number of points in the polygon.

I've actually manually remapped a whole ton of countries to ensure our shapes are fairly accurate. My philosophy while doing this is to reduce detail on parts which are unlikely to have any activity (inside forests for example), while increasing detail on the bits that might have some activity (ie.. Niagara Falls). This will give the best possible country shapes for our particular needs. Detailed, but lightweight enough to not bog down the site.

Anyway, background info now out of the way, the solution is simple - adjust that country shape to ensure your photo is in the right country. Knowing that this is a border area where photos might be taken means it's worth tweaking it a little for more accuracy.

17. Posted by Peter (Admin 5905 posts) 2y

Kate, you could try that France one again. I'm pretty sure it will work this time around.

18. Posted by Peter (Admin 5905 posts) 2y

Ok, now here's something new.

I figured a few of you probably would want to fix up any misallocated photos, but don't like the idea of re-uploading everything.

I've made this script which will allow you to do this yourself for your photos. The system will find all the photos which it thinks are in the wrong spot.

You need to check that it's right. Particularly photos taken near borders are problematic.

If you see a problem, check that your own coordinates are right - I know some of you have changed coordinates to try and make things show up differently. If your coordinates are definitely in the right country, but the script is suggesting a different one, please let me know and I'll fix the country shape at that point of the map.

If you check through all the photos and they all look ok, then you can click the "Yes, fix all" button and it will fix them all up at once.

19. Posted by katebum (Budding Member 100 posts) 2y

Hey Ho :-) Wow!!!

the script is cool! thank you very much!

Before I use it I leave it as it is.... execute it with my user and you will see that you can see that some photos have wrong location but suggestions are empty. In my case these are 2 photos from Serbia.

20. Posted by Peter (Admin 5905 posts) 2y

Both of those photos are set to Serbia already though. Should they be somewhere else?