The lat/long coordinates of 92 Canadian postal codes are outside Canada

78 views
Skip to first unread message

Boris Verkhovskiy

unread,
Feb 27, 2021, 5:15:20 AMFeb 27
to GeoNames
According to https://en.wikipedia.org/wiki/List_of_extreme_points_of_Canada the range of possible values for a latitude/longitude of a Canadian postal code are

41.681389 <= latitude <= 83.111389
-141.001944 <= longitude <= -52.619444

Here are 92 postal codes that don't match that range:

out of bounds longitude    54.2338    -1.3414: ['CA', 'T3B 6H4', 'Calgary', 'Alberta', '01', '', '', '', '', '54.2338', '-1.3414', '6']
out of bounds longitude    43.3623    -8.4116: ['CA', 'T4E 0B2', 'Red Deer County', 'Alberta', '01', '', '', '', '', '43.3623', '-8.4116', '6']
out of bounds longitude    43.3623    -8.4116: ['CA', 'T4E 0B3', 'Red Deer County', 'Alberta', '01', '', '', '', '', '43.3623', '-8.4116', '6']
out of bounds longitude    43.3623    -8.4116: ['CA', 'T4E 0S5', 'Red Deer County', 'Alberta', '01', '', '', '', '', '43.3623', '-8.4116', '6']
out of bounds longitude    43.3623    -8.4116: ['CA', 'T4E 1R3', 'Red Deer County', 'Alberta', '01', '', '', '', '', '43.3623', '-8.4116', '6']
out of bounds longitude    43.3623    -8.4116: ['CA', 'T4E 1R4', 'Red Deer County', 'Alberta', '01', '', '', '', '', '43.3623', '-8.4116', '6']
out of bounds longitude    43.3623    -8.4116: ['CA', 'T4E 1R5', 'Red Deer County', 'Alberta', '01', '', '', '', '', '43.3623', '-8.4116', '6']
out of bounds longitude    43.3623    -8.4116: ['CA', 'T4E 1R6', 'Red Deer County', 'Alberta', '01', '', '', '', '', '43.3623', '-8.4116', '6']
out of bounds longitude    43.3623    -8.4116: ['CA', 'T4E 1R7', 'Red Deer County', 'Alberta', '01', '', '', '', '', '43.3623', '-8.4116', '6']
out of bounds longitude    43.3623    -8.4116: ['CA', 'T4E 1R8', 'Red Deer County', 'Alberta', '01', '', '', '', '', '43.3623', '-8.4116', '6']
out of bounds longitude    43.3623    -8.4116: ['CA', 'T4E 1R9', 'Red Deer County', 'Alberta', '01', '', '', '', '', '43.3623', '-8.4116', '6']
out of bounds longitude    43.3623    -8.4116: ['CA', 'T4E 1S1', 'Red Deer County', 'Alberta', '01', '', '', '', '', '43.3623', '-8.4116', '6']
out of bounds longitude    65.9646    29.1887: ['CA', 'T4E 2J5', 'Red Deer County', 'Alberta', '01', '', '', '', '', '65.9646', '29.1887', '6']
out of bounds longitude    43.3623    -8.4116: ['CA', 'T4P 0Y2', 'Red Deer', 'Alberta', '01', '', '', '', '', '43.3623', '-8.4116', '6']
out of bounds longitude    43.3623    -8.4116: ['CA', 'T4P 0Z9', 'Red Deer', 'Alberta', '01', '', '', '', '', '43.3623', '-8.4116', '6']
out of bounds longitude     55.046   -39.4495: ['CA', 'T8H 0Z1', 'Sherwood Park', 'Alberta', '01', '', '', '', '', '55.046', '-39.4495', '6']
out of bounds latitude     41.6114   -75.2817: ['CA', 'V3N 0H2', 'Burnaby', 'British Columbia', '02', '', '', '', '', '41.6114', '-75.2817', '6']
out of bounds longitude    56.2036    -3.1318: ['CA', 'V8L 0C6', 'Sidney', 'British Columbia', '02', '', '', '', '', '56.2036', '-3.1318', '6']
out of bounds longitude    48.3213    18.0486: ['CA', 'R1A 2H7', 'Selkirk', 'Manitoba', '03', '', '', '', '', '48.3213', '18.0486', '6']
out of bounds longitude    50.3902    -3.9204: ['CA', 'R3W 0L5', 'Winnipeg', 'Manitoba', '03', '', '', '', '', '50.3902', '-3.9204', '6']
out of bounds longitude    48.4419   -44.3716: ['CA', 'R3X 0R1', 'Winnipeg', 'Manitoba', '03', '', '', '', '', '48.4419', '-44.3716', '6']
out of bounds longitude    49.7795   -43.6869: ['CA', 'R3Y 0Z6', 'Winnipeg', 'Manitoba', '03', '', '', '', '', '49.7795', '-43.6869', '6']
out of bounds longitude    51.4966   -49.5836: ['CA', 'R5G 2P2', 'Steinbach', 'Manitoba', '03', '', '', '', '', '51.4966', '-49.5836', '6']
out of bounds latitude     41.2521   -72.0321: ['CA', 'R5T 0B8', 'Navin', 'Manitoba', '03', '', '', '', '', '41.2521', '-72.0321', '6']
out of bounds latitude     41.0553   -81.7115: ['CA', 'R5T 0J9', 'Navin', 'Manitoba', '03', '', '', '', '', '41.0553', '-81.7115', '6']
out of bounds latitude      41.038   -85.2266: ['CA', 'E3E 0G6', 'Hanwell', 'New Brunswick', '04', '', '', '', '', '41.038', '-85.2266', '6']
out of bounds latitude     41.4691   -84.5078: ['CA', 'E3L 0G6', 'Valley Road', 'New Brunswick', '04', '', '', '', '', '41.4691', '-84.5078', '6']
out of bounds longitude    43.9493     4.8055: ['CA', 'E4K 0C2', 'Memramcook', 'New Brunswick', '04', '', '', '', '', '43.9493', '4.8055', '6']
out of bounds longitude    43.9493     4.8055: ['CA', 'E4K 0C3', 'Memramcook', 'New Brunswick', '04', '', '', '', '', '43.9493', '4.8055', '6']
out of bounds longitude       49.8     5.5376: ['CA', 'E4S 0K3', 'Saint-Norbert', 'New Brunswick', '04', '', '', '', '', '49.8', '5.5376', '6']
out of bounds longitude    51.7061    -8.5225: ['CA', 'B3G 0H2', 'Eastern Passage', 'Nova Scotia', '07', '', '', '', '', '51.7061', '-8.5225', '6']
out of bounds longitude    49.0637   -41.6462: ['CA', 'K2J 6T8', 'Nepean', 'Ontario', '08', '', '', '', '', '49.0637', '-41.6462', '6']
out of bounds longitude    49.0637   -41.6462: ['CA', 'K2J 6T9', 'Nepean', 'Ontario', '08', '', '', '', '', '49.0637', '-41.6462', '6']
out of bounds longitude    49.0637   -41.6462: ['CA', 'K2J 6V1', 'Nepean', 'Ontario', '08', '', '', '', '', '49.0637', '-41.6462', '6']
out of bounds longitude      50.69   -30.1148: ['CA', 'K2J 6V4', 'Nepean', 'Ontario', '08', '', '', '', '', '50.69', '-30.1148', '6']
out of bounds longitude    48.4052    -37.871: ['CA', 'K2S 2N5', 'Stittsville', 'Ontario', '08', '', '', '', '', '48.4052', '-37.871', '6']
out of bounds longitude     47.743   -36.2784: ['CA', 'K4M 0M7', 'Manotick', 'Ontario', '08', '', '', '', '', '47.743', '-36.2784', '6']
out of bounds longitude    48.5659   -37.9988: ['CA', 'K4M 0N2', 'Manotick', 'Ontario', '08', '', '', '', '', '48.5659', '-37.9988', '6']
out of bounds longitude    47.4531   -50.5735: ['CA', 'K4M 0N3', 'Manotick', 'Ontario', '08', '', '', '', '', '47.4531', '-50.5735', '6']
out of bounds longitude    47.1591   -52.3361: ['CA', 'K9H 0J8', 'Peterborough', 'Ontario', '08', '', '', '', '', '47.1591', '-52.3361', '6']
out of bounds longitude    48.5842   -39.3443: ['CA', 'K9H 0K1', 'Peterborough', 'Ontario', '08', '', '', '', '', '48.5842', '-39.3443', '6']
out of bounds longitude    44.0372    -33.559: ['CA', 'K9J 0H2', 'Peterborough', 'Ontario', '08', '', '', '', '', '44.0372', '-33.559', '6']
out of bounds longitude    44.1276   -48.4973: ['CA', 'K9J 0H7', 'Peterborough', 'Ontario', '08', '', '', '', '', '44.1276', '-48.4973', '6']
out of bounds longitude    44.0372    -33.559: ['CA', 'K9J 0H8', 'Peterborough', 'Ontario', '08', '', '', '', '', '44.0372', '-33.559', '6']
out of bounds longitude    44.1281   -48.4964: ['CA', 'K9J 0H9', 'Peterborough', 'Ontario', '08', '', '', '', '', '44.1281', '-48.4964', '6']
out of bounds longitude    49.1736   -39.8137: ['CA', 'L1P 0G3', 'Whitby', 'Ontario', '08', '', '', '', '', '49.1736', '-39.8137', '6']
out of bounds longitude    49.1736   -39.8137: ['CA', 'L1P 0G4', 'Whitby', 'Ontario', '08', '', '', '', '', '49.1736', '-39.8137', '6']
out of bounds longitude    47.7299   -39.3622: ['CA', 'L1P 0J1', 'Whitby', 'Ontario', '08', '', '', '', '', '47.7299', '-39.3622', '6']
out of bounds longitude     46.451   -52.5671: ['CA', 'L1P 0J2', 'Whitby', 'Ontario', '08', '', '', '', '', '46.451', '-52.5671', '6']
out of bounds longitude    47.7299   -39.3622: ['CA', 'L1P 0J3', 'Whitby', 'Ontario', '08', '', '', '', '', '47.7299', '-39.3622', '6']
out of bounds longitude    43.9022    33.1079: ['CA', 'L1P 0J7', 'Whitby', 'Ontario', '08', '', '', '', '', '43.9022', '33.1079', '6']
out of bounds longitude    43.9008    33.1045: ['CA', 'L1P 0J9', 'Whitby', 'Ontario', '08', '', '', '', '', '43.9008', '33.1045', '6']
out of bounds longitude    50.9864   -29.0509: ['CA', 'L3Y 0E1', 'Newmarket', 'Ontario', '08', '', '', '', '', '50.9864', '-29.0509', '6']
out of bounds longitude    48.9898   -41.2175: ['CA', 'L3Y 0E3', 'Newmarket', 'Ontario', '08', '', '', '', '', '48.9898', '-41.2175', '6']
out of bounds longitude    48.9898   -41.2175: ['CA', 'L3Y 0E4', 'Newmarket', 'Ontario', '08', '', '', '', '', '48.9898', '-41.2175', '6']
out of bounds longitude    43.8503   174.9244: ['CA', 'L4C 5T1', 'Richmond Hill', 'Ontario', '08', '', '', '', '', '43.8503', '174.9244', '6']
out of bounds longitude    57.8386    -5.2127: ['CA', 'L4H 4R9', 'Woodbridge', 'Ontario', '08', '', '', '', '', '57.8386', '-5.2127', '6']
out of bounds longitude    44.2065    -2.4022: ['CA', 'L4P 0J5', 'Keswick', 'Ontario', '08', '', '', '', '', '44.2065', '-2.4022', '6']
out of bounds longitude    47.4584   -40.9279: ['CA', 'L4P 0K3', 'Keswick', 'Ontario', '08', '', '', '', '', '47.4584', '-40.9279', '6']
out of bounds longitude    43.9048   -21.6644: ['CA', 'L4S 0K5', 'Richmond Hill', 'Ontario', '08', '', '', '', '', '43.9048', '-21.6644', '6']
out of bounds longitude    43.5715    -0.2307: ['CA', 'L5G 0C3', 'Mississauga', 'Ontario', '08', '', '', '', '', '43.5715', '-0.2307', '6']
out of bounds longitude     47.945   -37.4976: ['CA', 'L6C 0Z1', 'Markham', 'Ontario', '08', '', '', '', '', '47.945', '-37.4976', '6']
out of bounds longitude    43.9101   -26.2726: ['CA', 'L6C 0Z2', 'Markham', 'Ontario', '08', '', '', '', '', '43.9101', '-26.2726', '6']
out of bounds longitude    43.9088     1.6305: ['CA', 'L6C 0Z3', 'Markham', 'Ontario', '08', '', '', '', '', '43.9088', '1.6305', '6']
out of bounds longitude    43.8879    17.5161: ['CA', 'L6E 0V4', 'Markham', 'Ontario', '08', '', '', '', '', '43.8879', '17.5161', '6']
out of bounds longitude    47.8086   -40.8947: ['CA', 'L7A 4Z7', 'Brampton', 'Ontario', '08', '', '', '', '', '47.8086', '-40.8947', '6']
out of bounds longitude    43.6904   153.2919: ['CA', 'L7A 5A1', 'Brampton', 'Ontario', '08', '', '', '', '', '43.6904', '153.2919', '6']
out of bounds longitude    43.8521    -27.205: ['CA', 'L7K 2R6', 'Alton', 'Ontario', '08', '', '', '', '', '43.8521', '-27.205', '6']
out of bounds longitude    61.1541  -150.0381: ['CA', 'L9N 0W6', 'Holland Landing', 'Ontario', '08', '', '', '', '', '61.1541', '-150.0381', '6']
out of bounds longitude    53.3498    -6.2603: ['CA', 'L9T 9B5', 'Milton', 'Ontario', '08', '', '', '', '', '53.3498', '-6.2603', '6']
out of bounds longitude    53.3498    -6.2603: ['CA', 'L9T 9B6', 'Milton', 'Ontario', '08', '', '', '', '', '53.3498', '-6.2603', '6']
out of bounds longitude    43.8759   152.9618: ['CA', 'L9W 7R1', 'Grand Valley', 'Ontario', '08', '', '', '', '', '43.8759', '152.9618', '6']
out of bounds longitude    50.6158   -41.6769: ['CA', 'M1C 0E9', 'Scarborough', 'Ontario', '08', '', '', '', '', '50.6158', '-41.6769', '6']
out of bounds longitude    42.9062     2.7723: ['CA', 'N1A 0B5', 'Dunnville', 'Ontario', '08', '', '', '', '', '42.9062', '2.7723', '6']
out of bounds longitude     52.136    -0.4667: ['CA', 'N1E 0P3', 'Guelph', 'Ontario', '08', '', '', '', '', '52.136', '-0.4667', '6']
out of bounds longitude     46.938   -40.7715: ['CA', 'N3R 0C1', 'Brantford', 'Ontario', '08', '', '', '', '', '46.938', '-40.7715', '6']
out of bounds longitude    48.8998    -42.185: ['CA', 'N3W 0E5', 'Caledonia', 'Ontario', '08', '', '', '', '', '48.8998', '-42.185', '6']
out of bounds latitude     41.2193   -73.1547: ['CA', 'N5A 0E9', 'Stratford', 'Ontario', '08', '', '', '', '', '41.2193', '-73.1547', '6']
out of bounds longitude    51.4853    -0.0771: ['CA', 'N6G 0T4', 'London', 'Ontario', '08', '', '', '', '', '51.4853', '-0.0771', '6']
out of bounds longitude     51.515     0.0268: ['CA', 'N6G 0T5', 'London', 'Ontario', '08', '', '', '', '', '51.515', '0.0268', '6']
out of bounds longitude    54.4429    -6.4176: ['CA', 'C1B 4C4', 'Stratford', 'Prince Edward Island', '09', '', '', '', '', '54.4429', '-6.4176', '6']
out of bounds longitude    46.7352   -47.8891: ['CA', 'J1N 1C9', 'Sherbrooke', 'Quebec', '10', '', '', '', '', '46.7352', '-47.8891', '6']
out of bounds longitude    45.8072     5.7913: ['CA', 'J7C 3J2', 'Blainville', 'Quebec', '10', '', '', '', '', '45.8072', '5.7913', '6']
out of bounds longitude    52.0599    -9.5044: ['CA', 'J8E 0R8', 'Mont-Tremblant', 'Quebec', '10', '', '', '', '', '52.0599', '-9.5044', '6']
out of bounds longitude    48.8612     2.3582: ['CA', 'J8G 0G4', 'Brownsburg-Chatham', 'Quebec', '10', '', '', '', '', '48.8612', '2.3582', '6']
out of bounds longitude    48.8606     2.3681: ['CA', 'J8H 0S1', 'Lachute', 'Quebec', '10', '', '', '', '', '48.8606', '2.3681', '6']
out of bounds longitude    50.9513     1.8587: ['CA', 'J9B 0E8', 'Chelsea', 'Quebec', '10', '', '', '', '', '50.9513', '1.8587', '6']
out of bounds longitude    53.5511     9.9937: ['CA', 'J9J 4J6', 'Gatineau', 'Quebec', '10', '', '', '', '', '53.5511', '9.9937', '6']
out of bounds longitude    53.5511     9.9937: ['CA', 'J9J 4K1', 'Gatineau', 'Quebec', '10', '', '', '', '', '53.5511', '9.9937', '6']
out of bounds longitude    53.5511     9.9937: ['CA', 'J9J 4K2', 'Gatineau', 'Quebec', '10', '', '', '', '', '53.5511', '9.9937', '6']
out of bounds longitude    53.5511     9.9937: ['CA', 'J9J 4K3', 'Gatineau', 'Quebec', '10', '', '', '', '', '53.5511', '9.9937', '6']
out of bounds longitude    53.5511     9.9937: ['CA', 'J9J 4K7', 'Gatineau', 'Quebec', '10', '', '', '', '', '53.5511', '9.9937', '6']

