ohmg-dev / OldInsuranceMaps

A public space for georeferencing historical fire insurance maps.
https://oldinsurancemaps.net
GNU General Public License v3.0
17 stars 2 forks source link

[Bug] Some preview tiles are not loading in georeferencer view #160

Open rchampine opened 8 months ago

rchampine commented 8 months ago

Some sheets in this Richmond volume fail to load. Toggling the preview setting does not solve the issue. Known sheets with this issue: https://oldinsurancemaps.net/georeference/7204/ https://oldinsurancemaps.net/georeference/7229/

Most sheets in the volume are behaving as expected.

Example screenshot: image

mradamcox commented 8 months ago

Did a little poking around right now, and all of the VRTs seem to exist and the source JPG does exist. Tried removing all GCPs one by one and then adding three back in, and still the same issue. There may be something strange with the underlying JPG. Will have to dig deeper when I can.

rchampine commented 8 months ago

Thanks for checking — no big rush on this.

rchampine commented 8 months ago

Checking back in on this — I think this sheet might have the same issue: https://oldinsurancemaps.net/resource/11565. There seems to be a pattern where this is happening to sheets that are being revisited via "edit georeferencing".

mradamcox commented 8 months ago

Ah, ok, I will look into this as soon as I can. Thanks for the extra info.

mradamcox commented 8 months ago

Strangely, all of these previews are showing up now as expected. We'll keep this ticket open in case the issue arises again. I think this rules out any issue with the underlying image file as suggested above.

rchampine commented 7 months ago

Adding another sheet that has been experiencing this bug for while: https://oldinsurancemaps.net/resource/12883

rchampine commented 7 months ago

Adding two more: https://oldinsurancemaps.net/resource/12087 and https://oldinsurancemaps.net/georeference/10933/ — I'm getting a sense from the students that they're usually seeing this issue at least once per session.

mradamcox commented 7 months ago

Sounds good, I should be able to figure this out this weekend.

mradamcox commented 7 months ago

No good resolution yet, but I think this stems from TiTiler, the dynamic tiling engine. Ultimately, just restarting the Titiler container seemed to solve the issue (at least temporarily).

For a bit more context: The tiles are generated through a set of virtual rasters (VRTs) that ultimately point back to the downloaded non-geospatial JPEG image. The chain looks like:

original JPEG -> VRT with GCPs embedded (created via GDAL Translate) -> Warped VRT (created with GDAL Warp)

The warped VRT is passed to TiTiler for tiling.

When the errors above occur, Titiler returns {"detail":"GDALWarpOptions.Validate(): hSrcDS is not set."}. I went through and ran gdalinfo on every file in the above chain, for a layer preview that worked and one that didn't work, and all outputs were effectively identical. I also tried deleting the VRTs (which are automatically regenerated whenever a GCP is created or modified) and that didn't help.

rchampine commented 7 months ago

Students have been reporting this bug way less but one instance happened today on Sacramento, Calif. | 1952 | Vol. 2 p171 [1]. The student thinks its related to trying to return to this sheet and revise the georeferencing points.

mradamcox commented 7 months ago

Ok, I've made a small change base on a hunch but can't do extensive testing right now. Let me know if the issue comes up again this week.

mradamcox commented 1 week ago

@rchampine Has this been happening within the last few months? I feel like there has been plenty of activity that we would know if it's been fixed or not (I haven't seen it but haven't been testing for it).