BiologicalRecordsCentre / ABLE

Assessing ButterfLies in Europe project repository
2 stars 3 forks source link

Problems with country borders on the Explore online data map #379

Open CrisSevilleja opened 2 years ago

CrisSevilleja commented 2 years ago

On the Explore online data map https://butterfly-monitoring.net/elastic/all-records, there is a problem when selecting the filter by country, the border is not accurate to the terrain border and some samples are left out from on the filter selection.

That is the case for Bulgaria. there is a transect close to the coast BG - Black Sea transect as you se below on the map

2021-11-11_13h30_39

If you select the country filter for Bulgaria, that transect is out of the current border of Bulgaria and won't appear on the searching of Bulgarian records.

2021-11-11_13h32_43

Can it be resolved this issue about the borders easily? @DavidRoy @johnvanbreda

johnvanbreda commented 2 years ago

@DavidRoy this is the same issue as observed for Swedish data, which we resolved just for that case. The NUTS Countries 2016 layer we loaded is not accurate enough it seems.

DavidRoy commented 2 years ago

@johnvanbreda yes, what is your suggested solution? Either load a more detailed NUTS boundary set and/or buffer out to sea?

johnvanbreda commented 2 years ago

@DavidRoy We may need to do both - the land boundaries aren't accurate enough as it stands. There will always be a risk that a record along the boundary falls into the wrong polygon unless the polygons are perfect, so one thought is that we should buffer very slightly along the land boundaries as well, so some records end up in 2 countries (better than none or just the wrong one?).

DavidRoy commented 2 years ago

ageed, we'll schedule this in

CrisSevilleja commented 2 years ago

Hi again, when is this issue scheduled to be solved? Registering a new transect in Slovenia appeared the message "The new transect position is outside the boundary of the previously selected country". As it was mentioned the NUTS are not accurate enough. My main worry is if these kinds of transects outside of the current borders won't appear under the correct country and won't appear to the coordinators either on the downloads. @DavidRoy @johnvanbreda

2022-02-22_10h05_19 2022-02-22_11h34_03
CrisSevilleja commented 7 months ago

Hello @JimBacon . This is solved with the new borders applied. However I realised the filter of regions disappeared from Explore Online Data https://butterfly-monitoring.net/elastic/all-records I checked and the rest of functions for regional coordinator are working well (visualized data and transects in other pages). But this page is affected not showing the regional filter that is useful.

Maybe the regions are not applied to the sea...

JimBacon commented 7 months ago

I see this. Do you not see the country selection? Also, I note Bulgaria is not one of the countries I updated in https://github.com/BiologicalRecordsCentre/ABLE/issues/631 so the original prompt for this issue is not solved yet.

image

CrisSevilleja commented 7 months ago

yes, the country selection yes, and indeed now you can see the sea area of each country with sea. But before when you selected a country, the region filter will appear to select a specific region. Now it is not hapenning.

JimBacon commented 7 months ago

Looks like a bug has been introduced. I can see that when you select a country, a request is sent to the warehouse for the regions but the request is wrong and the response is empty. Perhaps one for @andrewvanbreda

DavidRoy commented 7 months ago

Are you ok to have a look @andrewvanbreda. Can you aslo extend the list of countries in the drop-down list - we now have New Zealand and South Afrcia for example

andrewvanbreda commented 7 months ago

@JimBacon @DavidRoy Yes I will take a look this afternoon. It might be caused by the last client_helpers update.

andrewvanbreda commented 7 months ago

Hi @JimBacon @DavidRoy @CrisSevilleja I have applied a fix to the live site. The problem is being caused by newer Indicia code that is not working the way the old code used to. What it happening is the Warehouse is being asked to return region locations, at the same time it is also asking for the list to be limited to the list of country IDs, as no regions have a country ID the list is then empty. The list of country IDs should obviously only apply to the parent drop-down. I haven't examined the code in enough detail yet to tell if this is a bug, or whether the code is now more correct and causing the old configuration to fail. Either way, I will get this fixed so it won't be affected by updates in the future.

andrewvanbreda commented 7 months ago

Hi@DavidRoy New Zealand and South Africa both added as requested.

I also added Japan as that country also seemed to also be missing and does have records.

I had a quick look around the system to see if these needed adding anywhere else, and have also added those countries into a similar drop-down here https://butterfly-monitoring.net/mydata/samples

As far as I can tell they are present elsewhere

I noticed the following places have schemes and do not appear in the Country/EU NUTS region drop-down, but I did not add them as they don't seem to have any records. I can add them if you want

Botswana Jersey Nigeria Saint Helena

andrewvanbreda commented 7 months ago

Here is some detail on the region drop-down not appearing problem for anyone who is interested... I have worked out exactly what has happened with the region drop-down not appearing. This is being caused by changes in the initLinkedLists function in data_entry_helper. I can see the problematic lines and why they cause the problem, however I actually do not know why the changes were made, so I cannot just undo the changes because that would break whatever those changes were made for.

For now we will have to leave EBMS to run the older code that I have re-inserted. I will discuss with John outside of Github to avoid filling up this thread and get back to you once corrected properly. He is away on work trip at moment, so that might have to wait a couple of weeks. Anyway, the site should be operating correctly in this area at the time of writing, let me know if you notice anything unusual related to this. I have attached a text file with some notes for myself describing the issue.

Problem details.txt

andrewvanbreda commented 6 months ago

Fix applied to new Indicia code, so we won't have this issue in future. Fix currently committed to Develop branch. I will close this issue after this is released to Master by John

https://github.com/Indicia-Team/client_helpers/commit/fac6e784b34adec3cd3d99119862225413f8bdf9

(note some of my previous notes in prior comment are inaccurate after further investigation)

andrewvanbreda commented 6 months ago

Closing this issue as the fix is now present in the indicia-team/client_helpers master code repository (i.e. the fix will not be overwritten by future updates)

JimBacon commented 6 months ago

Re-opening as the original topic of this issue has not been completely resolved. I.e. many country borders are still omitting land areas because they are low resolution and trying to follow the coast line.