Skip to content
This is an Emscripten port of GDAL, an open source X/MIT licensed translator library for raster and vector geospatial data formats.
C++ C Python HTML Java Shell Other
Branch: develop-js
Clone or download
Pull request Compare This branch is 28295 commits ahead, 38260 commits behind OSGeo:master.
Latest commit f57305e Aug 20, 2018

README.md

GDAL JS

An Emscripten port of GDAL 2.1.

Usage

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:

  1. inspect_geotiff
  2. map_extent
  3. thumbnail
  4. thumbnail_map
  5. 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
  • 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

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.

Developing

  1. Install Docker
  2. Run ./scripts/setup, which will build the Docker container.
  3. Run ./scripts/make gdal. The make script just calls make from inside the Docker container.
  4. ./scripts/make clean works as expected.
  5. To package up a release, run ./scripts/make VERSION=<number> release
You can’t perform that action at this time.