Skip to content

RL2_CreateRasterCoverage

Mark Johnson edited this page Oct 6, 2018 · 8 revisions

Loading a RasterLite2 Image from a Geo-Referenced File

--> 'List of Sql-Commands'

<-- 'Index Page for RasterLite2 - Commands'


Original Documentation RasterLite2 SQL functions - reference list)

  • RL2_CreateRasterCoverage(text coverage, text sample_type, text pixel_type, int num_bands, text compression, int quality, int tile_width, int tile_height, int srid, double horz_res , double vert_res, BLOB no_data, int strict_resolution, int mixed_resolutions, int section_paths, int section_md5, int section_summary)

Parameters [optional parameters]:

  • coverage: chosen name of raster_coverage
  • sample_type:
  • pixel_type:
  • num_bands:
  • compression:
  • quality:
  • tile_width:
  • tile_height:
  • horz_res: the resolution to store the image in the database
    • when vert_res is NOT used
      • this will also be used a the vertical (y) resolution
    • use the gdalinfo first ** Pixel size** value
Pixel Size = (0.542863255657581,-0.542863255657581)
  • [vert_res]:
    • use the gdalinfo second ** Pixel size** value
      • the value must be positive (0.542863255657581)
Pixel Size = (0.542863255657581,-0.542863255657581)
  • [no_data]: set the non-default nodata values for the bands
    • how this BLOB is to created is unknown
UPDATE raster_coverages SET nodata_pixel = RL2_SetPixelValue(nodata_pixel,0,192) WHERE coverage_name = '1750.berlin_schmettau';
UPDATE raster_coverages SET nodata_pixel = RL2_SetPixelValue(nodata_pixel,1,192) WHERE coverage_name = '1750.berlin_schmettau';
UPDATE raster_coverages SET nodata_pixel = RL2_SetPixelValue(nodata_pixel,2,192) WHERE coverage_name = '1750.berlin_schmettau';
  • [strict_resolution]: 0=no, 1=yes
  • [mixed_resolutions]:0=no, 1=yes
    • when using 'RL2_LoadRaster'
      • this should always be 0
    • when using 'RL2_LoadRasterFromdir'
      • this can be 0
        • when all of the Images have the same resolution
          • which is often not the case
      • this must be 1
        • when not all of the Images have the same resolution
  • [section_paths]:
  • [section_md5]:
  • [section_summarys]:

  • Sample for a GeoTiff
    • where the x/horizontal and y/vertical resolution are the same
SELECT RL2_CreateRasterCoverage
(
 -- chosen name of raster_coverage
 '1750.berlin_schmettau', 
 -- Data-Type of Image
 'UINT8', 
 -- Image-Type of Image
 'RGB', 
 -- Amount of Bands in the Image
 3, 
 -- chosen Compression to be used
 'JPEG', 
 -- quality, only used for JPEG
 80, 
 -- tile-size-x (to be stored in database)
 512, 
 -- tile-size-y (to be stored in database)
 512, 
 -- srid of Image being read
 3068, 
 -- Resolution / Pixel size.x/y  (horizontal/vertical)
 0.538783180039355 
);
  • Sample for a GeoTiff
    • where the x/horizontal and y/vertical resolution are different
SELECT RL2_CreateRasterCoverage
(
 -- chosen name of raster_coverage
 '1926.berlin_eiskeller', 
 -- Data-Type of Image
 'UINT8', 
 -- Image-Type of Image
 'RGB', 
 -- Amount of Bands in the Image
 3, 
 -- chosen Compression to be used
 'JPEG', 
 -- quality, only used for JPEG
 80, 
 -- tile-size-x (to be stored in database)
 512, 
 -- tile-size-y (to be stored in database)
 512, 
 -- srid of Image being read
 3068, 
 -- Resolution / Pixel size.x (horizontal)
 0.613093934749288, 
 -- Resolution / Pixel size.y (vertical)
 0.613014775227916 
);
-- sqlite3_step() error: INSERT INTO raster_coverages "insert on raster_coverages violates constraint: invalid nodata_pixel"

2015-08-30: Mark Johnson, Berlin Germany


Clone this wiki locally