Specification of Raster data based on JSON

This page describes the specification of JSON based format for general raster data.

Properties

type
Always has string literal "raster".
transform
Has parameters to georeference as array. The array must have 6 elements and all elements must be number.
data_types
Has array of string literal which show data type. Size of the array must equal to band count of this raster.
crs (OPTIONAL)
Has string literal which shows coordinate Reference System ID.
nodata_values (OPTIONAL)
Has array pf NODATA value. If this array is available (not null), size of the array must be equal to band count of this raster.
values
Has raster data itself. This must be 3-d array. Arguments are orderd by band number, row and column.

Decision of cell count

  • Band count must be decided by size of data_types array.
  • Row count must be decided by size of values[0] (2d array).
  • Column count must be decided by size of values[0][0] (1d array).

transform array

Coordinate system of rasters

Usually, coordinate system of rasters is as following.

Affine transformation

Affine transformation is used to map the raster to the geospatial coordinate system. In other words, it is used to transformed from raster coordinate system to the geospatial coordinate system.

Affine transformation is written as following.

ux = a11 * cx + a12 * cy + b1
uy = a21 * cx + a22 * cy + b2

Where cx and cy are row and column index (starting with 0) of the raster, ux and uy are position of the left-top corner on the geospatial coordinate system.

Following figure shows mapped raster.

Note that Y-axis of geospatial coordinate system is upward where one of raster coordinate system is downward. Therefore, a22 is usually negative.

"transform" property (1d array) represents as following (Equivalant to ST_Affine()).

[a11, a12, a21, a22, b1, b2]

Difference from othe format or library

Worldfile

  • Order of affine transform parameter is a11, a21, a12, a22, b1, b2.
  • ux, uy means the location of the center of the mesh.

GDAL (ex GDALDataset::GetGeoTransform())

  • Order of affine transform parameter is b1, a11, a12, b2, a21, a22.

Others

type property position on the data
Some programs reads a small chunk of data to decide what format the data is. "type": "raster" part should be available within 50 charasters from the starting.
values property should be latter
values property has large array literal. values property should be latter.

Samples

1 band

{
  "type": "raster",
  "transform": [1,0,0,-1,135,35],
  "crs": "EPSG:4612",
  "nodata_values": [11],
  "data_types": ["float32"],
  "values": [
    [
      [11, 12, 13],
      [14, 15, 16]
    ]
  ]
}

3 bands

{
  "type": "raster",
  "transform": [1.11111111000000e-4,0.00000000000000e+0,0.00000000000000e+0,-1.11111111000000e-4,1.34995333333335e+2,3.50016666666580e+1],
  "crs": "EPSG:3857",
  "nodata_values": [11,12,11],
  "data_types": ["int32", "int32", "int32"],
  "values": [
    [
      [11, 12, 13],
      [14, 15, 16]
    ],
      [
      [11, 12, 13],
      [14, 15, 16]
    ],
      [
      [11, 12, 13],
      [14, 15, 16]
    ]
  ]
}
  • This application uses Fundamental Geospatial Data published by The Geospatial Information Authority of Japan (GSI) with its approval under the article 30 of The Survey Act. (Approval Number ZYOU-SHI No.340 2015)
  • A part of this service is a result of SIP (Cross-ministerial Strategic Innovation Promotion Program), Agro-Innovation.

About | What is New | Site Map | Inquiry

HTTP | HTTPS

National Agriculture and Food Research Organization