Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse country GeoCoder has some flaws near 'Monaco' #593

Open
GGGuerin opened this issue Jan 12, 2021 · 6 comments
Open

Reverse country GeoCoder has some flaws near 'Monaco' #593

GGGuerin opened this issue Jan 12, 2021 · 6 comments
Labels
-hard- Difficulty to fix: hard enhancement New feature or request _LOW Low: Not user blocking

Comments

@GGGuerin
Copy link

GGGuerin commented Jan 12, 2021


Issue 1 GGG

Hello,
As you can see, I have three visits for this GK which are located in France. However, the site displays an other flag (polish one I suppose)

https://geokrety.org/konkret.php?id=78523&page=3

@kumy
Copy link
Member

kumy commented Jan 12, 2021

Thanks @GGGuerin for your report. This flag is the Monaco one ;) (yes it looks like Polish, but in reverse).
I've seen that before, it's our internal reverse country geocoder that has some "rounded values" in the polylines. It affects bother website version, actual prod and new-theme branch.

I'll keep this issue open to not forget that.

(BTW Welcome on GitHub!!!)

@kumy kumy added -medium- Difficulty to fix: medium _LOW Low: Not user blocking bug Something isn't working labels Jan 12, 2021
@kumy kumy changed the title Wrong flag Reverse country GeoCoder has some flaws near 'Monaco' Jan 12, 2021
@GGGuerin
Copy link
Author

GGGuerin commented Jan 12, 2021

Remark : These three caches are more than 200km far away from Monaco. I have got some caches which are in the area of Monaco (but in France) and are well situated in France.
I hope it helps ;-)

@kumy kumy mentioned this issue Jan 13, 2021
@kumy kumy added -hard- Difficulty to fix: hard and removed -medium- Difficulty to fix: medium labels Mar 16, 2021
@kumy
Copy link
Member

kumy commented Mar 16, 2021

To be noted reverse country geocoder methods are completly different in both GK implementation GKv1 (master) vs GKv2 (new-theme)

GKv1:

  1. check using an external API we host
  2. fallback to external free geocoding service
  3. it's a frequently scheduled task

GKv2:

  1. Countries geometries (btw, also timezones, and altitudes) are in database
  2. All logic about countries ans altitudes are directly handled by the database on CRUD triggers

This issue has been opened targeted to master branch (GKv1). Effectively there is a bug, but it's located in the simplified polygons used in geokrety/country-reverse-geocoder, I will not fix it, sorry.

Here is the result: https://geo.geokrety.org/api/getCountry?lat=43.74667&lon=5.20602
Screenshot from 2021-03-16 22-11-40

On GKv2, problem does not exists in normal use case:
Screenshot from 2021-03-16 22-10-46

I'll check what's the problem with daily imports it should have been automatic.

Edit: During daily imports, triggers are disabled to prevent foreign key errors :/

$pgsql->query('SET session_replication_role = replica;');

@okainov
Copy link
Member

okainov commented Mar 17, 2021

Countries geometries (btw, also timezones, and altitudes) are in database

Not really related to the issue itself, but could you please provide some insights, what was the data source here (I don't believe you handcrafter coordinates->countries mapping yourself), is this part reusable (read as "we're in Geocaching.su would be interested in using some smartness based on coordinates") and so on and so forth?

@GGGuerin
Copy link
Author

Great !

@kumy
Copy link
Member

kumy commented Mar 17, 2021

Here some insight about Gis features

General

Altitude profiles

SELECT public.ST_Value(rast, NEW.position::public.geometry) As elevation
FROM public.srtm
WHERE public.ST_Intersects(rast, NEW.position::public.geometry)
INTO elevation;

reverse country geocoder

SELECT iso_a2
FROM public.countries
WHERE public.ST_Intersects(geom, NEW.position::public.geography)
INTO country;

timezones

  • Not handled right now, didn't found a nice datasource similar to the reverse country geocoder polygons
  • The feature behind is to propose using dynamic localtime in logging form, based on provided move coordinates - but nothing implemented yet.

@kumy kumy added enhancement New feature or request and removed bug Something isn't working labels Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-hard- Difficulty to fix: hard enhancement New feature or request _LOW Low: Not user blocking
Projects
None yet
Development

No branches or pull requests

3 participants