Places/Map: Handle edge-case geolocations (e.g., North Pole) #2482

Open
opened 2026-02-20 01:12:17 -05:00 by deekerman · 5 comments
Owner

Originally created by @schorschebob on GitHub (Feb 9, 2026).

Originally assigned to: @schorschebob on GitHub.

Before You Continue

  • This is a new, confirmed bug that has not yet been reported or documented

What Is Not Working as Documented?

Dear PhotoPrism Team,

As part of a research expedition, I spent a long time traveling to and around the North Pole. During this time, many photos were taken with a wide variety of cameras — from professional SLR cameras used by journalists to normal smartphone cameras.

After importing these images into PhotoPrism, no photos appear in the Places tab. The log contains the following warnings, among others:

time="2026-02-09T00:11:37Z" level=warning msg="photo: unknown cell id for lat 90.000003, lng 21.600621 (uid pt6aw2bvwgpaept9)"

To me, this looks very much like IEEE-754 floating point precision issues (latitude slightly > 90°).
I can manually correct the affected photos, after which everything works again for the time being. However, after a few days, similar errors occur again, presumably because other photos are used for the initial display in the Places tab.

A possible robust solution would be to intercept such edge cases on the server side, e.g., by limiting the coordinates:
Latitude: min(photo.lat, 90)
corresponding to 180° for longitude as well, if necessary.
This would reliably neutralize incorrect floating-point rounding.

Thank you very much for your work on PhotoPrism and for checking this edge case.

Best regards

How Can We Reproduce It?

1. Upload photos with latitude slightly >90
2. Select places tab
3. See that no images are shown

What Behavior Do You Expect?

To see the photos on the map/globe.

What Could Be the Cause?

To me, this looks very much like IEEE-754 floating point precision issues (latitude slightly > 90°).
I can manually correct the affected photos, after which everything works again for the time being. However, after a few days, similar errors occur again, presumably because other photos are used for the initial display in the Places tab.

A possible robust solution would be to intercept such edge cases on the server side, e.g., by limiting the coordinates:
Latitude: min(photo.lat, 90)
corresponding to 180° for longitude as well, if necessary.
This would reliably neutralize incorrect floating-point rounding.

Logs, Sample Files, or Screenshots

time="2026-02-09T00:11:37Z" level=warning msg="photo: unknown cell id for lat 90.000003, lng 21.600621 (uid pt6aw2bvwgpaept9)"
time="2026-02-09T00:11:37Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9695"
time="2026-02-09T00:11:37Z" level=warning msg="photo: unknown cell id for lat 90.000000, lng 22.326028 (uid pt6aw2k3wvbaigks)"
time="2026-02-09T00:11:38Z" level=warning msg="photo: unknown cell id for lat 90.000008, lng 22.648037 (uid pt6aw2xy64aczavb)"
time="2026-02-09T00:11:38Z" level=warning msg="photo: unknown cell id for lat 90.000004, lng 22.867187 (uid pt6aw32yz2p0wjid)"
time="2026-02-09T00:11:38Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9703"
time="2026-02-09T00:11:38Z" level=warning msg="photo: unknown cell id for lat 90.000013, lng 23.702374 (uid pt6aw38hbuot46h7)"
time="2026-02-09T00:11:38Z" level=warning msg="photo: unknown cell id for lat 90.000001, lng 28.979410 (uid pt6aw3ad8nf0b6kw)"
time="2026-02-09T00:11:38Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9706"
time="2026-02-09T00:11:38Z" level=warning msg="photo: unknown cell id for lat 90.000009, lng 31.887611 (uid pt6aw3l6btonl6jr)"
time="2026-02-09T00:11:39Z" level=warning msg="photo: unknown cell id for lat 90.000010, lng 30.922330 (uid pt6aw3yx0e2wdmd6)"
time="2026-02-09T00:11:39Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9714"
time="2026-02-09T00:11:39Z" level=warning msg="photo: unknown cell id for lat 90.000005, lng 30.709739 (uid pt6aw44ysdyqmow5)"
time="2026-02-09T00:11:39Z" level=warning msg="photo: unknown cell id for lat 90.000011, lng 29.378754 (uid pt6aw47q9v3ur7xa)"
time="2026-02-09T00:11:39Z" level=warning msg="photo: unknown cell id for lat 90.000015, lng 21.658572 (uid pt6aw4nf4fhvafg0)"
time="2026-02-09T00:11:39Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9725"
time="2026-02-09T00:11:39Z" level=warning msg="photo: unknown cell id for lat 90.000019, lng 21.566040 (uid pt6aw4v5ub4pfzb3)"
time="2026-02-09T00:11:39Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9727"
time="2026-02-09T00:11:40Z" level=warning msg="photo: unknown cell id for lat 90.000009, lng 12.823077 (uid pt6aw5ho1umgohmg)"
time="2026-02-09T00:11:40Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9736"
time="2026-02-09T00:11:41Z" level=warning msg="photo: unknown cell id for lat 90.000017, lng 13.449190 (uid pt6aw69pu5tkudjt)"
time="2026-02-09T00:11:41Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9746"

