gvsig-projects-pool / org.gvsig.lidar.prov / org.gvsig.lidar.prov.jgrass / src / main / java / org / gvsig / lidar / prov / jgrasstools / JGrassLASLibrary.java @ 281
History | View | Annotate | Download (3.63 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 org.gvsig.fmap.dal.DALFileLibrary; |
27 |
import org.gvsig.fmap.dal.DALFileLocator; |
28 |
import org.gvsig.fmap.dal.DALLibrary; |
29 |
import org.gvsig.fmap.dal.DALLocator; |
30 |
import org.gvsig.fmap.dal.FileHelper; |
31 |
import org.gvsig.fmap.dal.spi.DataManagerProviderServices; |
32 |
import org.gvsig.lidar.prov.LASDataStoreParameters; |
33 |
import org.gvsig.lidar.prov.jgrasstools.JGrassLASDataStoreProvider; |
34 |
import org.gvsig.lidar.prov.jgrasstools.JGrassLASDataStoreProviderFactory; |
35 |
import org.gvsig.lidar.prov.jgrasstools.JGrassLASFilesystemServerProvider; |
36 |
import org.gvsig.metadata.MetadataLibrary; |
37 |
import org.gvsig.metadata.exceptions.MetadataException; |
38 |
import org.gvsig.tools.library.AbstractLibrary; |
39 |
import org.gvsig.tools.library.LibraryException; |
40 |
|
41 |
/**
|
42 |
*
|
43 |
* @author <a href="mailto:cmartinez@scolab.es">Cesar Martinez Izquierdo</a>
|
44 |
*
|
45 |
*/
|
46 |
public class JGrassLASLibrary extends AbstractLibrary { |
47 |
|
48 |
@Override
|
49 |
public void doRegistration() { |
50 |
registerAsServiceOf(DALLibrary.class); |
51 |
require(DALLibrary.class); |
52 |
require(DALFileLibrary.class); |
53 |
require(MetadataLibrary.class); |
54 |
} |
55 |
|
56 |
@Override
|
57 |
protected void doInitialize() throws LibraryException { |
58 |
} |
59 |
|
60 |
@Override
|
61 |
protected void doPostInitialize() throws LibraryException { |
62 |
// Register LAS parameters definition
|
63 |
FileHelper.registerParametersDefinition(LASDataStoreParameters.PARAMETERS_DEFINITION_NAME, |
64 |
LASDataStoreParameters.class, "LASDataStoreParameters.xml");
|
65 |
DataManagerProviderServices dataman = |
66 |
(DataManagerProviderServices) DALLocator.getDataManager(); |
67 |
|
68 |
// Register JGrass LAS metadata definition
|
69 |
try {
|
70 |
FileHelper.registerMetadataDefinition(JGrassLASDataStoreProvider.METADATA_DEFINITION_NAME, |
71 |
JGrassLASDataStoreProvider.class, "JGrassLASMetadata.xml");
|
72 |
} catch (MetadataException e) {
|
73 |
throw new LibraryException(getClass(), e); |
74 |
} |
75 |
|
76 |
// Register JGrass LAS provider factory
|
77 |
if (!dataman.getStoreProviders().contains(JGrassLASDataStoreProvider.NAME)) {
|
78 |
dataman.registerStoreProviderFactory(new JGrassLASDataStoreProviderFactory(
|
79 |
JGrassLASDataStoreProvider.NAME, JGrassLASDataStoreProvider.DESCRIPTION)); |
80 |
} |
81 |
|
82 |
/*
|
83 |
*
|
84 |
* Disabled as we are currently using Whitebox
|
85 |
*
|
86 |
// Register JGrass LAS file system server provider
|
87 |
DALFileLocator.getFilesystemServerExplorerManager().registerProvider(
|
88 |
JGrassLASDataStoreProvider.NAME, JGrassLASDataStoreProvider.DESCRIPTION,
|
89 |
JGrassLASFilesystemServerProvider.class);
|
90 |
*/
|
91 |
fixDataParameters(); |
92 |
} |
93 |
|
94 |
private void fixDataParameters() { |
95 |
} |
96 |
} |