ProfessionalWiki / ProfessionalWiki/Maps
Coordinate precision issue
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 78
- Forks
- 65
- Avg merge
- 9h 17m
- Merged PRs (30d)
- 6
Description
Setup and configuration
{
"SMWSQLStore": {
"mysql": "10.4.11-MariaDB"
},
"smw": "3.2.0-alpha",
"mediawiki": "1.34.0",
"php": "7.4.1"
}
Maps | 7.15.6
Issue
-
Adding a wiki text annotation with
[[Geographic coordinates::40.71449, -74.00713]](with a discrete precision). For context, those data are imported and not something that can be changed. -
Data stored in the
smw_di_coordstable appears as:
| s_id | p_id | o_serialized | o_lat | o_lon | |
|---|---|---|---|---|---|
| 303179 | 303186 | 40.71449,-74.00713 | 40.71449 | -74.00713 |
-
Building a DataValue representation for the above item will return
40° 42' 52.16" N, 74° 0' 25.67" Win zero degree mark format. -
Now, when used as part of a query,
{{#ask: [[Geographic coordinates::40° 42' 52.16" N, 74° 0' 25.67" W]] ...}}no results will return because those coordinates are transformed intoo_lon = '-74.007130555556'ando_lat = '40.714488888889which has a different precision than the data stored in (1).
So, the issue here is that [[Geographic coordinates::40.71449, -74.00713]] turns into [[Geographic coordinates::40° 42' 52.16" N, 74° 0' 25.67" W]] which when used as part of a query will have a different precision than the original stored data.
Part of the actual SQL query:
AS t12 ON t2.s_id=t12.s_id INNER JOIN smw_di_coordsAS t15 ON t2.s_id=t15.s_id) ON t0.smw_id=t2.s_id WHERE (t2.o_id='303185' AND (t4.p_id='303180') AND (t7.p_id='303186') AND (t9.p_id='303182') AND (t12.p_id='303180' AND t12.o_id='303179') AND ((t15.o_lat = '40.714488888889' AND t15.o_lon = '-74.007130555556') AND t15.p_id='303186')) AND t0.smw_iw!=':smw' AND t0.smw_iw!=':smw-delete' AND t0.smw_iw!=':smw-redi' LIMIT 251
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the coordinate DataValue representation is converted for an #ask query and compared with values in the smw_di_coords table. Reproduce the example using the stated coordinate values, then verify that the query uses precision compatible with the stored latitude and longitude so the expected result is returned.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mariadb, php
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100