All Projects → JuliaGeo → GDAL.jl

JuliaGeo / GDAL.jl

Licence: other
Thin Julia wrapper for GDAL - Geospatial Data Abstraction Library

Programming Languages

julia
2034 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to GDAL.jl

Shapefile.jl
Parsing .shp files in Julia
Stars: ✭ 40 (-48.72%)
Mutual labels:  vector, geo, geospatial, io
georaster-layer-for-leaflet
Display GeoTIFFs and soon other types of raster on your Leaflet Map
Stars: ✭ 168 (+115.38%)
Mutual labels:  satellite, geo, geospatial, raster
Geocube
Tool to convert geopandas vector data into rasterized xarray data.
Stars: ✭ 87 (+11.54%)
Mutual labels:  vector, geospatial, raster, gdal
GeoArrays.jl
Simple geographical raster interaction built on top of ArchGDAL, GDAL and CoordinateTransformations
Stars: ✭ 42 (-46.15%)
Mutual labels:  geo, raster, gdal, io
NetCDF.jl
NetCDF support for the julia programming language
Stars: ✭ 102 (+30.77%)
Mutual labels:  geo, geospatial, raster, io
GeoJSON.jl
Utilities for working with GeoJSON data in Julia
Stars: ✭ 46 (-41.03%)
Mutual labels:  vector, geo, geospatial, io
Python Geospatial
A collection of Python packages for geospatial analysis with binder-ready notebook examples
Stars: ✭ 187 (+139.74%)
Mutual labels:  vector, geospatial, raster
Earthenterprise
Google Earth Enterprise - Open Source
Stars: ✭ 2,425 (+3008.97%)
Mutual labels:  vector, raster, gdal
awesome-geospatial-list
A curated list of geospatial tools, data, tutorials, information, and more
Stars: ✭ 32 (-58.97%)
Mutual labels:  geospatial, raster, gdal
Geotiff.io
Static website for viewing and analyzing GeoTIFF's in the browser
Stars: ✭ 53 (-32.05%)
Mutual labels:  satellite, geospatial, raster
Geospatial Python CourseV1
This is an collection of blog posts turned into a course format
Stars: ✭ 53 (-32.05%)
Mutual labels:  vector, geospatial, raster
Rioxarray
geospatial xarray extension powered by rasterio
Stars: ✭ 148 (+89.74%)
Mutual labels:  geospatial, raster, gdal
Grass
GRASS GIS - free and open source Geographic Information System (GIS)
Stars: ✭ 281 (+260.26%)
Mutual labels:  vector, geospatial, raster
Rio Tiler
Rasterio plugin to create web map tiles from raster datasets.
Stars: ✭ 221 (+183.33%)
Mutual labels:  satellite, raster, gdal
Mapchete
Tile-based geodata processing using rasterio & Fiona
Stars: ✭ 129 (+65.38%)
Mutual labels:  vector, raster
Free Gophers Pack
✨ This pack of 100+ gopher pictures and elements will help you to build own design of almost anything related to Go Programming Language: presentations, posts in blogs or social media, courses, videos and many, many more.
Stars: ✭ 2,343 (+2903.85%)
Mutual labels:  vector, raster
Fiona
Fiona reads and writes geographic data files
Stars: ✭ 787 (+908.97%)
Mutual labels:  vector, gdal
Gdal
GDAL is an open source X/MIT licensed translator library for raster and vector geospatial data formats.
Stars: ✭ 2,797 (+3485.9%)
Mutual labels:  vector, raster
Earthpy
A package built to support working with spatial data using open source python
Stars: ✭ 236 (+202.56%)
Mutual labels:  vector, raster
krawler
A minimalist (geospatial) ETL
Stars: ✭ 51 (-34.62%)
Mutual labels:  geospatial, gdal

GDAL.jl

CI

Julia wrapper for GDAL - Geospatial Data Abstraction Library. This package is a binding to the C API of GDAL/OGR. It provides only a C style usage, where resources must be closed manually, and datasets are pointers.

Other packages can build on top of this to provide a more Julian user experience. See for example ArchGDAL.jl.

Most users will want to use ArchGDAL.jl instead of using GDAL.jl directly.

Installation

This package is registered, so add it using Pkg. This will also download GDAL binaries created in Yggdrasil.

pkg> add GDAL

To check if it is installed correctly, you could run the test suite with:

pkg> test GDAL

Documentation

Docstrings are automatically inserted from the GDAL documentation. Note that these are written for the C API, so function names and argument type names will differ.

julia> using GDAL

help?> GDAL.ogr_g_creategeometry
  OGR_G_CreateGeometry(OGRwkbGeometryType eGeometryType) -> OGRGeometryH

  Create an empty geometry of desired type.

  Parameters
  ––––––––––––

    •    eGeometryType: the type code of the geometry to be created.

  Returns
  –––––––––

  handle to the newly create geometry or NULL on failure. Should be freed with OGRGDestroyGeometry() after use.

Further usage documentation is not yet available, but the files test/tutorial_raster.jl and test/tutorial_vector.jl should provide a good hint based on the API tutorials from GDAL.org.

The bulk of this package is generated automatically by the scripts under gen/.

Using the GDAL and OGR utilities

The provided GDAL installation also contains the commonly used utilities such as gdal_translate and ogr2ogr. They can be called from Julia like so:

using GDAL

# list information about a raster dataset
GDAL.gdalinfo_path() do gdalinfo
    run(`$gdalinfo path/to/raster-file`)
end

# convert raster data between different formats
GDAL.gdal_translate_path() do gdal_translate
    run(`$gdal_translate -of COG input.asc output.tif`)
end

# list information about an OGR-supported data source
GDAL.ogrinfo_path() do ogrinfo
    run(`$ogrinfo path/to/vector-file`)
end

# convert simple features data between file formats
GDAL.ogr2ogr_path() do ogr2ogr
    run(`$ogr2ogr -f FlatGeobuf output.fgb input.shp`)
end

The GDAL.<util>_path are defined in the GDAL_jll package. If you only wish to run the utilities, that package will have all you need. A list of the available utilities can be found here. Documentation for them is available on gdal.org/programs. Note that programs implemented in python (ending in .py) are not available, since those would require a python installations.

Since GDAL 2.1's RFC59.1 most utilities are also available as functions in the library, they are implemented here and tested here. If these are used you can avoid the need for calling the binaries.

If you want to use these utilities from outside julia, note that this will not work unless you set two things:

  1. The environment variable GDAL_DATA must be set to the value returned in julia by GDAL.GDAL_DATA[].
  2. Julia's Sys.BINDIR must be in your path.

Inside of julia (2) is always the case, and (1) happens on loading the GDAL module, in its __init__ function.

Missing driver to support a format

If you get an error such as the one below:

GDALError (CE_Failure, code 6):
    The <...> driver needs to be compiled to support <...>

This means that the GDAL binaries you are using, which normally come from the Yggdrasil community build tree, are not compiled with support for the format or feature you need. GDAL is a large library with many optional dependencies which allow support for more formats. Currently the amount of formats supported is still limited, but will grow over time. Lists of available formats can be found here for rasters and here for vectors. If you need support for another format, consider making an issue in this repository. Many formats need external libraries as added dependencies. This means an Yggdrasil build also needs to be available for that library, and added as a dependency. See issue #65 for a discussion on which new drivers should be prioritized.

In general GDAL format support will be the same across platforms. HDF5 and netCDF are the exception to this rule, since they are only available on the major platforms for now.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].