An Emscripten port of GDAL 2.1.
npm install gdal-js
Caution! It is strongly recommended to run this code inside of a web worker.
To see complete examples for how to do this, checkout the examples
directory.
From simplest to most complex, these are:
inspect_geotiff
map_extent
thumbnail
thumbnail_map
tile_tiff
If you want to use GDAL from within a Node application, you are probably looking for https://www.npmjs.com/package/gdal.
This library exports the following GDAL functions:
- CSLCount
- GDALSetCacheMax
- GDALAllRegister
- GDALOpen
- GDALOpenEx
- GDALClose
- GDALGetDriverByName
- GDALCreate
- GDALCreateCopy
- GDALGetRasterXSize
- GDALGetRasterYSize
- GDALGetRasterCount
- GDALGetRasterDataType
- GDALGetRasterBand
- GDALGetRasterStatistics
- GDALGetRasterMinimum
- GDALGetRasterMaximum
- GDALGetRasterNoDataValue
- GDALGetProjectionRef
- GDALSetProjection
- GDALGetGeoTransform
- GDALSetGeoTransform
- OSRNewSpatialReference
- OSRDestroySpatialReference
- OSRImportFromEPSG
- OCTNewCoordinateTransformation
- OCTDestroyCoordinateTransformation
- OCTTransform
- GDALCreateGenImgProjTransformer
- GDALDestroyGenImgProjTransformer
- GDALGenImgProjTransform
- GDALDestroyGenImgProjTransformer
- GDALSuggestedWarpOutput
- GDALTranslate
- GDALTranslateOptionsNew
- GDALTranslateOptionsFree
- GDALWarpAppOptionsNew
- GDALWarpAppOptionsSetProgress
- GDALWarpAppOptionsFree
- GDALWarp
- GDALBuildVRTOptionsNew
- GDALBuildVRTOptionsFree
- GDALBuildVRT
- GDALReprojectImage
- CPLError
- CPLSetErrorHandler
- CPLQuietErrorHandler
- CPLErrorReset
- CPLGetLastErrorMsg
- CPLGetLastErrorNo
- CPLGetLastErrorType
- GDALRasterize
- GDALRasterizeOptionsNew
- GDALRasterizeOptionsFree
- GDALDEMProcessing
- GDALDEMProcessingOptionsNew
- GDALDEMProcessingOptionsFree
For documentation of these functions' behavior, please see the GDAL documentation
In order to limit build size, GDAL is currently built with support for GeoTIFFs and PNGs only.
- Install Docker
- Run
./scripts/setup
, which will build the Docker container. - Run
./scripts/make gdal
. The make script just callsmake
from inside the Docker container. ./scripts/make clean
works as expected.- To package up a release, run
./scripts/make VERSION=<number> release