Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more geospatial files. #686

Merged
merged 1 commit into from
Nov 19, 2021
Merged

Support more geospatial files. #686

merged 1 commit into from
Nov 19, 2021

Conversation

manthey
Copy link
Member

@manthey manthey commented Nov 18, 2021

There are files that have coordinates in lat/lon but no listed projection.

Closes #676.

There are files that have coordinates in lat/lon but no listed
projection.
@banesullivan
Copy link
Contributor

This still isn't working for the specific data that I have

@manthey manthey requested a review from banesullivan November 18, 2021 19:47
@banesullivan
Copy link
Contributor

I'm seeing segfaults....

(large_image_dev) ➜  large_image git:(more-geospatial) python
Python 3.8.12 | packaged by conda-forge | (default, Sep 16 2021, 01:59:00)
[Clang 11.1.0 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import large_image
>>> large_image.__file__
'/Users/bane/Software/kw/large_image/large_image/__init__.py'
>>> large_image.open('/Users/bane/Software/OASIS/data/og_Data_scripts_Sept2021/PRISM_PPT/2017/PRISM_PPT_20170714.tif')
Created LRU Cache for 'tilesource' with 81 maximum size
TIFFReadDirectory: Warning, Unknown field with tag 42113 (0xa481) encountered.
[1]    7133 segmentation fault  python

@manthey
Copy link
Member Author

manthey commented Nov 18, 2021

This still isn't working for the specific data that I have

It works for the sample file you shared privately. There is a structurally similar file here: https://data.kitware.com/api/v1/file/61969eb32fa25629b9f3638b/download

@banesullivan
Copy link
Contributor

I'm getting segfaults for that file as well so something is probably wrong with my local installation. I'll investigate this soon here

@manthey
Copy link
Member Author

manthey commented Nov 18, 2021

I'm seeing segfaults....

(large_image_dev) ➜  large_image git:(more-geospatial) python
Python 3.8.12 | packaged by conda-forge | (default, Sep 16 2021, 01:59:00)
[Clang 11.1.0 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import large_image
>>> large_image.__file__
'/Users/bane/Software/kw/large_image/large_image/__init__.py'
>>> large_image.open('/Users/bane/Software/OASIS/data/og_Data_scripts_Sept2021/PRISM_PPT/2017/PRISM_PPT_20170714.tif')
Created LRU Cache for 'tilesource' with 81 maximum size
TIFFReadDirectory: Warning, Unknown field with tag 42113 (0xa481) encountered.
[1]    7133 segmentation fault  python

Based on that segfault, it isn't trying to parse it as geospatial -- it is using some other tile source. What do you see with something like

import large_image

print(large_image.tilesource.isGeospatial(<path>))

@banesullivan
Copy link
Contributor

Same segfault

>>> import large_image
>>> p = '/Users/bane/Software/OASIS/data/og_Data_scripts_Sept2021/PRISM_PPT/2017/PRISM_PPT_20170714.tif'
>>> large_image.tilesource.isGeospatial(p)
TIFFReadDirectory: Warning, Unknown field with tag 42113 (0xa481) encountered.
[1]    13148 segmentation fault  python

@manthey
Copy link
Member Author

manthey commented Nov 19, 2021

Same segfault

>>> import large_image
>>> p = '/Users/bane/Software/OASIS/data/og_Data_scripts_Sept2021/PRISM_PPT/2017/PRISM_PPT_20170714.tif'
>>> large_image.tilesource.isGeospatial(p)
TIFFReadDirectory: Warning, Unknown field with tag 42113 (0xa481) encountered.
[1]    13148 segmentation fault  python

Odd -- what version of the GDAL wheel do you have installed?

@banesullivan
Copy link
Contributor

I was on 3.3.2 and so I reinstalled to 3.4.0 it's working now... 🤷🏻‍♂️

@manthey
Copy link
Member Author

manthey commented Nov 19, 2021

I was on 3.3.2 and so I reinstalled to 3.4.0 it's working now... 🤷🏻‍♂️

Were you importing any other libraries before large_image (this may or may not be germane, since the problem might occur even without such an import)? There was a curious issue with importing torch before gdal, which turned out that one of libraries that we were building for GDAL happened to use -ftls-model=initial-exec which exhausted some local resource for static thread local storage which caused a failed import. In other bug reports on this topic it causes segfaults.

@manthey manthey merged commit 47d5166 into master Nov 19, 2021
@manthey manthey deleted the more-geospatial branch November 19, 2021 15:22
@banesullivan
Copy link
Contributor

Were you importing any other libraries before large_image

Nope, just large_image. I think I had a mismatch of versions between my python gdal bindings and the gdal binaries (on Mac so I can't use the large_image_wheels)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rasters with just GeoTransform are not handled
2 participants