*
* PostGIS Raster loader
* http://trac.osgeo.org/postgis/wiki/WKTRaster
*
* Copyright 2001-2003 Refractions Research Inc.
* Copyright 2009 Paul Ramsey <pramsey@cleverelephant.ca>
* Copyright 2009 Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
* Copyright (C) 2011 Regents of the University of California
* <bkpark@ucdavis.edu>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifdef ENABLE_NLS
#include <libintl.h>
#include <locale.h>
#define _(String) gettext(String)
#define PACKAGE "raster2pgsql"
#else
#define _(String) String
#endif
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "librtcore.h"
#include "../../postgis_config.h"
#include "../raster_config.h"
#define CSEQUAL(a,b) (strcmp(a,b)==0)
max length of of "name" data type in PostgreSQL as
defined in pg_config_manual.h as macro NAMEDATALEN
default is 64 bytes (63 usable characters plus NULL)
*/
#define MAXNAMELEN 63
#define MINOVFACTOR 2
#define MAXOVFACTOR 1000
maximum tile size
based upon maximum field size as defined for PostgreSQl
http://www.postgresql.org/about/
1 GB = 1024 x 1024 x 1024
*/
#define MAXTILESIZE 1073741824
#define RCSID "$Id$"
typedef struct raster_loader_config {
uint32_t rt_file_count;
char **rt_file;
char **rt_filename;
char *schema;
char *table;
char *raster_column;
int file_column;
char *file_column_name;
uint32_t overview_count;
int *overview;
char **overview_table;
int quoteident;
int32_t srid;
int out_srid;
int *nband;
uint32_t nband_count;
int tile_size[2];
int pad_tile;
int outdb;
char opt;
int idx;
int maintenance;
int constraints;
int max_extent;
int regular_blocking;
char *tablespace;
char *idx_tablespace;
int hasnodata;
double nodataval;
int skip_nodataval_check;
int endian;
int version;
int transaction;
int copy_statements;
} RTLOADERCFG;
typedef struct rasterinfo_t {
int32_t srid;
char *srs;
uint32_t dim[2];
int *nband;
uint32_t nband_count;
GDALDataType *gdalbandtype;
rt_pixtype *bandtype;
int *hasnodata;
double *nodataval;
double gt[6];
int tile_size[2];
} RASTERINFO;
typedef struct stringbuffer_t {
uint32_t length;
char **line;
} STRINGBUFFER;