gvsig-projects-pool / org.gvsig.lidar.prov / org.gvsig.lidar.prov.jgrass / src / main / java / org / gvsig / lidar / prov / jgrasstools / JGrassLASDataStoreProviderFactory.java @ 281
History | View | Annotate | Download (4.09 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright ? 2007-2016 gvSIG Association
|
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 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.lidar.prov.jgrasstools; |
25 |
|
26 |
import java.util.ArrayList; |
27 |
import java.util.List; |
28 |
|
29 |
import org.gvsig.fmap.dal.DataParameters; |
30 |
import org.gvsig.fmap.dal.DataStoreParameters; |
31 |
import org.gvsig.fmap.dal.DataStoreProvider; |
32 |
import org.gvsig.fmap.dal.DataTypes; |
33 |
import org.gvsig.fmap.dal.exception.InitializeException; |
34 |
import org.gvsig.fmap.dal.feature.spi.AbstractFeatureStoreProviderFactory; |
35 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters; |
36 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
37 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
38 |
import org.gvsig.lidar.prov.LASDataStoreParameters; |
39 |
import org.gvsig.lidar.prov.LASDataStoreProviderFactory; |
40 |
import org.gvsig.tools.dynobject.DynObject; |
41 |
|
42 |
/**
|
43 |
*
|
44 |
* @author <a href="mailto:cmartinez@scolab.es">Cesar Martinez Izquierdo</a>
|
45 |
*
|
46 |
*/
|
47 |
public class JGrassLASDataStoreProviderFactory extends AbstractFeatureStoreProviderFactory implements |
48 |
LASDataStoreProviderFactory { |
49 |
|
50 |
/**
|
51 |
* @param name
|
52 |
* Name of factory
|
53 |
* @param description
|
54 |
* Description of factory
|
55 |
*/
|
56 |
public JGrassLASDataStoreProviderFactory(String name, String description) { |
57 |
super(name, description);
|
58 |
} |
59 |
|
60 |
@Override
|
61 |
public DataStoreProvider createProvider(DataParameters dataParameters,
|
62 |
DataStoreProviderServices providerServices) throws InitializeException {
|
63 |
return new JGrassLASDataStoreProvider((DataStoreParameters) dataParameters, providerServices); |
64 |
} |
65 |
|
66 |
@Override
|
67 |
public DynObject createParameters() {
|
68 |
return new LASDataStoreParameters(JGrassLASDataStoreProvider.NAME); |
69 |
} |
70 |
|
71 |
public int allowMultipleGeometryTypes() { |
72 |
return NO;
|
73 |
} |
74 |
|
75 |
public int allowEditableFeatureType() { |
76 |
return NO;
|
77 |
} |
78 |
|
79 |
@SuppressWarnings("rawtypes") |
80 |
public List getSupportedDataTypes() { |
81 |
|
82 |
List<Integer> supportedDataTypes = new ArrayList<Integer>(); |
83 |
|
84 |
supportedDataTypes.add(DataTypes.BOOLEAN); |
85 |
supportedDataTypes.add(DataTypes.DATE); |
86 |
supportedDataTypes.add(DataTypes.FLOAT); |
87 |
supportedDataTypes.add(DataTypes.DOUBLE); |
88 |
supportedDataTypes.add(DataTypes.STRING); |
89 |
supportedDataTypes.add(DataTypes.INT); |
90 |
supportedDataTypes.add(DataTypes.LONG); |
91 |
supportedDataTypes.add(DataTypes.BYTE); |
92 |
supportedDataTypes.add(DataTypes.TIME); |
93 |
supportedDataTypes.add(DataTypes.TIMESTAMP); |
94 |
|
95 |
return supportedDataTypes;
|
96 |
} |
97 |
|
98 |
@SuppressWarnings("rawtypes") |
99 |
public List getSupportedGeometryTypesSubtypes() { |
100 |
List<Integer> supportedSubtypes = new ArrayList<Integer>(); |
101 |
supportedSubtypes.add(SUBTYPES.GEOM3D); |
102 |
return supportedSubtypes;
|
103 |
} |
104 |
|
105 |
public boolean allowsMandatoryAttributes() { |
106 |
return false; |
107 |
} |
108 |
|
109 |
public boolean allowsPrimaryKeyAttributes() { |
110 |
return false; |
111 |
} |
112 |
|
113 |
public int useLocalIndexesCanImprovePerformance() { |
114 |
return YES;
|
115 |
} |
116 |
|
117 |
@Override
|
118 |
public DynObject createDataExplorerParameters(Object connectionString) { |
119 |
return new FilesystemServerExplorerParameters(); |
120 |
} |
121 |
|
122 |
@Override
|
123 |
public DynObject createParameters(Object connectionObject) { |
124 |
return createParameters();
|
125 |
} |
126 |
|
127 |
} |