Lat / Long matches incorrectly
See original GitHub issue$ poetry run pywhat acb6d73d95a10d30aef9894603e90963
Matched on: e90963
Name: Latitude & Longitude Coordinates
Link: https://www.google.com/maps/place/e90963
Bug found in #196
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Regular expression for matching latitude/longitude coordinates?
I expected this to match a double, a comma, perhaps some space, and another double, but it doesn't seem to work. Specifically it...
Read more >Latitude Longitude Coordinates not matching - Autodesk Forums
Solved: Hello, I am trying to get my latitude and longitude coordinates to match... Now attached are my abiement settings, and drawing.
Read more >X and Y coordinates display at incorrect locations in ArcGIS Pro
The following describe the possible causes: The geographic coordinate system of the map extent does not match that of the output feature class....
Read more >Lat, long values extracted in QGIS do not match/overlay with ...
I have been using QGIS to extract lat and long vertices from a number of shapefiles. It worked great but for one file....
Read more >Why GPS Coordinates Look Wrong on Maps of China
If so then you may have noticed that satellite images do not match up with any of the geographic features on the map,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
plz explain
I propose this new one: https://regex101.com/r/WrINyr/1
The old RegEx consists of three patterns:
(?:(?:N|W|S|E)\\s?\\d+\\s?\\u00B0?\\s?\\d+\\.?\\d*\\s?\\'?\\s?\\d*\\.?\\,?\\d*?\"?\\s?){1,2}
(?:\\d+\\s?\\u00B0\\s?\\d+\\s?\\'\\s?\\d+\\.?\\,?\\d{0,}?\"\\s?(?:N|W|S|E)\\s?){1,2}
(?:[-+]?(?:[0-8]?\\d+\\.\\d{4,}|90(?:\\.0+)?),\\s*[-+]?(?:180(?:\\.0+)?|(?:(?:1[0-7]\\d)|(?:[1-9]?\\d))(?:\\.\\d+)?))
https://github.com/bee-san/pyWhat/blob/6162aceac5b9b68e2bd8f8af56cb94f2eab4a69c/pywhat/Data/regex.json#L1480The first pattern slightly differs from the second pattern in the symbol matchings
\\u00B0?
and\\u00B0
\\'?
and\\'
\"?
and\"
This causes the RegEx matching ofe26
,e90963
, and so on.I’ve observed that there is nothing like
N 52.6169586, W -1.9779857
; only N 32° 53.733 W 096° 48.358, and 52.6169586, -1.9779857 are valid.Then these symbol matching should’ve been changed to the strict matching of
\\u00B0
,\\'
, and\"
or the flexible matching of\\u00B0
,\\'?
, and\"?
.If it looks fine, I’ll make a patch. Thanks