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

As an opendatahub developer i want to improve the District / Municipality assignment on Activities and Pois from LTS #362

Open
RudiThoeni opened this issue May 26, 2023 · 23 comments
Assignees

Comments

@RudiThoeni
Copy link
Member

Since we do not get the assigned District from the LTS Interface, the district and municipality assignment has to be automated by ODH.
Currently ODH is taking the nearest District by GPS distance and assigns District and Municipality. The TV is passed by TIC Web and the Region is set in base of this TV

Possible Drawbacks are
-A TV inserts data that is located in a district that does not belong to the TV. So the result can be that the District/Municipality - TV/Region does not match
-The GPS Point is wrong the assigned District is wrong
-The GPS Point is missing the District cant be assigned
-It is not clear what District has to be assigned (Hike that goes trough more Districts/Municipalities)

@RudiThoeni
Copy link
Member Author

@niettadesantis
Copy link
Member

niettadesantis commented Aug 23, 2023

Hi Rudi, here there are news, look at this message in TIC-Web:
MicrosoftTeams-image (7)

Do I see it right that when we get the district directly from LTS, we can close this issue?

@RudiThoeni
Copy link
Member Author

Cool this are great news.....

@RudiThoeni
Copy link
Member Author

RudiThoeni commented Sep 4, 2023

I will inspect the data, i think at the moment not many Activities/Pois have the District assigned.... the next question is how to deal with Data which has more Districts assigned......

@RudiThoeni RudiThoeni reopened this Sep 4, 2023
@RudiThoeni
Copy link
Member Author

Hi Antonietta

I read the last LTS Docs and inspected the data the Districts can be retrieved by simply adding District='1' in the Request
The output is then enriched with a property like
<District RID="79CBD63051C911D18F1400A02427D15E"/>
This is working on the LTS POI Interface..... and as far as i understand only one District is assigned.....

I think this is great, my proposal is to use the TIC Web District assignment (if available) instead of our logic..... and build the whole LocationInfo on this District assignment...... (District -> Municipality -> TV -> Region)

Unfortunately on the ActivityData Interface this info is not available.... so there the old logic remains the same

waht do you think?

@niettadesantis
Copy link
Member

Hi Rudi, sorry the late answer. Yes, this is great, let's do it for wherever it's available. Maybe they will implement it also for other interfaces in future.

@niettadesantis
Copy link
Member

Rudi I'm setting up a mail for LTS to ask if they can implement the "Fraktionsauswahl" also for other data-types.
Is there any data-type where they already had it before?
Otherwise I will just mention to please integrate it also "for activities, events and accommodations".

@RudiThoeni
Copy link
Member Author

Hi Antonietta
events (FraRID="79CBD88C51C911D18F1400A02427D15E") and accommodations (S7RID="79CBD7ED51C911D18F1400A02427D15E") have already this information.......

Only on the data from ActivityData it is missing....... I think the main problem here is that often there are activities which area located in more fractions....... I think the simplest solution would be to add the Fraction of the StartingPoint of the Activity.....

@niettadesantis
Copy link
Member

Ok, thank you Rudi.
Fyi, this ist LTS response:

Hallo Antonietta,

bei uns stand hier auch die Datenqualität im Vordergrund.
Für die Aktivitäten hatten wir es auch intern besprochen, allerdings kamen wir zum Schluss dass es dort nicht sinnvoll ist. Das hätte zu einer größeren Diskussion geführt.
Wir hätten entscheiden müssen, welche Fraktion die korrekt wäre (Startpunkt, Endpunkt). Was bei Runden hinterlegt werden sollte…

Jede Entscheidung die wir hierzu getroffen hätten, wäre in Zukunft in Frage gestellt worden.
Weitere Ergänzungen sind deshalb nicht in Planung

Viele Grüße und schönes Wochenende
Demas

@RudiThoeni
Copy link
Member Author

ok, then i will add the location parsing to POIs only

@RudiThoeni
Copy link
Member Author

Asked LTS to insert the District Element into their Object Model. The sync is currently using their LCS Objectmodell and this Element was not included yet... let's wait for their answer....

@RudiThoeni
Copy link
Member Author

I got a mail from LTS on 22-11 where they added the props to the objectmodel so i will work on this issue this sprint

@antoniettadesantis
Copy link

Please Rudi check why at the moment we are not adopting our logic of the automatic district assignment if the district is not coming from LTS.
image

@RudiThoeni
Copy link
Member Author

Hi Antonietta

I checked the code now.

If a DistrictId is assigned on LTS Side this District Id is used (only on POIs, not Activities)
If this is not the case the Region and TVInfo is calculated out of the assigned Area.
If the Poi is imported the first time, the District is tried to be matched with a GPS Search with a max Distance of 20km......
If the Poi is already present in our DB this recalculation is skipped. I think we adapted it this way because the District was manual set/corrected by the redaction to not overwrite this changes....

we can always change this workflow.... We can also do syncs on all Activities/Pois which have no Municipality/District assignment.....

@antoniettadesantis
Copy link

Hi Rudi,
it's just strange that we have POI's without district, this should not happen - according to the logic described by you. Or could it be that these POI's are older than the logic itself?
It would be great if we could import again only the POI's without district because I don't think that the redaction deleted a district assignment: they eventually correct it, but don't delete it.

@RudiThoeni
Copy link
Member Author

There can be edge cases

  • Poi is older than the logic and no district was assigned
  • Poi had no or a wrong GPS Coordinate so no District could be matched

I will check if i can do some reassignments and see how many there are etc....

@RudiThoeni
Copy link
Member Author

@antoniettadesantis
I revisited the logic and found some issues with LTS District ID "not defined" assigned, and with POIs outside of South Tyrol and added this exceptions. I added also the GPS matching for Pois which are already in the DB and does not have a District assigned.....
Now it works this way

  1. If a LTS District is assigned use this
  2. If no LTS District is set AND no District is set in the current data do a GPS matching to assign Districts
  3. If no LTS District is set and a District is already assigned in the current data do nothing

If it is ok for you i can resync all Pois without District....
This could also be used on Activities... so there we have also a District assigned, what do you think?

@antoniettadesantis
Copy link

Hi Rudi,
thank you very much - this should work fine, please do the resync of all POI's and activities without district.

@RudiThoeni
Copy link
Member Author

alright! will write you when done

@RudiThoeni
Copy link
Member Author

I resynced all POIS without Districts and did some Cleanup.

I created a list where i tried to find all "anomalities" in this District assignment
-Records where no DistrictInfo is set (causes if no GPS Point is there, or maybe data is from a source where no District could be assigned example: magnolia pois) 574
-Records where the TV and District mismatches.... (When the district is not part of the assigned TV) 1635
-Records where no TV is assigned 9

Maybe here we can agree on a procedure to update the data quality, in the meantime i will try to find out if there is some false Gps Assignment on a District something and i can solve a lot of records with a single operation...........

ODHActivityPois - District Anomalities.xlsx

That numbers may sounds big, but we have ca. 26.000 Datasets in the ODHActivityPoi Endpoint, so i think this is a good point ;)

cheers
Rudi

@antoniettadesantis
Copy link

Thank you Rudi,
Cinzia and Christine will analyze and give a feedback.
What we can say in the meantime is that we don't need the Magnolia data anymore. So it could be batch-deactivated or even -deleted.
Will let you know more asap.

@RudiThoeni
Copy link
Member Author

RudiThoeni commented Jun 4, 2024

maybe we can periodically work on this sheet, i already checked and corrected the no TV assigned POIs and some others.....
lets define this in our next meeting, in the meantime I shared the sheet with you.

@RudiThoeni
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants