orange3-geo icon indicating copy to clipboard operation
orange3-geo copied to clipboard

Adjust lat/long for Norway?

Open kaimikael opened this issue 4 years ago • 10 comments

Geo version

0.2.8

Orange version

3.27.1

Expected behavior

I think it would make more sense to have the default location of Norway to be in mainland Norway, say somewhere about 62° N, 8° E.

Actual behavior

Currently Norway is represented by a point on Svalbard, which, while admittedly Norwegian territory, is not where you’d look first.

Steps to reproduce the behavior

Show any data containing Norway with Geo Map.

Additional info (worksheets, data, screenshots, ...)
Screenshot 2020-12-08 at 21 31 20

kaimikael avatar Dec 08 '20 20:12 kaimikael

I could be that the point is computed as a central point due to Norway having some overseas territories, but unsure if that's the case. I was not able to find where to adjust this. :(

ajdapretnar avatar Dec 09 '20 10:12 ajdapretnar

That would be in orange3-geo-master/orangecontrib/geo/geojson/admin1-NOR.json

kaimikael avatar Dec 09 '20 10:12 kaimikael

I know, but where in that file? I was only able to find polygon descriptions, couldn't figure out where is the coordinate for the "center of Norway". If you can find it, feel free to submit a pull request. :)

ajdapretnar avatar Dec 09 '20 10:12 ajdapretnar

Yes, I was too hasty. There is a lat/long, but it’s for Bouvet Island. Weird. I’ll dig a bit more.

kaimikael avatar Dec 09 '20 10:12 kaimikael

Not just Bouvet, also other counties. @kernc Do you perhaps remember if there is a "center" coordinate or it is computed on-the-fly?

ajdapretnar avatar Dec 09 '20 10:12 ajdapretnar

Yes, if there isn’t an explicit latitude and longitude given, a “representative point” is computed. So, it should be possible to add lat/long data to the file. I’ll fiddle around and see what I can come up with :-)

kaimikael avatar Dec 09 '20 10:12 kaimikael

What I do remember is that JSONs are generated. Manual edits should probably be made to the generating code. :sweat_smile:

https://github.com/biolab/orange3-geo/blob/c54a6a8e266395b0aaad65dcf90afb2231b21c0e/orangecontrib/geo/geojson/make-geojson.sh#L81-L141

kernc avatar Dec 09 '20 11:12 kernc

Then again, maybe lat-longs for admin0 (countries) are computed on-the-fly, in which case the override might also fit somewhere here: https://github.com/biolab/orange3-geo/blob/12660269364a15a13e32d525adbf6ad7f9f722cc/orangecontrib/geo/mapper.py#L111-L126

kernc avatar Dec 09 '20 11:12 kernc

I've been looking at the data files and I can’t figure out how they are generated. As we noted, there is info on Bouvet island (also Norwegian territory) in the admin1-NOR.json file, but nowhere else in the orange3-geo-master tree, so if that file is generated, what is it based on?

kaimikael avatar Dec 09 '20 11:12 kaimikael

if that file is generated, what is it based on?

https://github.com/biolab/orange3-geo/blob/master/CONTRIBUTING.md#building-geojson-files

Based on your screenshot, however, I think you should to be looking at admin0.json and the code snippet above.

kernc avatar Dec 09 '20 12:12 kernc