Which Software Versions Do You Use?

Serverside (dockerized):
 - ProtoPrism CE - Build 251130-b3068414c
 - MariaDB Server 1:11.8.5+maria~ubu2404

Clientside:
 - Windows 11
 - Firefox 147.0.3 (64-bit)
 - Chrome 144.0.7559.133 (64-bit)
 - But several different smartphones with different browserapps as well (iPhone, Samsung, Google Pixel)

On What Device Is PhotoPrism Installed?

- QNAP TS-253A NAS running Unraid v7.2.3
- Intel® Celeron® CPU N3160 @ 1.60GHz 
- 16 GiB DDR3
- 2x Seagate IronWolf Pro 8TB HDD (ST8000NT001)

Do You Use a Reverse Proxy, Firewall, VPN, or CDN?

traefik v3.2

Originally created by @schorschebob on GitHub (Feb 9, 2026). Originally assigned to: @schorschebob on GitHub. ### Before You Continue - [x] This is a new, confirmed bug that has not yet been reported or documented ### What Is Not Working as Documented? Dear PhotoPrism Team, As part of a research expedition, I spent a long time traveling to and around the North Pole. During this time, many photos were taken with a wide variety of cameras — from professional SLR cameras used by journalists to normal smartphone cameras. After importing these images into PhotoPrism, no photos appear in the Places tab. The log contains the following warnings, among others: ``` time="2026-02-09T00:11:37Z" level=warning msg="photo: unknown cell id for lat 90.000003, lng 21.600621 (uid pt6aw2bvwgpaept9)" ``` To me, this looks very much like IEEE-754 floating point precision issues (latitude slightly > 90°). I can manually correct the affected photos, after which everything works again for the time being. However, after a few days, similar errors occur again, presumably because other photos are used for the initial display in the Places tab. A possible robust solution would be to intercept such edge cases on the server side, e.g., by limiting the coordinates: Latitude: `min(photo.lat, 90)` corresponding to 180° for longitude as well, if necessary. This would reliably neutralize incorrect floating-point rounding. Thank you very much for your work on PhotoPrism and for checking this edge case. Best regards ### How Can We Reproduce It? ```markdown 1. Upload photos with latitude slightly >90 2. Select places tab 3. See that no images are shown ``` ### What Behavior Do You Expect? To see the photos on the map/globe. ### What Could Be the Cause? To me, this looks very much like IEEE-754 floating point precision issues (latitude slightly > 90°). I can manually correct the affected photos, after which everything works again for the time being. However, after a few days, similar errors occur again, presumably because other photos are used for the initial display in the Places tab. A possible robust solution would be to intercept such edge cases on the server side, e.g., by limiting the coordinates: Latitude: min(photo.lat, 90) corresponding to 180° for longitude as well, if necessary. This would reliably neutralize incorrect floating-point rounding. ### Logs, Sample Files, or Screenshots time="2026-02-09T00:11:37Z" level=warning msg="photo: unknown cell id for lat 90.000003, lng 21.600621 (uid pt6aw2bvwgpaept9)" time="2026-02-09T00:11:37Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9695" time="2026-02-09T00:11:37Z" level=warning msg="photo: unknown cell id for lat 90.000000, lng 22.326028 (uid pt6aw2k3wvbaigks)" time="2026-02-09T00:11:38Z" level=warning msg="photo: unknown cell id for lat 90.000008, lng 22.648037 (uid pt6aw2xy64aczavb)" time="2026-02-09T00:11:38Z" level=warning msg="photo: unknown cell id for lat 90.000004, lng 22.867187 (uid pt6aw32yz2p0wjid)" time="2026-02-09T00:11:38Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9703" time="2026-02-09T00:11:38Z" level=warning msg="photo: unknown cell id for lat 90.000013, lng 23.702374 (uid pt6aw38hbuot46h7)" time="2026-02-09T00:11:38Z" level=warning msg="photo: unknown cell id for lat 90.000001, lng 28.979410 (uid pt6aw3ad8nf0b6kw)" time="2026-02-09T00:11:38Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9706" time="2026-02-09T00:11:38Z" level=warning msg="photo: unknown cell id for lat 90.000009, lng 31.887611 (uid pt6aw3l6btonl6jr)" time="2026-02-09T00:11:39Z" level=warning msg="photo: unknown cell id for lat 90.000010, lng 30.922330 (uid pt6aw3yx0e2wdmd6)" time="2026-02-09T00:11:39Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9714" time="2026-02-09T00:11:39Z" level=warning msg="photo: unknown cell id for lat 90.000005, lng 30.709739 (uid pt6aw44ysdyqmow5)" time="2026-02-09T00:11:39Z" level=warning msg="photo: unknown cell id for lat 90.000011, lng 29.378754 (uid pt6aw47q9v3ur7xa)" time="2026-02-09T00:11:39Z" level=warning msg="photo: unknown cell id for lat 90.000015, lng 21.658572 (uid pt6aw4nf4fhvafg0)" time="2026-02-09T00:11:39Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9725" time="2026-02-09T00:11:39Z" level=warning msg="photo: unknown cell id for lat 90.000019, lng 21.566040 (uid pt6aw4v5ub4pfzb3)" time="2026-02-09T00:11:39Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9727" time="2026-02-09T00:11:40Z" level=warning msg="photo: unknown cell id for lat 90.000009, lng 12.823077 (uid pt6aw5ho1umgohmg)" time="2026-02-09T00:11:40Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9736" time="2026-02-09T00:11:41Z" level=warning msg="photo: unknown cell id for lat 90.000017, lng 13.449190 (uid pt6aw69pu5tkudjt)" time="2026-02-09T00:11:41Z" level=info msg="photo: removed 1 location label from MOSAiC_Mario/BlackWhite/DSCF9746" ### Which Software Versions Do You Use? ```markdown Serverside (dockerized): - ProtoPrism CE - Build 251130-b3068414c - MariaDB Server 1:11.8.5+maria~ubu2404 Clientside: - Windows 11 - Firefox 147.0.3 (64-bit) - Chrome 144.0.7559.133 (64-bit) - But several different smartphones with different browserapps as well (iPhone, Samsung, Google Pixel) ``` ### On What Device Is PhotoPrism Installed? ```markdown - QNAP TS-253A NAS running Unraid v7.2.3 - Intel® Celeron® CPU N3160 @ 1.60GHz - 16 GiB DDR3 - 2x Seagate IronWolf Pro 8TB HDD (ST8000NT001) ``` ### Do You Use a Reverse Proxy, Firewall, VPN, or CDN? traefik v3.2
Author
Owner

