A simple (as is) build engine of GDAL 3.2 library for .NET Core.
NuGet: MaxRev.Gdal.Core
NuGet: MaxRev.Gdal.LinuxRuntime.Minimal
NuGet: MaxRev.Gdal.WindowsRuntime.Minimal
- gdal.netcore
- Packages
- Table Of Contents
- About this library
- How to use
- How to compile on Windows
- How to compile on Unix
- About build configuration
- Building runtime libraries
- Building Nuget Packages
- FAQ
- Q: Missing {some} drivers, can you add more?
- Q: GDAL functions are not working as expected
- Q: Some types throw exceptions from SWIG on Windows
- Q: Can't compile on Windows
- Q: Can I compile it on Ubuntu or another Unix-based system?
- Q: In some methods performance is slower on Unix
- Q: OSGeo.OGR.SpatialReference throws System.EntryPointNotFoundException exception
- About and Contacts
Table of contents generated with markdown-toc
- Only generates assemblies and binds everything into one package.
- Provides easy access to GDAL by installing only core and runtime package
- DOES NOT require installation of GDAL
- Does not compile all drivers. Only configured, they are listed below. By default GDAL has a lot of internal drivers.
- Does not change GDAL source code.
- Does not extend GDAL methods.
- Install core package - MaxRev.Gdal.Core
Install-Package MaxRev.Gdal.Core
- Install libraries for your runtime. You can install one of them or both with no conflicts.
Install-Package MaxRev.Gdal.WindowsRuntime.Minimal
Install-Package MaxRev.Gdal.LinuxRuntime.Minimal
- Initialize libraries in runtime
using MaxRev.Gdal.Core;
...
// call it once, before using GDAL
// this will initialize all GDAL drivers and set PROJ6 shared library paths
GdalBase.ConfigureAll();
- Profit! Use it in ordinary flow
Enter win directory to find out how.
Detailed guide is here - unix.
Current version targets GDAL 3.2.0 with minimal drivers
Drivers included PROJ(7.2.0), SQLITE3, GEOS(3.9.0), HDF4, HDF5, GEOTIFF, JPEG, PNG, LIBZ, LERC, CURL
Configure summary of current version
GDAL is now configured for x86_64-pc-linux-gnu
Installation directory: /mnt/e/dev/builds/gdal-netcore/build-unix/gdal-build
C compiler: gcc -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -fPIC -fvisibility=hidden
C++ compiler: g++ -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2 -fvisibility=hidden
C++14 support: no
LIBTOOL support: yes
LIBZ support: internal
LIBLZMA support: no
ZSTD support: no
cryptopp support: no
crypto/openssl support: no
GRASS support: no
CFITSIO support: no
PCRaster support: no
LIBPNG support: internal
DDS support: no
GTA support: no
LIBTIFF support: internal (BigTIFF=yes)
LIBGEOTIFF support: internal
LIBJPEG support: internal
12 bit JPEG: yes
12 bit JPEG-in-TIFF: yes
LIBGIF support: no
JPEG-Lossless/CharLS: no
OGDI support: no
HDF4 support: yes
HDF5 support: yes
Kea support: no
NetCDF support: no
Kakadu support: no
JasPer support: no
OpenJPEG support: no
ECW support: no
MrSID support: no
MrSID/MG4 Lidar support: no
JP2Lura support: no
MSG support: no
EPSILON support: no
WebP support: no
cURL support (wms/wcs/...):yes
PostgreSQL support: no
LERC support: yes
MySQL support: no
Ingres support: no
Xerces-C support: no
Expat support: no
libxml2 support: no
Google libkml support: no
ODBC support: no
FGDB support: no
MDB support: no
PCIDSK support: no
OCI support: no
GEORASTER support: no
SDE support: no
Rasdaman support: no
DODS support: no
SQLite support: yes
PCRE support: no
SpatiaLite support: no
RasterLite2 support: no
Teigha (DWG and DGNv8): no
INFORMIX DataBlade support:no
GEOS support: yes
SFCGAL support: no
QHull support: no
Poppler support: no
Podofo support: no
PDFium support: no
OpenCL support: no
Armadillo support: no
FreeXL support: no
SOSI support: no
MongoDB support: no
MongoCXX v3 support: no
HDFS support: no
TileDB support: no
userfaultfd support: yes
misc. gdal formats: aaigrid adrg aigrid airsar arg blx bmp bsb cals ceos ceos2 coasp cosar ctg dimap dted e00grid elas envisat ers fit gff gsg gxf hf2 idrisi ignfheightasciigrid ilwis ingr iris iso8211 jaxapalsar jdem kmlsuperoverlay l1b leveller map mrf msgn ngsgeoid nitf northwood pds prf r raw rmf rs2 safe saga sdts sentinel2 sgi sigdem srtmhgt terragen til tsx usgsdem xpm xyz zmap rik ozi grib eeda plmosaic rda wcs wms wmts daas rasterlite mbtiles pdf
disabled gdal formats:
misc. ogr formats: aeronavfaa arcgen avc bna cad csv dgn dxf edigeo geoconcept georss gml gmt gpsbabel gpx gtm htf jml mvt ntf openair openfilegdb pgdump rec s57 segukooa segy selafin shape sua svg sxf tiger vdv wasp xplane idrisi pds sdts amigocloud carto cloudant couchdb csw elastic gft ngw plscenes wfs gpkg vfk osm
disabled ogr formats:
SWIG Bindings: no
PROJ >= 6: yes
enable GNM building: no
enable pthread support: yes
enable POSIX iconv support:yes
hide internal symbols: yes
NOTE: Windows and Linux drivers availability may differ, ask me of specific driver for runtime. Please issue, if I forgot to mention any other packages.
Current version is targeting GDAL 3.2.0 version. Each runtime has to be build separately, but this can be done concurrently as they are using different contexts (build folders). Main operating bindings (in gdalcore package) are build from linux.
To make everything work smoothly, each configuration targets same drivers and their versions respectively.
- After VCPKG integration finished, configuration is shared between runtimes -
shared/GdalCore.opt
- Overrides for
nmake.opt
on windows -win/presource/gdal-nmake.opt
- Patched makefile -
win/presource/gdal-makefile.vc
To build for a specific runtime, see the README.md in respective directory.
- Install .NET Core SDK (3.1 or 5.0) and Nuget.exe - for building and publishing packages
- You have already built everything
- I'm using CentOS 7 for example:
rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
sudo apt-get install apt-transport-https && apt-get update && apt-get install dotnet-sdk-5.0
- And then just
make pack
A: Feel free to contribute and I will help you you to add them. Here's the my additional answer.
A: Try to search an issue on github. In 98% cases, I'm sure they are working fine.
A: Yes, currently there are some redundant types in OGR namespace. This will be fixed in the next builds.
A: I've built it on my machine several times from scratch. Do you have installed all SDKs? If you know cmake or nmake you can help to port batch files that are buggy.
A: The main reason I'm compiling it on CentOS - glibc of version 2.17. It's the lowest version (in my opinion) that suits for all common systems (Ubuntu, Debian, Fedora)
A: Use of older version of GLIBC might be a reason. But It's not a fault of build engine.
A: That's a problem with swig bindings. Please, use SpatialReference type from OSR namespace. More info here and here.
based on https://github.com/OSGeo/gdal && https://github.com/jgoday/gdal
Contact me: Telegram - MaxRev
Enjoy!