svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.daltransform.app / org.gvsig.daltransform.app.eventtheme / src / test / java / org / gvsig / app / eventlayer / dal / feature / EventThemeTransformTest.java @ 40558
History | View | Annotate | Download (3.12 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 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 3
|
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 |
/*
|
25 |
* AUTHORS (In addition to CIT):
|
26 |
* 2009 {Iver T.I.} {Task}
|
27 |
*/
|
28 |
|
29 |
package org.gvsig.app.eventlayer.dal.feature; |
30 |
|
31 |
import java.io.File; |
32 |
|
33 |
import org.gvsig.app.eventtheme.dal.feature.EventThemeTransform; |
34 |
import org.gvsig.daltransform.BaseFeatureStoreTransform; |
35 |
import org.gvsig.fmap.crs.CRSFactory; |
36 |
import org.gvsig.fmap.dal.DataStoreParameters; |
37 |
import org.gvsig.fmap.dal.exception.DataException; |
38 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
39 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
40 |
import org.gvsig.fmap.dal.feature.FeatureStoreTransform; |
41 |
import org.gvsig.fmap.dal.store.dbf.DBFStoreProvider; |
42 |
|
43 |
/**
|
44 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
|
45 |
*/
|
46 |
public class EventThemeTransformTest extends BaseFeatureStoreTransform { |
47 |
private final File dbf = new File("testdata/events.dbf"); |
48 |
private final String xFieldName = "x"; |
49 |
private final String yFieldName = "y"; |
50 |
private final String geometryFieldName = "geom"; |
51 |
private final String projection = "EPSG:23030"; |
52 |
protected boolean testDBFInitialized = false; |
53 |
|
54 |
|
55 |
public DataStoreParameters getDefaultDataStoreParameters() throws DataException { |
56 |
DataStoreParameters dbfParameters = null;
|
57 |
dbfParameters = dataManager.createStoreParameters(DBFStoreProvider.NAME); |
58 |
|
59 |
dbfParameters.setDynValue("dbfFile", dbf);
|
60 |
|
61 |
return dbfParameters;
|
62 |
} |
63 |
|
64 |
/* (non-Javadoc)
|
65 |
* @see org.gvsig.fmap.dal.feature.BaseFeatureStoreTransform#getFeatureStoreTransform()
|
66 |
*/
|
67 |
public FeatureStoreTransform getFeatureStoreTransform() throws DataException, ValidateDataParametersException { |
68 |
FeatureStore store = (FeatureStore) dataManager.openStore("DBF",
|
69 |
this.getDefaultDataStoreParameters());
|
70 |
EventThemeTransform transform = new EventThemeTransform();
|
71 |
transform.initialize(store, geometryFieldName, xFieldName, yFieldName, |
72 |
CRSFactory.getCRS(projection)); |
73 |
return transform;
|
74 |
} |
75 |
|
76 |
/* (non-Javadoc)
|
77 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#hasExplorer()
|
78 |
*/
|
79 |
public boolean hasExplorer() { |
80 |
// TODO Auto-generated method stub
|
81 |
return false; |
82 |
} |
83 |
|
84 |
/* (non-Javadoc)
|
85 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#usesResources()
|
86 |
*/
|
87 |
public boolean usesResources() { |
88 |
// TODO Auto-generated method stub
|
89 |
return false; |
90 |
} |
91 |
|
92 |
} |