OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.75k stars 2.5k forks source link

OGR Drivers are not enabled #4648

Closed marcus-elia closed 2 years ago

marcus-elia commented 2 years ago

I have a working solution for my situation, so this is not time-sensitive.

Expected behavior and actual behavior.

In GDAL-3.3.0, I am having this problem. But in GDAL-2.4.3, it works.

I expected that calling GDALAllRegister(); would register the ESRI Shapefile driver, but it does not. The #ifdef SHAPE_ENABLED in OGRRegisterAllInternal() is evaluating to false, and so it is not calling RegisterOGRShape();. In fact, it seems that nothing is being registered inside of OGRRegisterAllInternal(). (I am manually calling RegisterOGRShape() in my own application, so I don't need help).

When I ran the configuration script, I did not disable any drivers.

Steps to reproduce the problem.

Zipped_shx_file.zip As an example, running ogrinfo on the attached .shx file yields

FAILURE:                                                                                                                                                               
 Unable to open datasource `/tmp/geo_export_32d3155b-b53a-4101-9a52-b8d7f4e529e1.shx' with the following drivers.                                                          
-> ESRIC                                                                                                                                                                
-> PCIDSK                                                                                                                                                               
-> PDS4                                                                                                                                                                
-> VICAR                                                                                                                                                                
-> JP2OpenJPEG                                                                                                                                                          
-> PDF                                                                                                                                                                 
-> MBTiles                                                                                                                                                              
-> BAG                                                                                                                                                                 
 -> EEDA                                                                                                                                                                
 -> OGCAPI                                                                                                                                                               
-> HTTP

whereas on GDAL-2.4.3 I get

INFO: Open of `/tmp/geo_export_32d3155b-b53a-4101-9a52-b8d7f4e529e1.shx'                                                      
using driver `ESRI Shapefile' successful.                                                                         
1: geo_export_32d3155b-b53a-4101-9a52-b8d7f4e529e1 (Polygon)

Operating system

Ubuntu 18.04.2 LTS

GDAL version and provenance

GDAL-3.3.0 is not working, GDAL-2.4.3 is working.

rouault commented 2 years ago

When I ran the configuration script, I did not disable any drivers.

thre must be something particular or wrong in the way you built GDAL. You should provide precise way to reproduce this

marcus-elia commented 2 years ago

I did wget "http://download.osgeo.org/gdal/3.3.0/gdal-3.3.0.tar.gz tar -xzf gdal-3.3.0.tar.gz In order to link with the specific version of Proj that I wanted, I added the lines -Wl,-rpath,<path to Proj>/lib \ -Wl,--disable-new-dtags \ to line 79 of GNUmakefile and then ran ./configure --prefix=<install path> --with-proj=<path to Proj> --with-python=<path to python> make CXXFLAGS="-Og -g" CFLAGS="-Og -g" all -j4 sudo make install

rouault commented 2 years ago

are you sure you didn't made other changes to GDAL source tree ? What is the output of ./configure ? If you did several consecutive builds, make sure to run "make clean" before rebuilding. If that still persists, if you could put together a simple Dockerfile that would reproduce the issue that would be even better

marcus-elia commented 2 years ago

I did run make clean before building.

Near the end of the output of ./configure is

misc. ogr formats:         
arcgen avc cad csv dgn dxf edigeo flatgeobuf geoconcept georss gml gmt gpsbabel gpx gtm 
jml mapml mvt ntf openfilegdb pgdump rec s57 selafin shape svg sxf tiger vdv wasp idrisi pds 
sdts amigocloud carto cloudant couchdb csw elastic ngw plscenes wfs gpkg vfk osm ods xlsx lvbag                                                                                                                                                                                                         
disabled gdal formats:                                                                                                                                                  
disabled ogr formats:

I can look into putting together a Dockerfile.

rouault commented 2 years ago

Closing. Too particular use case specific to autoconf builds, that eventually will be discontinued