Statistics
| Revision:

gvsig-raster / org.gvsig.raster / trunk / org.gvsig.raster / org.gvsig.raster.lib / org.gvsig.raster.lib.api / src / main / java / org / gvsig / fmap / dal / coverage / RasterLibrary.java @ 859

History | View | Annotate | Download (4.92 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.fmap.dal.coverage;
23

    
24
import java.io.File;
25

    
26
import org.gvsig.tools.library.AbstractLibrary;
27
import org.gvsig.tools.library.LibraryException;
28
import org.gvsig.tools.locator.ReferenceNotRegisteredException;
29

    
30
/**
31
 * Library for API initialization and configuration.
32
 * 
33
 * @author gvSIG team
34
 * @version $Id$
35
 */
36
public class RasterLibrary extends AbstractLibrary {
37
        /**
38
         * Control de librer?a ya inicializada.
39
         */
40
        public static boolean       wakeup = false;
41
        
42
        /**
43
         * Scale for reading data in the statistics process
44
         */
45
        public static double        statisticsScale        = 0.5;
46

    
47
        /**
48
         * En la generaci?n autom?tica de clases esta variable representa el n?mero de
49
         * clases en las que se hace la divisi?n.
50
         */
51
        public static int          defaultNumberOfClasses = 64;
52

    
53
        /**
54
         * En la genraci?n de las paletas de color, esta variable representa el n?mero
55
         * de colores en las que se hace la divisi?n para generar la paleta nueva.
56
         * Con esto conseguimos velocidad de procesamiento. Cuanto menor sea, peor
57
         * ser? la calidad representada de la imagen.
58
         */
59
        public static int          defaultNumberOfColors = 256;
60
        /**
61
         * Tama?o de bloque en los procesos que recorren un raster completo a base de ventanas con recorrido
62
         * descendente. Esta variable indica la altura de dicho bloque. Por lo tanto cada bloque ser? de
63
         * raster.width X blockHeight. Tipicamente recorridos de este tipo se usan para el calculo de estad?sticas,
64
         * histogramas, salvado a raster, etc... Es importante para el buen funcionamiento que este bloque sea
65
         * potencia de dos.
66
         */
67
        public static int          blockHeight = 512;
68

    
69
        //*************CACHE*******************
70
        /**
71
         * Tama?o aproximado de cach? en Megas. Si este valor es alto cabr?n muchas p?ginas en memoria
72
         * a la vez y si es bajo cabr?n pocas. Hay que tener en cuenta que al instanciar se convertira en bytes
73
         * para su mejor tratamiento. Al llamar al constructor esta variable contendr? el tama?o exacto
74
         * de la cache en bytes. El tama?o aqu? especificado es aproximado. Este variar? dependiendo de los
75
         * par?metros del raster a cachear ya que las p?ginas deben tener una altura potencia de 2.
76
         */
77
        public static long          cacheSize = 25;
78
        /**
79
         * Tama?o m?ximo de la p?gina en Megas. Hay que tener en cuenta que al instanciar se convertira en bytes
80
         * para su mejor tratamiento. Al llamar al constructor esta variable contendr? el tama?o exacto
81
         * de la p?gina en bytes
82
         */
83
        public static double        pageSize = 4;
84
        /**
85
         * N?mero de p?ginas que tiene cada conjunto de cach?
86
         */
87
        public static int           pagsPerGroup = 5;
88

    
89
        //*************PATHS*******************
90

    
91
        /**
92
         * Ruta o rutas donde busca jars con clases que incorporen elementos nuevos que extiendan
93
         * otros ya existentes. Estos pueden ser drivers o filtros.
94
         */
95
        public static String[]       pathExtensions      = {"." + File.separator};
96
        
97
        public static String         pathTileCache       = System.getProperty("user.home") + File.separator + "gvSIG" + File.separator + "gvsig_rcache";
98

    
99
        /**
100
         * Valor noData por defecto para la librer?a. En caso de no tener un valor asociado
101
         * al raster se usar? este.
102
         */
103
        public static byte           defaultByteNoDataValue     = -128;
104
        public static short          defaultShortNoDataValue    = -32768;
105
        public static int            defaultIntegerNoDataValue  = -99999;
106
        public static float          defaultFloatNoDataValue    = -99999F;
107
        public static double         defaultDoubleNoDataValue   = -99999D;
108
        
109
        public RasterLibrary() {
110
                //super(RasterLibrary.class, Library.TYPE.API);
111
        registerAsAPI(RasterLibrary.class);
112
        }
113
        
114
    @Override
115
    protected void doInitialize() throws LibraryException {
116
        // Do nothing
117
    }
118

    
119
    @Override
120
    protected void doPostInitialize() throws LibraryException {
121
        // Validate there is any implementation registered.
122
        RasterManager manager = RasterLocator.getManager();
123
        if (manager == null) {
124
            throw new ReferenceNotRegisteredException(
125
                RasterLocator.MANAGER_NAME, RasterLocator
126
                    .getInstance());
127
        }
128
    }
129

    
130
}