Closed DavidRoy closed 2 years ago
@DavidRoy Yes, can do that very easily.
Hi @DavidRoy On UKPoMS we have a Squares Management page for admins. However that did not include a map. I have extended the equivalent page on Spring here:
https://test-eu-pollinator.pantheonsite.io/list-squares
At the moment, this is designed for admins (has editing facility). Will you want it available for public or admins?
There are a couple of issues with page I will fix at low priority
@andrewvanbreda that's great. In answer to your numbered points.
Additional requirements:
@DavidRoy Thanks for note about redirection. I have corrected that, and also on UKPomS (good example of the 2 projects helping each other out)
Other points noted and will be worked on.
Hi @DavidRoy On SPRING, will squares be allocated as they are in UKPoMS?, on UKPoMS there is a checkbox that is set on the square to mark them as allocated which then would appear on this equivalent page https://test-eu-pollinator.pantheonsite.io/square-volunteer-pantrap-statuses
hi @andrewvanbreda there is no need for the allocation checkbox for SPRING. There might be other attributes we want to capture but I'll raise any requirements separately
Hi @BirenRathod Whenever you get a sec, can you pull this report please. Not urgent, just when you get a sec. Cheers reports/projects/PoMS/spring_squares_list_and_mapping.xml
@andrewvanbreda it has pulled on live now.
@BirenRathod Thanks Biren for super quick response, can see that is live
@DavidRoy Some further fixes. Location code added, country filter added, vanishing points on zoom fixed (as I had to create a new report which fixed this naturally, even if not high priority).
The Country filter does currently assume the square's imported country code attribute matches the Country 2016 code, so if you see it not working for a particular country, we can check that as a first port of call.
Do you know if there is a Countries 2016 WMS layer we could use a layer to display the country boundaries (we do that for NPMS), however I can't see the list of available layers?
Not fixed the reaction of the grid to map yet, I believe this is because it is a locations report and there is something stopping it working as it normally would in that scenario.
@andrewvanbreda Selecting Greece does not return any sites. Is there a mismatch between country names and the spatial layer?
Text under the country layer needs changing.
Currently says 'ID of the parent country to filter to.
should say 'Select country to filter to'
@DavidRoy Yes there is a mismatch, Greece is "EL" on the Countries 2016 country, but has been imported as "GR" on the MVS location. I will get Biren to run sql to find all mismatches, then we can decide best way to fix that. Could be that we can place exceptions directly into report if needed, if the codes are actually correct.
I will make text change now, but probably not worth getting Biren to pull the report just for that. So that change will appear next time report pulled for something else.
@BirenRathod Could you run this whenever you get a sec please. Cheers.
select l.id,l.name from indicia.locations l JOIN indicia.location_attribute_values lav on lav.location_attribute_id = 305 AND lav.location_id = l.id AND lav.deleted = false LEFT JOIN indicia.locations countries on countries.code = lav.text_value AND countries.location_type_id in (16516) AND countries.deleted = false where l.location_type_id = 19048 AND countries.id = null;
@andrewvanbreda It has returned with no result.
@BirenRathod Ok that is fine. I actually didn't test it in detail on my machine as a lot of it was from a real report and didn't want to waste time. I will give it a proper check on my machine, there is probably a mistake
@BirenRathod Sorry my bad, the logic of the report was right, but I put in a silly syntax error, I should of put "IS NULL" at the end.
Have double-checked on my machine, please try again. Thanks.
select l.id,l.name from indicia.locations l JOIN indicia.location_attribute_values lav on lav.location_attribute_id = 305 AND lav.location_id = l.id AND lav.deleted = false LEFT JOIN indicia.locations countries on countries.code = lav.text_value AND countries.location_type_id in (16516) AND countries.deleted = false where l.location_type_id = 19048 AND countries.id IS null;
AVB not to myself: have made the report wording change and pushed that.
@andrewvanbreda I have attached the result. data-1645200006070_18022022.zip
@BirenRathod Brilliant thanks
@DavidRoy Think Greece is the only one with mismatch. EL does look like a correct country code.
I think that is the right code on the country, so one solution is if I just edit the code on the Greek squares. Shall I do that?
Alternatively we could change approach to linking a square to country. (I had originally considered making the country a parent of the square, but I thought that could get messy tying down the data structure like that e.g. what would happen if you then wanted to add a region location mid-tier. I also didn't want your general country locations to have a messy set of child locations)
@andrewvanbreda can't we just do this on a spatial basis? The drop-down is purely to zoom the map to a boundary, and then show the locations that intersect with that boundary. The country column in the location attributes are irrelevant for this?
The ICO 2-letter code is GR, so odd that the Country 2016 uses EL. https://www.iban.com/country-codes
@DavidRoy I am not a code expert, but the following page does note a code of EL that is an exception for Greece. I guess it depends what type of code you should be using for your work.
https://publications.europa.eu/code/pdf/370000en.htm
I am not sure if we can do this spatially. We need an index as we don't want to be calculating it everytime.
The cache samples table has a list of location_ids in a column. But in our case, the map features themselves are locations, so we have no equivalent cache table. Perhaps am missing something here. Do you know an answer? or I can check with John.
I have check the spatial index builder code and it is just referring to indexing against samples/occurrences.
So this (alongside the issues I mentioned about parent location relationships) simply led me to the conclusion that joining on the code int he report would be best.
Another option is to build a one-off exception into the report for Greece.
Noting the reason for not doing a direct intersect in report is purely because wanted to avoid extra load on warehouse, the code join would be quicker (or index if there was one)
Thanks for the explanation. Let's stick with your plan and use the EU code for Greece rather than the ISO one.
So the country code in the location list needs to be 'EL' for those for Greece?
Are you able to make this update if you haven't done so
@DavidRoy I hadn't, but I have now and can see it working on the map.
Three thoughts
Think this one is out of place http://warehouse1.indicia.org.uk/index.php/location/edit/275156
Should the location code field itself be changed to use EL as well? I didn't change that.
When the Countries termlist is expanded to include Greece, we should use EL as well in the country synonym. http://warehouse1.indicia.org.uk/index.php/termlist/edit/974 (this is the termlist that is use by sample to identify the county the term lists are associated with)
thanks
@DavidRoy
@andrewvanbreda I removed your developer notes from the test version and changed the page name. So I can ask colleagues to review their sites
@BirenRathod Hi Biren, Could you pull this report please, will allow the grid to react to map clicks for David. Thanks reports/projects/PoMS/spring_squares_list_and_mapping.xml
@andrewvanbreda This is has gone live now.
@DavidRoy @BirenRathod Thanks Biren. David: Using the ? icon on the map now allows you to click on the map and the grid will react. This will let you click on misplaced items on the map to see what they are. (note the map doesn't highlight locations when grid rows are clicked yet).
@BirenRathod Can I be a pain and get you to pull that report again as I fixed the grid click much quicker than I thought. I realised the grid clicking was working, it is simply that the default map feature colour was red, and the grid clicking is also red, and therefore not showing up! Cheers.
@andrewvanbreda Not at all. that's done.
@DavidRoy @BirenRathod Thanks Biren. David that is working too. So grid can be clicked and the map is highlighting. David, I think this issue can be closed if you are happy with it?
Thanks. That works well
Following closed issue #20
Can you create a simple map page on the website for the site list
Also needed for #21