Skip to content

boiledorange73/gdal_rasterjson

Repository files navigation

RasterJSON driver

GDAL driver for JSON based raw raster format.
Specification of the format is available
at http://aginfo.cgk.affrc.go.jp/rstprv/docs/rasterjson/ .


1. How to build

1-1. Build and install as a plugin (out-of-tree driver)
* This guide is valid only on UNIX (like) system.

1-1-1. Set PATH to gdal-config
  % setenv PATH "${PATH}:(path to gdal-config)"
1-1-2. Compile as following:
  % c++ -fPIC -shared RasterJSON.cpp -o gdal_RasterJSON.so `gdal-config --cflags` `gdal-config --libs` -I./jsonpull/src
1-1-3. Install gdal_RasterJSON.so to plugin directory as following:
  % cp gdal_RasterJSON.so "`gdal-config --prefix`/lib/gdalplugins"

1-2. Build with patches
1-2-1. Copy all
  % mkdir $(GDAL)/frmts/rasterjson
  % cp -r * $(GDAL)/frmts/rasterjson/
  % cd $(GDAL)/frmts/rasterjson
1-2-2. Apply patches.
  % patch < gdalallregister.cpp.patch
  % patch < gdal_frmts.h.patch
  % patch < configure.in.patch
  Note: Paths in patch files are relative.
  Run patch in $(GDAL)/frmts/rasterjson/
1-2-3. Recreates the configure script file.
  % cd $(GDAL)
  % ./autogen.sh
  (REMEMBER RUN autogen.sh)

1-3. Buil without patch
1-3-1. Copy all
  % mkdir $(GDAL)/frmts/rasterjson
  % cp -r * $(GDAL)/frmts/rasterjson/
1-3-2. Edit gdalallregister.cpp
  % vi $(GDAL)/frmts/gdalallregister.cpp
  --
  GDALAllRegister()
  ...
  #ifdef FRMT_rasterjson
      GDALRegister_RasterJSON();
  #endif
  ...
  --
1-3-3. Edit gdal_frmts.h
  % vi $(GDAL)/gcore/gdal_frmts.h
  --
  CPL_C_START
  ...
  void CPL_DLL GDALRegister_RasterJSON(void);
  ...
  CPL_C_END
  --
1-3-4. Edit configure
  --
  OPT_GDAL_FORMATS=rasterjson
  --
  (DO NOT RUN autogen.sh)

2. GDAL Options
  GDAL supports "-co" option to pass the format specific parameters.
  RasterJSON format supports some parameters.

2-1. PRECISION (integer)
  Specifies digits of fraction. 14 by default.

2-2. F_FORMAT (boolean)
  If "true", uses "%f" instead of "%e" format for band value (NOT transform values).
  This affects only if band value is floating point number.
  "false" by default.

About

GDAL driver for JSON based raw raster

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published