Looking at the first coordinate, 54.2338, -1.3414 it's in the United Kingdom https://www.openstreetmap.org/search?query=54.2338%2C%20-1.3414

It would be even better to use a shapefile of Canada to validate that each lat,long pair is within Canada and not in the ocean or America.

Boris Verkhovskiy

unread,
Mar 1, 2021, 4:04:32 PMMar 1
to geon...@googlegroups.com
2 FSA codes in CA.txt are incorrectly called "Notre-Dame-de-GrÔce"
instead of "Notre-Dame-de-Grâce"

$ grep Ô CA.txt
CA H4A Notre-Dame-de-GrÔce Northeast Quebec QC Notre-Dame-de-GrÔce
45.4717 -73.6149 1
CA H4B Notre-Dame-de-GrÔce Southwest Quebec QC Notre-Dame-de-GrÔce
45.4604 -73.6303 1
> --
> You received this message because you are subscribed to a topic in the Google Groups "GeoNames" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/geonames/wDWE29lwYho/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to geonames+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/geonames/90fbb7d6-0e62-4605-b6a4-48a7eb868e5an%40googlegroups.com.

Boris Verkhovskiy

unread,
Mar 1, 2021, 4:15:56 PMMar 1
to geon...@googlegroups.com
Also, the L0V doesn't seem to be a real postal code, there's a
Westminster Abbey in London, UK but I don't think there's a
Westminster Abbey in London, Ontario, Canada.

