holzschu / a-shell

A terminal for iOS, with multiple windows
BSD 3-Clause "New" or "Revised" License
2.7k stars 117 forks source link

GDAL library (a dependency of geopandas) is not installed and when try to install it gives error #685

Open Emasoft opened 1 year ago

Emasoft commented 1 year ago

I have an issue with geopandas, the library added in the last update of a-Shell. More precisely, I have an issue with its dependency Fiona, specifically the sub-dependency GDAL, needed to support the file formats, since I have many scripts that breaks because of it.

[~gis graphs]$ generate_bovini.py CATTLE.gpkg
Traceback (most recent call last):
  File "fiona/_shim.pyx", line 83, in fiona._shim.gdal_open_vector
  File "fiona/_err.pyx", line 291, in fiona._err.exc_wrap_pointer
fiona._err.CPLE_OpenFailedError: 'CATTLE.gpkg' not recognized as a supported file format.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/private/var/mobile/Library/Mobile Documents/iCloud~AsheKube~app~a-Shell/Documents/gis graphs/generate_bovini.py", line 125, in <module>
    main()
  File "/private/var/mobile/Library/Mobile Documents/iCloud~AsheKube~app~a-Shell/Documents/gis graphs/generate_bovini.py", line 113, in main
    plot_livestock_category(args.input_file, 'INP_N_BOVINI', 'Bovini (Cattle)', args.min_color, args.max_color, args.point_diameter, args.geometries_color, args.width_pixels, args.geometries_line_width, args.svg)
  File "/private/var/mobile/Library/Mobile Documents/iCloud~AsheKube~app~a-Shell/Documents/gis graphs/generate_bovini.py", line 48, in plot_livestock_category
    data = gpd.read_file(input_file)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/site-packages/geopandas/io/file.py", line 259, in _read_file
    return _read_file_fiona(
           ^^^^^^^^^^^^^^^^^
  File "/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/site-packages/geopandas/io/file.py", line 303, in _read_file_fiona
    with reader(path_or_bytes, **kwargs) as features:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/containers/Bundle/Application/876
21026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/
lib/python3.11/site-packages/Fiona-1.8.22-py3.11-macos
x-11.5-x86_64.egg/fiona/env.py", line 408, in wrapper
  File "/private/var/containers/Bundle/Application/876
21026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/
lib/python3.11/site-packages/Fiona-1.8.22-py3.11-macos
x-11.5-x86_64.egg/fiona/__init__.py", line 264, in ope
n
  File "/private/var/containers/Bundle/Application/876
21026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/
lib/python3.11/site-packages/Fiona-1.8.22-py3.11-macos
x-11.5-x86_64.egg/fiona/collection.py", line 162, in _
_init__
  File "fiona/ogrext.pyx", line 540, in fiona.ogrext.S
ession.start
  File "fiona/_shim.pyx", line 90, in fiona._shim.gdal
_open_vector
fiona.errors.DriverError: 'CATTLE.gpkg' not recognized
 as a supported file format.

On my other PC at home the GPKG file format is perfectly supported. Then I need to check if the fiona package installed with a-Shell does support it. I checked and the results are these:

[~/Documents]$ python
Python 3.11.0 (heads/3.11-dirty:2af28c9018, Apr 23 2023, 19:57:14) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>> import fiona
>>> print(fiona.supported_drivers)

{'DXF': 'rw', 
'CSV': 'raw', 
'OpenFileGDB': 'r', 
'ESRIJSON': 'r',
'ESRI Shapefile': 'raw',
'FlatGeobuf': 'rw',
'GeoJSON': 'raw',
'GeoJSONSeq': 'rw', 
'GML': 'rw',
'OGR_GMT': 'rw',
'GPX': 'rw',
'Idrisi': 'r', 
'MapInfo File': 'raw',
'DGN': 'raw',
'PCIDSK': 'raw',
'OGR_PDS': 'r',
'S57': 'r',
'TopoJSON': 'r'}
>>> 

It appears that the Geopackage format (GPKG) is not listed among the supported drivers on a-Shell. This is likely the cause of the error. On my PC at home I get the list and the GPKG file format is included:

>>> import fiona
>>> print(fiona.supported_drivers)

{'ARCGEN': 'r',
 'DXF': 'rw',
 'CSV': 'raw',
 'OpenFileGDB': 'r',
 'ESRIJSON': 'r',
 'ESRI Shapefile': 'raw',
 'FlatGeobuf': 'rw',
 'GeoJSON': 'raw',
 'GeoJSONSeq': 'rw',
 'GPKG': 'raw',
 'GML': 'rw',
 'OGR_GMT': 'rw',
 'GPX': 'rw',
 'GPSTrackMaker': 'rw',
 'Idrisi': 'r',
 'MapInfo File': 'raw',
 'DGN': 'raw',
 'OGR_PDS': 'r',
 'S57': 'r',
 'SQLite': 'raw',
 'TopoJSON': 'r'}

So I need to ensure that I have an updated GDAL version that supports Geopackage (.gpkg) file format and that the associated drivers are correctly installed on a-Shell. So I started checking the gdal-config, but I got this:

[~/Documents]$ gdal-config --version
gdal-config: command not found
[~/Documents]$ gdal-config --help
gdal-config: command not found

The environment path variable doesn't seem the issue, since when I try to search the gdal-config in a-Shell, it does not exist. Then I supposed that GDAL is not installed or is an old version. So I tried to install it, but I get the following error:

[~/Documents]$ pip -v install gdal
Using pip 23.1.1 from /private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/site-packages/pip (python 3.11)
Defaulting to user installation because normal site-packages is not writeable
Collecting gdal
  Using cached GDAL-3.7.1.1.tar.gz (776 kB)
  Running command python setup.py egg_info
  running egg_info
  creating /private/var/mobile/Containers/Data/Application/5896FDC4-A93C-4F95-B6E0-41EAF01171C3/tmp/pip-pip-egg-info-s2zwzpsl/GDAL.egg-info
  writing /private/var/mobile/Containers/Data/Application/5896FDC4-A93C-4F95-B6E0-41EAF01171C3/tmp/pip-pip-egg-info-s2zwzpsl/GDAL.egg-info/PKG-INFO
  writing dependency_links to /private/var/mobile/Containers/Data/Application/5896FDC4-A93C-4F95-B6E0-41EAF01171C3/tmp/pip-pip-egg-info-s2zwzpsl/GDAL.egg-info/dependency_links.txt
  writing requirements to /private/var/mobile/Containers/Data/Application/5896FDC4-A93C-4F95-B6E0-41EAF01171C3/tmp/pip-pip-egg-info-s2zwzpsl/GDAL.egg-info/requires.txt
  writing top-level names to /private/var/mobile/Containers/Data/Application/5896FDC4-A93C-4F95-B6E0-41EAF01171C3/tmp/pip-pip-egg-info-s2zwzpsl/GDAL.egg-info/top_level.txt
  writing manifest file '/private/var/mobile/Containers/Data/Application/5896FDC4-A93C-4F95-B6E0-41EAF01171C3/tmp/pip-pip-egg-info-s2zwzpsl/GDAL.egg-info/SOURCES.txt'
  gdal-config: command not found
  gdal-config: command not found
  listing git files failed - pretending there aren't any
  reading manifest file '/private/var/mobile/Containers/Data/Application/5896FDC4-A93C-4F95-B6E0-41EAF01171C3/tmp/pip-pip-egg-info-s2zwzpsl/GDAL.egg-info/SOURCES.txt'
  writing manifest file '/private/var/mobile/Containers/Data/Application/5896FDC4-A93C-4F95-B6E0-41EAF01171C3/tmp/pip-pip-egg-info-s2zwzpsl/GDAL.egg-info/SOURCES.txt'
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: gdal
  Running command python setup.py bdist_wheel
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-13.2-arm64-cpython-311
  creating build/lib.macosx-13.2-arm64-cpython-311/osgeo
  copying osgeo/gnm.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo
  copying osgeo/__init__.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo
  copying osgeo/gdalnumeric.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo
  copying osgeo/osr.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo
  copying osgeo/gdal.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo
  copying osgeo/ogr.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo
  copying osgeo/gdal_array.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo
  copying osgeo/gdalconst.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo
  creating build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/gdal_pansharpen.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/gdal_proximity.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/gdal_merge.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/gdal_retile.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/gdal_polygonize.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/ogr_layer_algebra.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/gdal_calc.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/pct2rgb.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/gdal2xyz.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/__init__.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/gdal_sieve.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/gdal_fillnodata.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/gdalmove.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/gdal_edit.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/ogrmerge.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/rgb2pct.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/gdal2tiles.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/gdalcompare.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  copying gdal-utils/osgeo_utils/gdalattachpct.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils
  creating build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/tile_extent_from_raster.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gcps2wld.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gcps2vec.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdal2grd.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdal_create_pdf.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/hsv_merge.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/tigerpoly.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/tolatlong.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/make_fuzzer_friendly_archive.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdal_rm.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/dump_jp2.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/jpeg_in_tiff_extract.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/crs2crs2grid.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdal_ls.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/validate_gpkg.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/ogr2vrt.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdal_cp.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/vec_tr.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdalchksum.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdal_remove_towgs84.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdal_lut.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/classify.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/wcs_virtds_params.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/ogr_build_junction_table.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdal_rmdir.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/get_soundg.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdalimport.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/mkgraticule.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/val_repl.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/__init__.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/magphase.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/fix_gpkg.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdal_zip.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/ogrupdate.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/loslas2ntv2.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/build_jp2_from_xml.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/load2odbc.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdal_vrtmerge.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdalident.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/esri2wkt.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gcps2ogr.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/assemblepoly.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/validate_jp2.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/validate_cloud_optimized_geotiff.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/densify.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/epsg_tr.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdal_mkdir.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/vec_tr_spat.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/fft.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdallocationinfo.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdalcopyproj.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/histrep.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/ogr_dispatch.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/ogrinfo.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdalinfo.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/rel.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdalfilter.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/gdal_auth.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  copying gdal-utils/osgeo_utils/samples/ogr2ogr.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/samples
  creating build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  copying gdal-utils/osgeo_utils/auxiliary/osr_util.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  copying gdal-utils/osgeo_utils/auxiliary/color_palette.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  copying gdal-utils/osgeo_utils/auxiliary/util.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  copying gdal-utils/osgeo_utils/auxiliary/numpy_util.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  copying gdal-utils/osgeo_utils/auxiliary/__init__.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  copying gdal-utils/osgeo_utils/auxiliary/batch_creator.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  copying gdal-utils/osgeo_utils/auxiliary/gdal_argparse.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  copying gdal-utils/osgeo_utils/auxiliary/color_table.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  copying gdal-utils/osgeo_utils/auxiliary/rectangle.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  copying gdal-utils/osgeo_utils/auxiliary/progress.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  copying gdal-utils/osgeo_utils/auxiliary/extent_util.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  copying gdal-utils/osgeo_utils/auxiliary/raster_creation.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  copying gdal-utils/osgeo_utils/auxiliary/base.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  copying gdal-utils/osgeo_utils/auxiliary/array_util.py -> build/lib.macosx-13.2-arm64-cpython-311/osgeo_utils/auxiliary
  running build_ext
  gdal-config: command not found
  gdal-config: command not found
  clang -Wsign-compare -Wunreachable-code -DNDEBUG -O3 -Wall -miphoneos-version-min=14.0 -I/Users/holzschu/src/Xcode_iPad/a-Shell/cpython/Frameworks_iphoneos/include -I/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/include/python3.11 -I/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/site-packages/numpy/core/include -Iinclude -c gdal_python_cxx11_test.cpp -o gdal_python_cxx11_test.o
  clang: warning: argument unused during compilation: '-miphoneos-version-min=14.0' [-Wunused-command-line-argument]
  error: [Errno 9] Bad file descriptor

So the version of GDAL is not installable and not upgradeable. Any idea?

Emasoft commented 1 year ago

Apparently there is a switch to enable the inclusion of GPKG driver in GDAL when building from sources: https://gdal.org/development/building_from_source.html#selection-of-drivers

OGR_ENABLE_DRIVER_GPKG

And there is another switch to include all optional drivers support.

add these options to the initial cmake command:
 -DGDAL_BUILD_OPTIONAL_DRIVERS=ON
 -DOGR_BUILD_OPTIONAL_DRIVERS=ON

Do not know if this is relevant.

holzschu commented 1 year ago

Hi, thanks for the detailed description. As you found out, GDAL is included with a-Shell, but not the GPKG driver. It makes sense that you cannot install it yourself (remember, only pure-Python packages can be installed by the user, nothing that requires compilation).

I'll have a look at enabling the GPKG driver, but there is a sentence in the GDAL building instructions that makes me wonder: "By default, all drivers that have their build requirements satisfied will be built-in in the GDAL core library."

Looking further, GPKG is indeed enabled by default, but requires the sqlite3 library, which is not currently cross-compiled.

Emasoft commented 1 year ago

This means that we cannot read GPKG files in a-Shell? Geopackage is the only (good) free and opensource geographical data format. What a pity. But I understand that this is a minor niche. Other popular projects need priority.

holzschu commented 1 year ago

Actually, I found out that sqlite3 is part of the standard SDK but for some reasons the GDAL building script did not find it automatically. With a bit of help, it's now fixed. It will be in the next version.

Emasoft commented 1 year ago

GREAT! You are the best! 🎉👍