Git Product home page Git Product logo

gdal.netcore's Introduction

gdal.netcore Mentioned in Awesome Geospatial Packages CI

A simple (as is) build engine of GDAL 3.3.3 library for .NET Core.

Packages

NuGet: MaxRev.Gdal.Core

NuGet: MaxRev.Gdal.LinuxRuntime.Minimal

NuGet: MaxRev.Gdal.WindowsRuntime.Minimal

Table Of Contents

Table of contents generated with markdown-toc

About this library

What is this library

  • 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

What is not

  • 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.

How to use

  1. Install core package - MaxRev.Gdal.Core
Install-Package MaxRev.Gdal.Core
  1. 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
  1. 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();
  1. Profit! Use it in ordinary flow

How to compile on Windows

Enter win directory to find out how.

How to compile on Unix

Detailed guide is here - unix.

About build configuration

Current version targets GDAL 3.3.3 with minimal drivers

Drivers included PROJ(7.2.1), 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.

Building runtime libraries

Current version is targeting GDAL 3.3.3 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.

Building Nuget Packages

Prerequisites

  1. Install .NET Core SDK (3.1 or 6.0) and Nuget.exe - for building and publishing packages
  2. You have already built everything

Packaging

  1. 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-6.0
  1. And then just
make pack

FAQ

Q: Missing {some} drivers, can you add more?

A: Feel free to contribute and I will help you you to add them. Here's the my additional answer.

Q: GDAL functions are not working as expected

A: Try to search an issue on github. In 98% cases, I'm sure they are working fine.

Q: Some types throw exceptions from SWIG on Windows

A: Yes, currently there are some redundant types in OGR namespace. This will be fixed in the next builds.

Q: Can't compile on Windows

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.

Q: Can I compile it on Ubuntu or another Unix-based system?

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)

Q: In some methods performance is slower on Unix

A: Use of older version of GLIBC might be a reason. But It's not a fault of build engine.

Q: OSGeo.OGR.SpatialReference throws System.EntryPointNotFoundException exception

A: That's a problem with swig bindings. Please, use SpatialReference type from OSR namespace. More info here and here.

About and Contacts

based on https://github.com/OSGeo/gdal && https://github.com/jgoday/gdal

Contact me: Telegram - MaxRev

Enjoy!

gdal.netcore's People

Contributors

maxrev-dev avatar bjornharrtell avatar anton-petrov avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.