CA L0V Westminster Abbey Ontario ON 45.4689 -75.0079

Boris Verkhovskiy

unread,
Mar 3, 2021, 2:36:46 AMMar 3
to geon...@googlegroups.com
2 FSA codes in CA.txt have multiple entries

$ xsv select 2 -d'\t' CA.txt | sort | uniq -c | sort -n | tail -n 5
1 Y0A
1 Y0B
1 Y1A
2 C0A
4 L9X

$ xsv table -d'\t' CA.txt | grep L9X
CA L9X Midhurst

Ontario ON

44.4438 -79.7318 4
CA L9X Minesing

Ontario ON

44.4334 -79.833 4
CA L9X Springwater

Ontario ON

44.4954 -79.8503 4
CA L9X Barrie

Ontario ON

44.4001 -79.6663 4
$ xsv table -d'\t' CA.txt | grep C0A
CA C0A Kings and Queens counties (Elmira)

Prince Edward Island PE

46.1668 -62.6487 3
CA C0A Montague

Prince Edward Island PE

46.1668 -62.6487 4

In CA_full.txt there are a couple thousand duplicates:

$ xsv select 2 -d'\t' CA_full.txt | sort | uniq -c | sort -n | tail
5 C0A 1H3
5 C0A 1H6
5 J0T 1G0
5 N0H 2T0
6 K0L 2H0
8 B0P 1G0
9 B0N 1Y0
11 B0P 1V0
18 B0N 2J0
19 B0N 2H0

How should I interpret these duplicate entries? Shouldn't there be one
entry with multiple names e.g. "Calgary (Elbow Park / Britannia /
Parkhill / Mission)"?

Boris Verkhovskiy

unread,
Mar 3, 2021, 4:27:59 PMMar 3
to geon...@googlegroups.com
Ultimately, these issues are because postal code points are not visualized on the map on website, at least I couldn't find them with all layers enabled and I couldn't find a layer named postal codes. It would be really helpful to add them.
Reply all
Reply to author
Forward
0 new messages