@lastzero commented on GitHub (Feb 9, 2026):

Thanks for your report! If you haven't done so yet, could you provide us with a few file samples for testing? See https://www.photoprism.app/contact#file-samples

@lastzero commented on GitHub (Feb 9, 2026): Thanks for your report! If you haven't done so yet, could you provide us with a few file samples for testing? See https://www.photoprism.app/contact#file-samples
Author
Owner

@schorschebob commented on GitHub (Feb 9, 2026):

Thanks for the quick response! I have sent you two sample images via wetransfer as the files are over 14MB each.

@schorschebob commented on GitHub (Feb 9, 2026): Thanks for the quick response! I have sent you two sample images via wetransfer as the files are over 14MB each.
Author
Owner

@lastzero commented on GitHub (Feb 10, 2026):

These changes provide a fix for edge-case GPS values with tiny floating-point overshoots (for example 90.000003 latitude). We now normalize minor overshoots at coordinate boundaries in a shared geo helper and use it consistently in both location updates and S2 token generation, so affected photos can appear correctly in Places/Map. Validation remains strict for clearly invalid large overshoots to avoid unwanted side effects.

An updated preview build will be available for testing soon:

@schorschebob Please let us know if it fixed your issues! :)

@lastzero commented on GitHub (Feb 10, 2026): These changes provide a fix for edge-case GPS values with tiny floating-point overshoots (for example 90.000003 latitude). We now normalize minor overshoots at coordinate boundaries in a shared geo helper and use it consistently in both location updates and S2 token generation, so affected photos can appear correctly in Places/Map. Validation remains strict for clearly invalid large overshoots to avoid unwanted side effects. An updated preview build will be available for testing soon: - https://docs.photoprism.app/getting-started/updates/#development-preview @schorschebob Please let us know if it fixed your issues! :)
Author
Owner

@lastzero commented on GitHub (Feb 11, 2026):

These additional changes provide an extra layer of protection for Google JSON sidecars. GPS coordinates are now clamped to valid ranges before being stored in metadata (lat: -90..90, lng: -180..180). This prevents invalid Google JSON values from propagating into Places/map rendering. We also added and updated tests for the clamp helper and Google JSON parsing. Although existing invalid coordinates in the database or from other metadata sources may still require cleanup, new Google JSON imports should no longer trigger this specific issue.

@lastzero commented on GitHub (Feb 11, 2026): These additional changes provide an extra layer of protection for Google JSON sidecars. GPS coordinates are now clamped to valid ranges before being stored in metadata (lat: -90..90, lng: -180..180). This prevents invalid Google JSON values from propagating into Places/map rendering. We also added and updated tests for the clamp helper and Google JSON parsing. Although existing invalid coordinates in the database or from other metadata sources may still require cleanup, new Google JSON imports should no longer trigger this specific issue.
Author
Owner

@schorschebob commented on GitHub (Feb 11, 2026):

It took a while because there were quite a few images that I had to reindex. Your adjustments had the desired effect, and the photos are now displayed correctly in the map view.

Thank you very much for your quick response!

@schorschebob commented on GitHub (Feb 11, 2026): It took a while because there were quite a few images that I had to reindex. Your adjustments had the desired effect, and the photos are now displayed correctly in the map view. Thank you very much for your quick response!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/photoprism#2482
No description provided.