Place a company on the map from its Wikidata coordinates #701
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#701
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
From the list: “Companies with Wikidata might have location data available = coordinates = pin on a map.” A company is placed today from the text of its location against an offline city table; the coordinate Wikidata holds for the organisation is never read. The engine, the precision and the tile questions are decided in #700; this issue is only the Wikidata source.
What exists today
Company.location_latandlocation_lonare floats, withlocation_resolved_from,location_resolved_atandlocation_resolved_by, whose values areLocationSource.GUESSED(the city dataset),MANUALandUNPLACED(src/postulo/jobs/models.py:224-235,:273-287). There is no Wikidata value.Company.save()guesses again whenever the location text differs from the text the last resolution was made from, unless the source isMANUAL(:322-331); a source of any other kind is therefore overwritten by the next edit of the text.Special:EntityData/Q29671.json): the University of Aveiro item has a coordinate location (P625: latitude 40.63027778, longitude -8.6575, precision 0.000001 degrees) alongside its labels, website and ISNI. That is a building, not a city. An item can also have no P625, or several; an organisation with many offices is usually given its headquarters, and the headquarters location is a statement (P159) pointing at another item.CompanyMapViewkeys a place by the text and uses the first coordinate found for it (src/postulo/jobs/views.py:175-184); a precise point under a city's text would become that city's dot.COMPANY_FIELDScarrieslocationbut none of the coordinate columns (src/postulo/core/export.py:164-176), so after a restore every company is guessed again and a person's correction is lost; a merge does move all six location fields (src/postulo/jobs/merging.py:478-491). Found while drafting; not filed separately.Checked against
mainatf09b6010b.Proposal
LocationSource.WIKIDATA, fitting the 20-character column.MANUAL) beats Wikidata's, which beats the city guess; a Wikidata point is not derived from the text, so editing the text does not replace it, and it can be taken off (the place then falls back to the guess) or replaced by fetching again.Decisions
Builds on
Issues #42 (Wikidata as an identifier), #108 (the map), #366 (the outbound inventory), #534 and #399 (open map defects). Related: #700 (the decisions), #673 (the Wikidata read).
Needed by
#702 (a precise point is the model for an address's pin).
Done when
tests/test_company_map.py: a company with a fetched Wikidata point is drawn at it; editing its location text does not move it; a manual correction beats it; taking it off falls back to the city guess; another company's dot does not move.tests/test_export.py: coordinates, source and time survive the archive round trip; the archive format goes up by one (src/postulo/core/export.pyFORMAT_VERSION: one more than whateverFORMAT_VERSIONis when the commit lands (29 atf09b6010b);tests/test_export.py:96follows it), and #673 bumps it too if it lands first. The candidate format (4) does not change; the processing record concerns contacts and is unchanged for a company.tests/test_page_coverage.pyand the isolation sweep stand. New strings are in the working catalogues (en-GB, fr-FR, pt-PT as drafts) and Weblate (#349).From the list of improvements of 2026-10-02.