Revision 400
old/org.gvsig.gpe/plugin/tags/org.gvsig.gpe.app-2.0.1/org.gvsig.gpe.app.mainplugin/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
3 |
<modelVersion>4.0.0</modelVersion> |
|
4 |
<artifactId>org.gvsig.gpe.app.mainplugin</artifactId> |
|
5 |
<packaging>jar</packaging> |
|
6 |
|
|
7 |
<name>Formats: GML and KML</name> |
|
8 |
|
|
9 |
<parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<artifactId>org.gvsig.gpe.app</artifactId> |
|
12 |
<version>2.0.1</version> |
|
13 |
</parent> |
|
14 |
|
|
15 |
<dependencies> |
|
16 |
<dependency> |
|
17 |
<groupId>org.slf4j</groupId> |
|
18 |
<artifactId>slf4j-api</artifactId> |
|
19 |
<scope>compile</scope> |
|
20 |
</dependency> |
|
21 |
<dependency> |
|
22 |
<groupId>org.gvsig</groupId> |
|
23 |
<artifactId>org.gvsig.gpe.lib.api</artifactId> |
|
24 |
<scope>compile</scope> |
|
25 |
</dependency> |
|
26 |
<dependency> |
|
27 |
<groupId>org.gvsig</groupId> |
|
28 |
<artifactId>org.gvsig.gpe.lib.impl</artifactId> |
|
29 |
<scope>compile</scope> |
|
30 |
</dependency> |
|
31 |
|
|
32 |
<dependency> |
|
33 |
<groupId>org.gvsig</groupId> |
|
34 |
<artifactId>org.gvsig.gpe.lib.spi</artifactId> |
|
35 |
<scope>runtime</scope> |
|
36 |
</dependency> |
|
37 |
|
|
38 |
<dependency> |
|
39 |
<groupId>org.gvsig</groupId> |
|
40 |
<artifactId>org.gvsig.gpe.exportto.kml</artifactId> |
|
41 |
<scope>runtime</scope> |
|
42 |
</dependency> |
|
43 |
<dependency> |
|
44 |
<groupId>org.gvsig</groupId> |
|
45 |
<artifactId>org.gvsig.gpe.exportto.generic</artifactId> |
|
46 |
<scope>runtime</scope> |
|
47 |
</dependency> |
|
48 |
|
|
49 |
<dependency> |
|
50 |
<groupId>org.gvsig</groupId> |
|
51 |
<artifactId>org.gvsig.xmlschema.lib.api</artifactId> |
|
52 |
<scope>compile</scope> |
|
53 |
</dependency> |
|
54 |
<dependency> |
|
55 |
<groupId>org.gvsig</groupId> |
|
56 |
<artifactId>org.gvsig.xmlschema.lib.impl</artifactId> |
|
57 |
<scope>runtime</scope> |
|
58 |
</dependency> |
|
59 |
<dependency> |
|
60 |
<groupId>org.gvsig</groupId> |
|
61 |
<artifactId>org.gvsig.xmlschema.lib.spi</artifactId> |
|
62 |
<scope>runtime</scope> |
|
63 |
</dependency> |
|
64 |
<dependency> |
|
65 |
<groupId>org.gvsig</groupId> |
|
66 |
<artifactId>org.gvsig.xmlschema.prov.kxml</artifactId> |
|
67 |
<scope>runtime</scope> |
|
68 |
</dependency> |
|
69 |
<dependency> |
|
70 |
<groupId>org.gvsig</groupId> |
|
71 |
<artifactId>org.gvsig.projection.api</artifactId> |
|
72 |
<scope>compile</scope> |
|
73 |
</dependency> |
|
74 |
<dependency> |
|
75 |
<groupId>org.gvsig</groupId> |
|
76 |
<artifactId>org.gvsig.andami</artifactId> |
|
77 |
<scope>compile</scope> |
|
78 |
</dependency> |
|
79 |
<dependency> |
|
80 |
<groupId>org.gvsig</groupId> |
|
81 |
<artifactId>org.gvsig.app.mainplugin</artifactId> |
|
82 |
<scope>compile</scope> |
|
83 |
</dependency> |
|
84 |
<dependency> |
|
85 |
<groupId>org.gvsig</groupId> |
|
86 |
<artifactId>org.gvsig.fmap.dal.api</artifactId> |
|
87 |
<scope>compile</scope> |
|
88 |
</dependency> |
|
89 |
<dependency> |
|
90 |
<groupId>org.gvsig</groupId> |
|
91 |
<artifactId>org.gvsig.fmap.dal.spi</artifactId> |
|
92 |
<scope>compile</scope> |
|
93 |
</dependency> |
|
94 |
<dependency> |
|
95 |
<groupId>org.gvsig</groupId> |
|
96 |
<artifactId>org.gvsig.fmap.dal.file.lib</artifactId> |
|
97 |
<scope>compile</scope> |
|
98 |
</dependency> |
|
99 |
<dependency> |
|
100 |
<groupId>org.gvsig</groupId> |
|
101 |
<artifactId>org.gvsig.fmap.mapcontext.api</artifactId> |
|
102 |
<scope>compile</scope> |
|
103 |
</dependency> |
|
104 |
<dependency> |
|
105 |
<groupId>org.gvsig</groupId> |
|
106 |
<artifactId>org.gvsig.fmap.geometry.api</artifactId> |
|
107 |
<scope>compile</scope> |
|
108 |
</dependency> |
|
109 |
|
|
110 |
<!-- |
|
111 |
<dependency> |
|
112 |
<groupId>org.gvsig</groupId> |
|
113 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
114 |
<scope>compile</scope> |
|
115 |
</dependency> |
|
116 |
--> |
|
117 |
|
|
118 |
<dependency> |
|
119 |
<groupId>org.gvsig</groupId> |
|
120 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
121 |
<scope>compile</scope> |
|
122 |
</dependency> |
|
123 |
|
|
124 |
<!-- |
|
125 |
<dependency> |
|
126 |
<groupId>org.gvsig</groupId> |
|
127 |
<artifactId>org.gvsig.timesupport.lib.api</artifactId> |
|
128 |
<scope>compile</scope> |
|
129 |
</dependency> |
|
130 |
--> |
|
131 |
|
|
132 |
|
|
133 |
<!-- tests --> |
|
134 |
<dependency> |
|
135 |
<groupId>org.gvsig</groupId> |
|
136 |
<artifactId>org.gvsig.fmap.dal.impl</artifactId> |
|
137 |
<type>test-jar</type> |
|
138 |
<scope>test</scope> |
|
139 |
</dependency> |
|
140 |
|
|
141 |
<!-- runtime --> |
|
142 |
<dependency> |
|
143 |
<groupId>org.gvsig</groupId> |
|
144 |
<artifactId>org.gvsig.gpe.prov.xml</artifactId> |
|
145 |
<scope>runtime</scope> |
|
146 |
</dependency> |
|
147 |
<dependency> |
|
148 |
<groupId>org.gvsig</groupId> |
|
149 |
<artifactId>org.gvsig.gpe.prov.gml</artifactId> |
|
150 |
<scope>runtime</scope> |
|
151 |
</dependency> |
|
152 |
<dependency> |
|
153 |
<groupId>org.gvsig</groupId> |
|
154 |
<artifactId>org.gvsig.gpe.prov.kml</artifactId> |
|
155 |
<scope>runtime</scope> |
|
156 |
</dependency> |
|
157 |
<dependency> |
|
158 |
<groupId>org.gvsig</groupId> |
|
159 |
<artifactId>org.gvsig.xmlpull.lib.api</artifactId> |
|
160 |
<scope>runtime</scope> |
|
161 |
</dependency> |
|
162 |
<dependency> |
|
163 |
<groupId>org.gvsig</groupId> |
|
164 |
<artifactId>org.gvsig.xmlpull.lib.spi</artifactId> |
|
165 |
<scope>runtime</scope> |
|
166 |
</dependency> |
|
167 |
<dependency> |
|
168 |
<groupId>org.gvsig</groupId> |
|
169 |
<artifactId>org.gvsig.xmlpull.lib.impl</artifactId> |
|
170 |
<scope>runtime</scope> |
|
171 |
</dependency> |
|
172 |
<dependency> |
|
173 |
<groupId>org.gvsig</groupId> |
|
174 |
<artifactId>org.gvsig.xmlpull.prov.stax</artifactId> |
|
175 |
<scope>runtime</scope> |
|
176 |
</dependency> |
|
177 |
<dependency> |
|
178 |
<groupId>org.gvsig</groupId> |
|
179 |
<artifactId>org.gvsig.xmlpull.prov.kxml</artifactId> |
|
180 |
<scope>runtime</scope> |
|
181 |
</dependency> |
|
182 |
<dependency> |
|
183 |
<groupId>jfree</groupId> |
|
184 |
<artifactId>jcommon</artifactId> |
|
185 |
<scope>compile</scope> |
|
186 |
</dependency> |
|
187 |
|
|
188 |
<!-- |
|
189 |
<dependency> |
|
190 |
<groupId>org.gvsig</groupId> |
|
191 |
<artifactId>org.gvsig.fmap.dal.index.spatial</artifactId> |
|
192 |
<classifier>jts</classifier> |
|
193 |
<scope>test</scope> |
|
194 |
</dependency> |
|
195 |
--> |
|
196 |
|
|
197 |
<dependency> |
|
198 |
<groupId>org.gvsig</groupId> |
|
199 |
<artifactId>org.gvsig.fmap.geometry.impl</artifactId> |
|
200 |
<scope>test</scope> |
|
201 |
</dependency> |
|
202 |
<dependency> |
|
203 |
<groupId>org.gvsig</groupId> |
|
204 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
205 |
<type>test-jar</type> |
|
206 |
<scope>test</scope> |
|
207 |
</dependency> |
|
208 |
|
|
209 |
<!-- TODO: Remove those entries when updated in libGPE --> |
|
210 |
<dependency> |
|
211 |
<groupId>stax</groupId> |
|
212 |
<artifactId>stax-api</artifactId> |
|
213 |
<scope>runtime</scope> |
|
214 |
</dependency> |
|
215 |
|
|
216 |
<dependency> |
|
217 |
<groupId>stax</groupId> |
|
218 |
<artifactId>stax</artifactId> |
|
219 |
<scope>runtime</scope> |
|
220 |
</dependency> |
|
221 |
</dependencies> |
|
222 |
|
|
223 |
<build> |
|
224 |
<plugins> |
|
225 |
|
|
226 |
<plugin> |
|
227 |
<groupId>org.apache.maven.plugins</groupId> |
|
228 |
<artifactId>maven-surefire-plugin</artifactId> |
|
229 |
<configuration> |
|
230 |
<skipTests>true</skipTests> |
|
231 |
</configuration> |
|
232 |
</plugin> |
|
233 |
</plugins> |
|
234 |
</build> |
|
235 |
|
|
236 |
<properties> |
|
237 |
<gvsig.package.info.state>testing</gvsig.package.info.state> |
|
238 |
<gvsig.package.info.categories>Formats,Vector</gvsig.package.info.categories> |
|
239 |
<gvsig.package.info.official>true</gvsig.package.info.official> |
|
240 |
<gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2</gvsig.package.info.dependencies> |
|
241 |
<gvsig.package.info.poolURL>http://devel.gvsig.org/download/projects/gvsig-gpe/pool</gvsig.package.info.poolURL> |
|
242 |
</properties> |
|
243 |
</project> |
old/org.gvsig.gpe/plugin/tags/org.gvsig.gpe.app-2.0.1/org.gvsig.gpe.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#maven.buildNumber.plugin properties file |
|
2 |
#Fri Feb 08 11:26:19 CET 2013 |
|
3 |
buildNumber=2080 |
old/org.gvsig.gpe/plugin/tags/org.gvsig.gpe.app-2.0.1/org.gvsig.gpe.app.mainplugin/src/main/resources/org/gvsig/fmap/dal/store/gpe/GPEMetadata.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<!-- |
|
3 |
Definitions of metadata fields for a gpe file. |
|
4 |
--> |
|
5 |
<definitions> |
|
6 |
<version>1.0.0</version> |
|
7 |
<classes> |
|
8 |
|
|
9 |
<class name="GPE" namespace="Metadata"> |
|
10 |
<extends> |
|
11 |
<class namespace="Metadata" name="SpatialProvider"/> |
|
12 |
</extends> |
|
13 |
<description>Metadata of a GPE store</description> |
|
14 |
<fields> |
|
15 |
</fields> |
|
16 |
</class> |
|
17 |
|
|
18 |
</classes> |
|
19 |
</definitions> |
old/org.gvsig.gpe/plugin/tags/org.gvsig.gpe.app-2.0.1/org.gvsig.gpe.app.mainplugin/src/main/resources/org/gvsig/fmap/dal/store/gpe/GPEParameters.xml | ||
---|---|---|
1 |
<?xml version= "1.0 "?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="GPEStoreParameters"> |
|
6 |
<extends> |
|
7 |
<class namespace="dal" name="ProviderParameters"/> |
|
8 |
</extends> |
|
9 |
<description>Store the parameters need to open a GPE supported file</description> |
|
10 |
<fields> |
|
11 |
<field name="File" type="file" mandatory="true" group="Basic"> |
|
12 |
<description>GPE supported file</description> |
|
13 |
</field> |
|
14 |
<field name="CRS" type="crs" mandatory="true" group="Basic"> |
|
15 |
<description>The coordinate reference system used in this GPE supported file</description> |
|
16 |
</field> |
|
17 |
</fields> |
|
18 |
</class> |
|
19 |
</classes> |
|
20 |
</definitions> |
old/org.gvsig.gpe/plugin/tags/org.gvsig.gpe.app-2.0.1/org.gvsig.gpe.app.mainplugin/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.fmap.dal.store.gpe.DALGPELibrary |
old/org.gvsig.gpe/plugin/tags/org.gvsig.gpe.app-2.0.1/org.gvsig.gpe.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<!-- |
|
2 |
|
|
3 |
gvSIG. Desktop Geographic Information System. |
|
4 |
|
|
5 |
Copyright (C) 2007-2013 gvSIG Association. |
|
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
|
8 |
modify it under the terms of the GNU General Public License |
|
9 |
as published by the Free Software Foundation; either version 3 |
|
10 |
of the License, or (at your option) any later version. |
|
11 |
|
|
12 |
This program is distributed in the hope that it will be useful, |
|
13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
GNU General Public License for more details. |
|
16 |
|
|
17 |
You should have received a copy of the GNU General Public License |
|
18 |
along with this program; if not, write to the Free Software |
|
19 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
20 |
MA 02110-1301, USA. |
|
21 |
|
|
22 |
For any additional information, do not hesitate to contact us |
|
23 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
24 |
|
|
25 |
--> |
|
26 |
<assembly> |
|
27 |
<id>gvsig-plugin-package</id> |
|
28 |
<formats> |
|
29 |
<format>zip</format> |
|
30 |
</formats> |
|
31 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
32 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
33 |
<files> |
|
34 |
<file> |
|
35 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
36 |
<outputDirectory>lib</outputDirectory> |
|
37 |
</file> |
|
38 |
<file> |
|
39 |
<source>target/package.info</source> |
|
40 |
</file> |
|
41 |
</files> |
|
42 |
|
|
43 |
<fileSets> |
|
44 |
<fileSet> |
|
45 |
<directory>src/main/resources-plugin</directory> |
|
46 |
<outputDirectory>.</outputDirectory> |
|
47 |
</fileSet> |
|
48 |
</fileSets> |
|
49 |
|
|
50 |
<dependencySets> |
|
51 |
<dependencySet> |
|
52 |
<useProjectArtifact>false</useProjectArtifact> |
|
53 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
54 |
<outputDirectory>lib</outputDirectory> |
|
55 |
<includes> |
|
56 |
<include>org.gvsig:org.gvsig.gpe.lib*</include> |
|
57 |
<include>org.gvsig:org.gvsig.gpe.prov*</include> |
|
58 |
<include>org.gvsig:org.gvsig.xmlpull*</include> |
|
59 |
<include>org.gvsig:org.gvsig.gpe.exportto*</include> |
|
60 |
<include>org.gvsig:org.gvsig.xmlschema*</include> |
|
61 |
<include>stax:stax</include> |
|
62 |
</includes> |
|
63 |
</dependencySet> |
|
64 |
</dependencySets> |
|
65 |
|
|
66 |
</assembly> |
|
67 |
|
old/org.gvsig.gpe/plugin/tags/org.gvsig.gpe.app-2.0.1/org.gvsig.gpe.app.mainplugin/src/main/java/org/gvsig/fmap/dal/store/gpe/GPEStoreProvider.java | ||
---|---|---|
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 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2009 {Iver T.I.} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.fmap.dal.store.gpe; |
|
29 |
|
|
30 |
import java.io.File; |
|
31 |
import java.util.Map; |
|
32 |
|
|
33 |
import org.cresques.cts.IProjection; |
|
34 |
import org.slf4j.Logger; |
|
35 |
import org.slf4j.LoggerFactory; |
|
36 |
|
|
37 |
import org.gvsig.fmap.dal.DALLocator; |
|
38 |
import org.gvsig.fmap.dal.DataManager; |
|
39 |
import org.gvsig.fmap.dal.DataServerExplorer; |
|
40 |
import org.gvsig.fmap.dal.DataStore; |
|
41 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
42 |
import org.gvsig.fmap.dal.DataTypes; |
|
43 |
import org.gvsig.fmap.dal.FileHelper; |
|
44 |
import org.gvsig.fmap.dal.exception.DataException; |
|
45 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
46 |
import org.gvsig.fmap.dal.exception.OpenException; |
|
47 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
48 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
49 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
|
50 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
51 |
import org.gvsig.fmap.dal.feature.spi.AbstractFeatureStoreProvider; |
|
52 |
import org.gvsig.fmap.dal.feature.spi.FeatureProvider; |
|
53 |
import org.gvsig.fmap.dal.feature.spi.FeatureReferenceProviderServices; |
|
54 |
import org.gvsig.fmap.dal.feature.spi.FeatureSetProvider; |
|
55 |
import org.gvsig.fmap.dal.resource.exception.ResourceExecuteException; |
|
56 |
import org.gvsig.fmap.dal.resource.file.FileResource; |
|
57 |
import org.gvsig.fmap.dal.resource.spi.ResourceConsumer; |
|
58 |
import org.gvsig.fmap.dal.resource.spi.ResourceProvider; |
|
59 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer; |
|
60 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters; |
|
61 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
|
62 |
import org.gvsig.fmap.dal.store.gpe.handlers.FmapContentHandler; |
|
63 |
import org.gvsig.fmap.dal.store.gpe.handlers.FmapErrorHandler; |
|
64 |
import org.gvsig.fmap.geom.Geometry.TYPES; |
|
65 |
import org.gvsig.fmap.geom.primitive.Envelope; |
|
66 |
import org.gvsig.gpe.lib.api.GPELocator; |
|
67 |
import org.gvsig.gpe.lib.api.GPEManager; |
|
68 |
import org.gvsig.tools.dynobject.DynObject; |
|
69 |
import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException; |
|
70 |
import org.gvsig.xmlschema.lib.api.XMLSchemaLocator; |
|
71 |
import org.gvsig.xmlschema.lib.api.XMLSchemaManager; |
|
72 |
|
|
73 |
/** |
|
74 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a> |
|
75 |
*/ |
|
76 |
public class GPEStoreProvider extends AbstractFeatureStoreProvider implements |
|
77 |
ResourceConsumer { |
|
78 |
public static final String NAME = "GPE"; |
|
79 |
public static final String DESCRIPTION = "GPE file"; |
|
80 |
public static final String METADATA_DEFINITION_NAME = NAME; |
|
81 |
|
|
82 |
private static Logger logger = LoggerFactory.getLogger(GPEStoreProvider.class); |
|
83 |
|
|
84 |
protected File m_Fich; |
|
85 |
protected boolean isOpen = false; |
|
86 |
//private GPEStoreParameters gpeParams; |
|
87 |
private ResourceProvider gpeResource; |
|
88 |
|
|
89 |
//Managers to manage the parsing process |
|
90 |
protected GPEManager gpeManager = null; |
|
91 |
protected XMLSchemaManager xmlSchemaManager = null; |
|
92 |
|
|
93 |
//The content handler and the error handler |
|
94 |
protected FmapContentHandler contentHandler; |
|
95 |
protected FmapErrorHandler errorHandler; |
|
96 |
|
|
97 |
public GPEStoreProvider(DataStoreParameters params, |
|
98 |
DataStoreProviderServices storeServices) |
|
99 |
throws InitializeException { |
|
100 |
this(params, storeServices, FileHelper |
|
101 |
.newMetadataContainer(METADATA_DEFINITION_NAME)); |
|
102 |
} |
|
103 |
|
|
104 |
protected GPEStoreProvider(DataStoreParameters params, |
|
105 |
DataStoreProviderServices storeServices, DynObject metadata) |
|
106 |
throws InitializeException { |
|
107 |
|
|
108 |
super(params, storeServices, metadata); |
|
109 |
|
|
110 |
this.setDynValue("Envelope", params.getDynValue("Envelope")); |
|
111 |
|
|
112 |
gpeManager = GPELocator.getGPEManager(); |
|
113 |
xmlSchemaManager = XMLSchemaLocator.getXMLSchemaManager(); |
|
114 |
|
|
115 |
retrieveFile(); |
|
116 |
gpeResource = this.createResource(FileResource.NAME, |
|
117 |
new Object[] { m_Fich.getAbsolutePath() }); |
|
118 |
gpeResource.addConsumer(this); |
|
119 |
this.initFeatureType(); |
|
120 |
} |
|
121 |
|
|
122 |
protected void retrieveFile() throws InitializeException{ |
|
123 |
m_Fich = getGPEParameters().getFile(); |
|
124 |
} |
|
125 |
|
|
126 |
protected void initFeatureType() throws InitializeException { |
|
127 |
try { |
|
128 |
|
|
129 |
this.open(); |
|
130 |
} catch (DataException e) { |
|
131 |
throw new InitializeException(this.getProviderName(), e); |
|
132 |
} |
|
133 |
} |
|
134 |
|
|
135 |
private GPEStoreParameters getGPEParameters() { |
|
136 |
return (GPEStoreParameters) this.getParameters(); |
|
137 |
} |
|
138 |
|
|
139 |
public Object getDynValue(String name) throws DynFieldNotFoundException { |
|
140 |
if (DataStore.METADATA_CRS.equalsIgnoreCase(name)) { |
|
141 |
IProjection resp = this.getSRS(); |
|
142 |
if (resp != null) { |
|
143 |
return resp; |
|
144 |
} |
|
145 |
} |
|
146 |
return super.getDynValue(name); |
|
147 |
} |
|
148 |
|
|
149 |
/* (non-Javadoc) |
|
150 |
* @see org.gvsig.fmap.dal.resource.spi.ResourceConsumer#closeResourceRequested(org.gvsig.fmap.dal.resource.spi.ResourceProvider) |
|
151 |
*/ |
|
152 |
public boolean closeResourceRequested(ResourceProvider resource) { |
|
153 |
// TODO Auto-generated method stub |
|
154 |
return false; |
|
155 |
} |
|
156 |
|
|
157 |
/* (non-Javadoc) |
|
158 |
* @see org.gvsig.fmap.dal.resource.spi.ResourceConsumer#resourceChanged(org.gvsig.fmap.dal.resource.spi.ResourceProvider) |
|
159 |
*/ |
|
160 |
public void resourceChanged(ResourceProvider resource) { |
|
161 |
// TODO Auto-generated method stub |
|
162 |
|
|
163 |
} |
|
164 |
|
|
165 |
/* (non-Javadoc) |
|
166 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#canWriteGeometry(int) |
|
167 |
*/ |
|
168 |
public boolean canWriteGeometry(int geometryType, int geometrySubtype) |
|
169 |
throws DataException { |
|
170 |
// TODO Auto-generated method stub |
|
171 |
return false; |
|
172 |
} |
|
173 |
|
|
174 |
/* (non-Javadoc) |
|
175 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#createNewOID() |
|
176 |
*/ |
|
177 |
public Object createNewOID() { |
|
178 |
return contentHandler.createNewOID(); |
|
179 |
} |
|
180 |
|
|
181 |
/* (non-Javadoc) |
|
182 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#createSet(org.gvsig.fmap.dal.feature.FeatureQuery) |
|
183 |
*/ |
|
184 |
public FeatureSetProvider createSet(FeatureQuery query) |
|
185 |
throws DataException { |
|
186 |
return new GPESetProvider(this, query); |
|
187 |
} |
|
188 |
|
|
189 |
protected FeatureProvider internalGetFeatureProviderByReference( |
|
190 |
FeatureReferenceProviderServices reference) throws DataException { |
|
191 |
return internalGetFeatureProviderByReference(reference, |
|
192 |
this |
|
193 |
.getFeatureStore() |
|
194 |
.getDefaultFeatureType()); |
|
195 |
} |
|
196 |
|
|
197 |
public FeatureProvider internalGetFeatureProviderByReference( |
|
198 |
FeatureReferenceProviderServices reference, FeatureType featureType) |
|
199 |
throws DataException { |
|
200 |
Map featureSet = contentHandler.getFeatureSet(); |
|
201 |
if (featureSet.containsKey(reference.getOID())){ |
|
202 |
return (FeatureProvider)featureSet.get(reference.getOID()); |
|
203 |
} |
|
204 |
return null; |
|
205 |
} |
|
206 |
|
|
207 |
FeatureProvider getFeatureProviderByIndex(Long index, FeatureType fType) |
|
208 |
throws DataException { |
|
209 |
Map featureSet = contentHandler.getFeatureSet(); |
|
210 |
if (featureSet.containsKey(index)){ |
|
211 |
return (FeatureProvider)featureSet.get(index); |
|
212 |
} |
|
213 |
return null; |
|
214 |
} |
|
215 |
|
|
216 |
public void resourcesBegin() throws ResourceExecuteException { |
|
217 |
// Nothing to do |
|
218 |
} |
|
219 |
|
|
220 |
public void resourcesEnd() { |
|
221 |
// Nothing to do |
|
222 |
} |
|
223 |
|
|
224 |
/* (non-Javadoc) |
|
225 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#getFeatureReferenceOIDType() |
|
226 |
*/ |
|
227 |
public int getOIDType() { |
|
228 |
return DataTypes.STRING; |
|
229 |
} |
|
230 |
|
|
231 |
/* (non-Javadoc) |
|
232 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#getName() |
|
233 |
*/ |
|
234 |
public String getProviderName() { |
|
235 |
return NAME; |
|
236 |
} |
|
237 |
|
|
238 |
/* (non-Javadoc) |
|
239 |
* @see org.gvsig.fmap.dal.spi.DataStoreProvider#getSourceId() |
|
240 |
*/ |
|
241 |
public Object getSourceId() { |
|
242 |
return getGPEParameters().getFile(); |
|
243 |
} |
|
244 |
|
|
245 |
public String getName() { |
|
246 |
String name = this.getGPEParameters().getFile().getName(); |
|
247 |
int n = name.lastIndexOf("."); |
|
248 |
if( n<1 ) { |
|
249 |
return name; |
|
250 |
} |
|
251 |
return name.substring(0, n); |
|
252 |
} |
|
253 |
|
|
254 |
public String getFullName() { |
|
255 |
return this.getGPEParameters().getFile().getAbsolutePath(); |
|
256 |
} |
|
257 |
|
|
258 |
/* (non-Javadoc) |
|
259 |
* @see org.gvsig.fmap.dal.spi.DataStoreProvider#open() |
|
260 |
*/ |
|
261 |
public void open() throws OpenException { |
|
262 |
if (isOpen) { |
|
263 |
return; |
|
264 |
} |
|
265 |
try { |
|
266 |
errorHandler = new FmapErrorHandler(); |
|
267 |
contentHandler = new FmapContentHandler(errorHandler, |
|
268 |
getStoreServices(), this, m_Fich, |
|
269 |
getSRS(), |
|
270 |
getGeometryType()); |
|
271 |
if (getStoreServices().getDefaultFeatureType() != null){ |
|
272 |
contentHandler.setFeatureType(getStoreServices().getDefaultFeatureType().getEditable()); |
|
273 |
} |
|
274 |
contentHandler.setEnvelope((Envelope)getDynValue("Envelope")); |
|
275 |
isOpen = true; |
|
276 |
gpeManager.parse(contentHandler, errorHandler, m_Fich.toURI()); |
|
277 |
} catch (Exception e) { |
|
278 |
throw new OpenException("Imposible create a parser",e); |
|
279 |
} |
|
280 |
} |
|
281 |
|
|
282 |
protected IProjection getSRS(){ |
|
283 |
return getGPEParameters().getCRS(); |
|
284 |
} |
|
285 |
|
|
286 |
protected int getGeometryType() { |
|
287 |
return TYPES.GEOMETRY; |
|
288 |
} |
|
289 |
|
|
290 |
/* (non-Javadoc) |
|
291 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#createSet(org.gvsig.fmap.dal.feature.FeatureQuery, org.gvsig.fmap.dal.feature.FeatureType) |
|
292 |
*/ |
|
293 |
public FeatureSetProvider createSet(FeatureQuery query, |
|
294 |
FeatureType featureType) throws DataException { |
|
295 |
return new GPESetProvider(this, query, featureType); |
|
296 |
} |
|
297 |
|
|
298 |
public long getFeatureCount() throws DataException { |
|
299 |
return contentHandler.getFeaturesCount(); |
|
300 |
} |
|
301 |
|
|
302 |
/* (non-Javadoc) |
|
303 |
* @see org.gvsig.fmap.dal.feature.spi.AbstractFeatureStoreProvider#getEnvelope() |
|
304 |
*/ |
|
305 |
public Envelope getEnvelope() throws DataException { |
|
306 |
this.open(); |
|
307 |
return (Envelope) this.getDynValue("Envelope"); |
|
308 |
} |
|
309 |
|
|
310 |
public void setEnvelope(Envelope envelope) { |
|
311 |
this.setDynValue("Envelope", envelope); |
|
312 |
} |
|
313 |
|
|
314 |
public ResourceProvider getResource() { |
|
315 |
return gpeResource; |
|
316 |
} |
|
317 |
|
|
318 |
public DataServerExplorer getExplorer() throws ReadException, |
|
319 |
ValidateDataParametersException { |
|
320 |
DataManager manager = DALLocator.getDataManager(); |
|
321 |
FilesystemServerExplorerParameters params; |
|
322 |
try { |
|
323 |
params = (FilesystemServerExplorerParameters) manager |
|
324 |
.createServerExplorerParameters(FilesystemServerExplorer.NAME); |
|
325 |
params.setRoot(this.getGPEParameters().getFile().getParent()); |
|
326 |
return manager.createServerExplorer(params); |
|
327 |
} catch (DataException e) { |
|
328 |
throw new ReadException(this.getProviderName(), e); |
|
329 |
} catch (ValidateDataParametersException e) { |
|
330 |
// TODO Auto-generated catch block |
|
331 |
throw new ReadException(this.getProviderName(), e); |
|
332 |
} |
|
333 |
} |
|
334 |
|
|
335 |
/** |
|
336 |
* @return the contentHandler |
|
337 |
*/ |
|
338 |
public FmapContentHandler getContentHandler() { |
|
339 |
return contentHandler; |
|
340 |
} |
|
341 |
|
|
342 |
/** |
|
343 |
* @return the errorHandler |
|
344 |
*/ |
|
345 |
public FmapErrorHandler getErrorHandler() { |
|
346 |
return errorHandler; |
|
347 |
} |
|
348 |
|
|
349 |
} |
old/org.gvsig.gpe/plugin/tags/org.gvsig.gpe.app-2.0.1/org.gvsig.gpe.app.mainplugin/src/main/java/org/gvsig/fmap/dal/store/gpe/GPEStoreParameters.java | ||
---|---|---|
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 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2009 {Iver T.I.} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.fmap.dal.store.gpe; |
|
29 |
|
|
30 |
import java.io.File; |
|
31 |
|
|
32 |
import org.cresques.cts.IProjection; |
|
33 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
34 |
import org.gvsig.fmap.dal.FileHelper; |
|
35 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
|
36 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
37 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
|
38 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters; |
|
39 |
import org.gvsig.fmap.dal.spi.AbstractDataParameters; |
|
40 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
|
41 |
import org.gvsig.fmap.geom.primitive.Envelope; |
|
42 |
import org.gvsig.tools.dynobject.DelegatedDynObject; |
|
43 |
import org.gvsig.tools.dynobject.DynStruct; |
|
44 |
|
|
45 |
/** |
|
46 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a> |
|
47 |
*/ |
|
48 |
public class GPEStoreParameters extends AbstractDataParameters implements |
|
49 |
DataStoreParameters, FilesystemStoreParameters, |
|
50 |
NewFeatureStoreParameters { |
|
51 |
|
|
52 |
public static final String PARAMETERS_DEFINITION_NAME = "GPEStoreParameters"; |
|
53 |
|
|
54 |
private static final String FILE_PARAMETER_NAME = "File"; |
|
55 |
private static final String CRS_PARAMETER_NAME = "CRS"; |
|
56 |
private static final String ENVELOPE_PARAMETER_NAME = "Envelope"; |
|
57 |
private static final String FEATURETYPE_PARAMETER_NAME = "FeatureType"; |
|
58 |
|
|
59 |
private DelegatedDynObject parameters; |
|
60 |
|
|
61 |
public GPEStoreParameters() { |
|
62 |
this(PARAMETERS_DEFINITION_NAME); |
|
63 |
} |
|
64 |
|
|
65 |
protected GPEStoreParameters(String parametersDefinitionName) { |
|
66 |
this(parametersDefinitionName, GPEStoreProvider.NAME); |
|
67 |
} |
|
68 |
|
|
69 |
public GPEStoreParameters(String parametersDefinitionName, String name) { |
|
70 |
super(); |
|
71 |
this.parameters = (DelegatedDynObject) FileHelper.newParameters(parametersDefinitionName); |
|
72 |
this.setDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME, name); |
|
73 |
} |
|
74 |
|
|
75 |
protected static void registerParametersDefinition(){ |
|
76 |
DynStruct dynStruct = FileHelper.registerParametersDefinition( |
|
77 |
GPEStoreParameters.PARAMETERS_DEFINITION_NAME, |
|
78 |
GPEStoreParameters.class, "GPEParameters.xml"); |
|
79 |
|
|
80 |
dynStruct.addDynFieldObject(ENVELOPE_PARAMETER_NAME). |
|
81 |
setClassOfValue(Envelope.class).setMandatory(false); |
|
82 |
|
|
83 |
dynStruct.addDynFieldObject(FEATURETYPE_PARAMETER_NAME). |
|
84 |
setClassOfValue(FeatureType.class).setMandatory(false); |
|
85 |
} |
|
86 |
|
|
87 |
protected DelegatedDynObject getDelegatedDynObject() { |
|
88 |
return parameters; |
|
89 |
} |
|
90 |
|
|
91 |
public String getDataStoreName() { |
|
92 |
return GPEStoreProvider.NAME; |
|
93 |
} |
|
94 |
|
|
95 |
public String getDescription() { |
|
96 |
return GPEStoreProvider.DESCRIPTION; |
|
97 |
} |
|
98 |
|
|
99 |
public boolean isValid() { |
|
100 |
return (this.getFile() != null); |
|
101 |
} |
|
102 |
|
|
103 |
public File getFile() { |
|
104 |
return (File) this.getDynValue(FILE_PARAMETER_NAME); |
|
105 |
} |
|
106 |
|
|
107 |
public void setFile(File file) { |
|
108 |
this.setDynValue(FILE_PARAMETER_NAME, file); |
|
109 |
} |
|
110 |
|
|
111 |
public String getFileName() { |
|
112 |
return this.getFile().getAbsolutePath(); |
|
113 |
} |
|
114 |
|
|
115 |
public void setFileName(String fileName) { |
|
116 |
this.setDynValue(FILE_PARAMETER_NAME, fileName); |
|
117 |
} |
|
118 |
|
|
119 |
public IProjection getCRS() { |
|
120 |
return (IProjection) this.getDynValue(CRS_PARAMETER_NAME); |
|
121 |
} |
|
122 |
|
|
123 |
public void setCRS(IProjection srs) { |
|
124 |
this.setDynValue(CRS_PARAMETER_NAME, srs); |
|
125 |
} |
|
126 |
|
|
127 |
public void setCRS(String srs) { |
|
128 |
this.setDynValue(CRS_PARAMETER_NAME, srs); |
|
129 |
} |
|
130 |
|
|
131 |
public Envelope getEnvelope() { |
|
132 |
return (Envelope) this.getDynValue(ENVELOPE_PARAMETER_NAME); |
|
133 |
} |
|
134 |
|
|
135 |
public void setEnvelope(Envelope envelope) { |
|
136 |
this.setDynValue(ENVELOPE_PARAMETER_NAME, envelope); |
|
137 |
} |
|
138 |
|
|
139 |
public void setDynValue(String name, Object val) { |
|
140 |
super.setDynValue(name, val); |
|
141 |
} |
|
142 |
|
|
143 |
public EditableFeatureType getDefaultFeatureType() { |
|
144 |
return (EditableFeatureType) this.getDynValue(FEATURETYPE_PARAMETER_NAME); |
|
145 |
} |
|
146 |
|
|
147 |
public void setDefaultFeatureType(FeatureType featureType) { |
|
148 |
this.setDynValue(FEATURETYPE_PARAMETER_NAME, featureType); |
|
149 |
} |
|
150 |
} |
old/org.gvsig.gpe/plugin/tags/org.gvsig.gpe.app-2.0.1/org.gvsig.gpe.app.mainplugin/src/main/java/org/gvsig/fmap/dal/store/gpe/handlers/FmapErrorHandler.java | ||
---|---|---|
1 |
package org.gvsig.fmap.dal.store.gpe.handlers; |
|
2 |
|
|
3 |
import org.gvsig.gpe.lib.impl.parser.GPEErrorHandler; |
|
4 |
|
|
5 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
6 |
* |
|
7 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
8 |
* |
|
9 |
* This program is free software; you can redistribute it and/or |
|
10 |
* modify it under the terms of the GNU General Public License |
|
11 |
* as published by the Free Software Foundation; either version 2 |
|
12 |
* of the License, or (at your option) any later version. |
|
13 |
* |
|
14 |
* This program is distributed in the hope that it will be useful, |
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
17 |
* GNU General Public License for more details. |
|
18 |
* |
|
19 |
* You should have received a copy of the GNU General Public License |
|
20 |
* along with this program; if not, write to the Free Software |
|
21 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
22 |
* |
|
23 |
* For more information, contact: |
|
24 |
* |
|
25 |
* Generalitat Valenciana |
|
26 |
* Conselleria d'Infraestructures i Transport |
|
27 |
* Av. Blasco Ib??ez, 50 |
|
28 |
* 46010 VALENCIA |
|
29 |
* SPAIN |
|
30 |
* |
|
31 |
* +34 963862235 |
|
32 |
* gvsig@gva.es |
|
33 |
* www.gvsig.gva.es |
|
34 |
* |
|
35 |
* or |
|
36 |
* |
|
37 |
* IVER T.I. S.A |
|
38 |
* Salamanca 50 |
|
39 |
* 46005 Valencia |
|
40 |
* Spain |
|
41 |
* |
|
42 |
* +34 963163400 |
|
43 |
* dac@iver.es |
|
44 |
*/ |
|
45 |
/* CVS MESSAGES: |
|
46 |
* |
|
47 |
* $Id$ |
|
48 |
* $Log$ |
|
49 |
* |
|
50 |
*/ |
|
51 |
/** |
|
52 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
53 |
*/ |
|
54 |
public class FmapErrorHandler extends GPEErrorHandler{ |
|
55 |
|
|
56 |
} |
old/org.gvsig.gpe/plugin/tags/org.gvsig.gpe.app-2.0.1/org.gvsig.gpe.app.mainplugin/src/main/java/org/gvsig/fmap/dal/store/gpe/handlers/FmapContentHandler.java | ||
---|---|---|
1 |
package org.gvsig.fmap.dal.store.gpe.handlers; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
import java.io.IOException; |
|
5 |
import java.util.ArrayList; |
|
6 |
import java.util.HashMap; |
|
7 |
import java.util.Iterator; |
|
8 |
import java.util.List; |
|
9 |
import java.util.Map; |
|
10 |
|
|
11 |
import org.cresques.cts.IProjection; |
|
12 |
import org.gvsig.fmap.dal.DataTypes; |
|
13 |
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
|
14 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
|
15 |
import org.gvsig.fmap.dal.feature.Feature; |
|
16 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
17 |
import org.gvsig.fmap.dal.feature.spi.DefaultFeatureProvider; |
|
18 |
import org.gvsig.fmap.dal.feature.spi.FeatureProvider; |
|
19 |
import org.gvsig.fmap.dal.feature.spi.FeatureStoreProviderServices; |
|
20 |
import org.gvsig.fmap.dal.store.gpe.GPEStoreProvider; |
|
21 |
import org.gvsig.fmap.dal.store.gpe.model.GPEElement; |
|
22 |
import org.gvsig.fmap.dal.store.gpe.model.GPEFeature; |
|
23 |
import org.gvsig.fmap.geom.Geometry; |
|
24 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
|
25 |
import org.gvsig.fmap.geom.Geometry.TYPES; |
|
26 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
27 |
import org.gvsig.fmap.geom.GeometryManager; |
|
28 |
import org.gvsig.fmap.geom.aggregate.MultiCurve; |
|
29 |
import org.gvsig.fmap.geom.aggregate.MultiPoint; |
|
30 |
import org.gvsig.fmap.geom.aggregate.MultiPrimitive; |
|
31 |
import org.gvsig.fmap.geom.aggregate.MultiSurface; |
|
32 |
import org.gvsig.fmap.geom.exception.CreateEnvelopeException; |
|
33 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
|
34 |
import org.gvsig.fmap.geom.primitive.Curve; |
|
35 |
import org.gvsig.fmap.geom.primitive.Envelope; |
|
36 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
|
37 |
import org.gvsig.fmap.geom.primitive.Point; |
|
38 |
import org.gvsig.fmap.geom.primitive.Primitive; |
|
39 |
import org.gvsig.fmap.geom.primitive.Surface; |
|
40 |
import org.gvsig.gpe.lib.api.parser.IAttributesIterator; |
|
41 |
import org.gvsig.gpe.lib.api.parser.ICoordinateIterator; |
|
42 |
import org.gvsig.gpe.lib.api.parser.IGPEErrorHandler; |
|
43 |
import org.gvsig.gpe.lib.impl.parser.GPEContentHandler; |
|
44 |
import org.jfree.util.Log; |
|
45 |
import org.slf4j.Logger; |
|
46 |
import org.slf4j.LoggerFactory; |
|
47 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
48 |
* |
|
49 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
50 |
* |
|
51 |
* This program is free software; you can redistribute it and/or |
|
52 |
* modify it under the terms of the GNU General Public License |
|
53 |
* as published by the Free Software Foundation; either version 2 |
|
54 |
* of the License, or (at your option) any later version. |
|
55 |
* |
|
56 |
* This program is distributed in the hope that it will be useful, |
|
57 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
58 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
59 |
* GNU General Public License for more details. |
|
60 |
* |
|
61 |
* You should have received a copy of the GNU General Public License |
|
62 |
* along with this program; if not, write to the Free Software |
|
63 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
64 |
* |
|
65 |
* For more information, contact: |
|
66 |
* |
|
67 |
* Generalitat Valenciana |
|
68 |
* Conselleria d'Infraestructures i Transport |
|
69 |
* Av. Blasco Ib??ez, 50 |
|
70 |
* 46010 VALENCIA |
|
71 |
* SPAIN |
|
72 |
* |
|
73 |
* +34 963862235 |
|
74 |
* gvsig@gva.es |
|
75 |
* www.gvsig.gva.es |
|
76 |
* |
|
77 |
* or |
|
78 |
* |
|
79 |
* IVER T.I. S.A |
|
80 |
* Salamanca 50 |
|
81 |
* 46005 Valencia |
|
82 |
* Spain |
|
83 |
* |
|
84 |
* +34 963163400 |
|
85 |
* dac@iver.es |
|
86 |
*/ |
|
87 |
/* CVS MESSAGES: |
|
88 |
* |
|
89 |
* $Id$ |
|
90 |
* $Log$ |
|
91 |
* |
|
92 |
*/ |
|
93 |
/** |
|
94 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
95 |
*/ |
|
96 |
public class FmapContentHandler extends GPEContentHandler { |
|
97 |
private static final Logger LOG = LoggerFactory.getLogger(FmapContentHandler.class); |
|
98 |
|
|
99 |
private HashMap featureSet = null; |
|
100 |
private EditableFeatureType featureType = null; |
|
101 |
private FeatureStoreProviderServices store = null; |
|
102 |
private GPEStoreProvider storeProvider = null; |
|
103 |
private GeometryManager geomManager = GeometryLocator.getGeometryManager(); |
|
104 |
private int featureId = 0; |
|
105 |
private Envelope envelope = null; |
|
106 |
private File file = null; |
|
107 |
private IProjection srs = null; |
|
108 |
private int geometryType = 0; |
|
109 |
|
|
110 |
public FmapContentHandler(IGPEErrorHandler errorHandler, FeatureStoreProviderServices store, |
|
111 |
GPEStoreProvider storeProvider, File file, IProjection srs, int geometryType) { |
|
112 |
super(); |
|
113 |
setErrorHandler(errorHandler); |
|
114 |
this.store = store; |
|
115 |
this.storeProvider = storeProvider; |
|
116 |
this.file = file; |
|
117 |
this.srs = srs; |
|
118 |
this.geometryType = geometryType; |
|
119 |
} |
|
120 |
|
|
121 |
public int getFeaturesCount(){ |
|
122 |
return featureSet.size(); |
|
123 |
} |
|
124 |
|
|
125 |
public Feature getFeatureAt(int index){ |
|
126 |
return (Feature)featureSet.get(new Integer(index)); |
|
127 |
} |
|
128 |
|
|
129 |
public EditableFeatureType getFeatureType(){ |
|
130 |
return featureType; |
|
131 |
} |
|
132 |
|
|
133 |
|
|
134 |
/** |
|
135 |
* @return the featureSet |
|
136 |
*/ |
|
137 |
public HashMap getFeatureSet() { |
|
138 |
return featureSet; |
|
139 |
} |
|
140 |
|
|
141 |
/* |
|
142 |
* (non-Javadoc) |
|
143 |
* @see org.gvsig.gpe.parser.GPEContentHandler#startLayer(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.gvsig.gpe.parser.IAttributesIterator, java.lang.Object, java.lang.Object) |
|
144 |
*/ |
|
145 |
public Object startLayer(String id, String namespace, String name, |
|
146 |
String description, String srs, IAttributesIterator iterator, Object parentLayer, Object box) { |
|
147 |
if (featureSet == null){ |
|
148 |
featureSet = new HashMap(); |
|
149 |
} |
|
150 |
if (envelope == null){ |
|
151 |
try { |
|
152 |
envelope = geomManager.createEnvelope(SUBTYPES.GEOM2D); |
|
153 |
} catch (CreateEnvelopeException e) { |
|
154 |
Log.error("Error creating the envelope", e); |
|
155 |
} |
|
156 |
} |
|
157 |
return featureSet; |
|
158 |
} |
|
159 |
|
|
160 |
/* |
|
161 |
* (non-Javadoc) |
|
162 |
* @see org.gvsig.gpe.IGPEContentHandler#endLayer(java.lang.Object) |
|
163 |
*/ |
|
164 |
public void endLayer(Object layer) { |
|
165 |
if (featureType == null){ |
|
166 |
createFeatureType(null); |
|
167 |
} |
|
168 |
storeProvider.setEnvelope(envelope); |
|
169 |
} |
|
170 |
|
|
171 |
/* |
|
172 |
* (non-Javadoc) |
|
173 |
* @see org.gvsig.gpe.parser.GPEContentHandler#startPoint(java.lang.String, org.gvsig.gpe.parser.ICoordinateIterator, java.lang.String) |
|
174 |
*/ |
|
175 |
public Object startPoint(String id, ICoordinateIterator coords, String srs) { |
|
176 |
return createPoint(coords); |
|
177 |
} |
|
178 |
|
|
179 |
private Point createPoint(ICoordinateIterator coords){ |
|
180 |
double[] buffer = new double[coords.getDimension()]; |
|
181 |
try { |
|
182 |
coords.hasNext(); |
|
183 |
coords.next(buffer); |
|
184 |
Point point = null; |
|
185 |
if (coords.getDimension() == 2){ |
|
186 |
point = (Point) geomManager.create(TYPES.POINT, SUBTYPES.GEOM2D); |
|
187 |
}else if (coords.getDimension() == 3){ |
|
188 |
point = (Point) geomManager.create(TYPES.POINT, SUBTYPES.GEOM3D); |
|
189 |
} |
|
190 |
for (int i=0 ; i<buffer.length ; i++){ |
|
191 |
point.setCoordinateAt(i, buffer[i]); |
|
192 |
} |
|
193 |
return point; |
|
194 |
} catch (IOException e) { |
|
195 |
getErrorHandler().addError(e); |
|
196 |
} catch (CreateGeometryException e) { |
|
197 |
getErrorHandler().addError(e); |
|
198 |
} |
|
199 |
return null; |
|
200 |
} |
|
201 |
|
|
202 |
private Point createPoint(double[] buffer){ |
|
203 |
try { |
|
204 |
Point point = null; |
|
205 |
if (buffer.length == 2){ |
|
206 |
point = (Point) geomManager.create(TYPES.POINT, SUBTYPES.GEOM2D); |
|
207 |
}else if (buffer.length == 3){ |
|
208 |
point = (Point) geomManager.create(TYPES.POINT, SUBTYPES.GEOM3D); |
|
209 |
} |
|
210 |
for (int i=0 ; i<buffer.length ; i++){ |
|
211 |
point.setCoordinateAt(i, buffer[i]); |
|
212 |
} |
|
213 |
return point; |
|
214 |
}catch (CreateGeometryException e) { |
|
215 |
getErrorHandler().addError(e); |
|
216 |
} |
|
217 |
return null; |
|
218 |
} |
|
219 |
|
|
220 |
|
|
221 |
/* (non-Javadoc) |
|
222 |
* @see org.gvsig.gpe.parser.GPEContentHandler#startLineString(java.lang.String, org.gvsig.gpe.parser.ICoordinateIterator, java.lang.String) |
|
223 |
*/ |
|
224 |
public Object startLineString(String id, ICoordinateIterator coords, |
|
225 |
String srs) { |
|
226 |
return createCurve(coords); |
|
227 |
} |
|
228 |
|
|
229 |
private Curve createCurve(ICoordinateIterator coords){ |
|
230 |
GeneralPathX gp = createGeneralPathX(coords); |
|
231 |
try { |
|
232 |
Curve curve = null; |
|
233 |
if (coords == null || coords.getDimension() == 2){ |
|
234 |
curve = (Curve) geomManager.create(TYPES.CURVE, SUBTYPES.GEOM2D); |
|
235 |
}else if (coords.getDimension() == 3){ |
|
236 |
curve = (Curve) geomManager.create(TYPES.CURVE, SUBTYPES.GEOM3D); |
|
237 |
} |
|
238 |
curve.setGeneralPath(gp); |
|
239 |
return curve; |
|
240 |
} catch (CreateGeometryException e) { |
|
241 |
getErrorHandler().addError(e); |
|
242 |
} |
|
243 |
return null; |
|
244 |
} |
|
245 |
|
|
246 |
private GeneralPathX createGeneralPathX(ICoordinateIterator coords){ |
|
247 |
GeneralPathX gp = new GeneralPathX(); |
|
248 |
if (coords == null){ |
|
249 |
return gp; |
|
250 |
} |
|
251 |
double[] buffer = new double[coords.getDimension()]; |
|
252 |
try { |
|
253 |
if (coords.hasNext()){ |
|
254 |
coords.next(buffer); |
|
255 |
gp.moveTo(buffer[0], buffer[1]); |
|
256 |
} |
|
257 |
while(coords.hasNext()){ |
|
258 |
coords.next(buffer); |
|
259 |
gp.lineTo(buffer[0], buffer[1]); |
|
260 |
} |
|
261 |
} catch (IOException e) { |
|
262 |
getErrorHandler().addError(e); |
|
263 |
} |
|
264 |
return gp; |
|
265 |
} |
|
266 |
|
|
267 |
/* (non-Javadoc) |
|
268 |
* @see org.gvsig.gpe.parser.GPEContentHandler#startPolygon(java.lang.String, org.gvsig.gpe.parser.ICoordinateIterator, java.lang.String) |
|
269 |
*/ |
|
270 |
|
|
271 |
public Object startPolygon(String id, ICoordinateIterator coords, String srs) { |
|
272 |
return createSurface(coords); |
|
273 |
} |
|
274 |
|
|
275 |
private Surface createSurface(ICoordinateIterator coords){ |
|
276 |
GeneralPathX gp = createGeneralPathX(coords); |
|
277 |
try { |
|
278 |
Surface surface = null; |
|
279 |
if (coords.getDimension() == 2){ |
|
280 |
surface = (Surface) geomManager.create(TYPES.SURFACE, SUBTYPES.GEOM2D); |
|
281 |
}else if (coords.getDimension() == 3){ |
|
282 |
surface = (Surface) geomManager.create(TYPES.SURFACE, SUBTYPES.GEOM3D); |
|
283 |
} |
|
284 |
surface.setGeneralPath(gp); |
|
285 |
return surface; |
|
286 |
} catch (CreateGeometryException e) { |
|
287 |
getErrorHandler().addError(e); |
|
288 |
} |
|
289 |
return null; |
|
290 |
} |
|
291 |
|
|
292 |
|
|
293 |
/* (non-Javadoc) |
|
294 |
* @see org.gvsig.gpe.parser.GPEContentHandler#startInnerPolygon(java.lang.String, org.gvsig.gpe.parser.ICoordinateIterator, java.lang.String) |
|
295 |
*/ |
|
296 |
public Object startInnerPolygon(String id, ICoordinateIterator coords, |
|
297 |
String srs) { |
|
298 |
return createSurface(coords); |
|
299 |
} |
|
300 |
|
|
301 |
/* |
|
302 |
* (non-Javadoc) |
|
303 |
* @see org.gvsig.gpe.IGPEContentHandler#addGeometryToFeature(java.lang.Object, java.lang.Object) |
|
304 |
*/ |
|
305 |
public void addGeometryToFeature(Object geometry, Object feature) { |
|
306 |
((GPEFeature)feature).setGeometry((Geometry)geometry); |
|
307 |
} |
|
308 |
|
|
309 |
/* |
|
310 |
* (non-Javadoc) |
|
311 |
* @see org.gvsig.gpe.IGPEContentHandler#addBboxToLayer(java.lang.Object, java.lang.Object) |
|
312 |
*/ |
|
313 |
public void addBboxToLayer(Object bbox, Object layer) { |
|
314 |
// if (layer != null){ |
|
315 |
// GPEBBox gpeBBox = (GPEBBox)bbox; |
|
316 |
// if (gpeBBox.getSrs() != null){ |
|
317 |
// IProjection projection = null; |
|
318 |
// try{ |
|
319 |
// CRSFactory.getCRS(gpeBBox.getSrs()); |
|
320 |
// }catch(Exception e){ |
|
321 |
// //If the CRS factory has an error. |
|
322 |
// } |
|
323 |
// if ((projection != null) && (!(projection.equals(((FLayer)layer).getProjection())))){ |
|
324 |
// //TODO reproyectar la bbox y asignarsela a la capa |
|
325 |
// } |
|
326 |
// } |
|
327 |
// ((IGPEDriver)layer).setExtent(gpeBBox.getBbox2D()); |
|
328 |
// } |
|
329 |
} |
|
330 |
|
|
331 |
/* |
|
332 |
* (non-Javadoc) |
|
333 |
* @see org.gvsig.gpe.IGPEContentHandler#addElementToFeature(java.lang.Object, java.lang.Object) |
|
334 |
*/ |
|
335 |
public void addElementToFeature(Object element, Object feature) { |
|
336 |
GPEElement gpeElement = (GPEElement)element; |
|
337 |
((GPEFeature)feature).addElement(gpeElement); |
|
338 |
} |
|
339 |
|
|
340 |
/* |
|
341 |
* (non-Javadoc) |
|
342 |
* @see org.gvsig.gpe.IGPEContentHandler#addFeatureToLayer(java.lang.Object, java.lang.Object) |
|
343 |
*/ |
|
344 |
public void addFeatureToLayer(Object feature, Object layer) { |
|
345 |
GPEFeature gpefeature = (GPEFeature)feature; |
|
346 |
Envelope currentEnvelope = gpefeature.getEnvelope(); |
|
347 |
if (featureType == null){ |
|
348 |
createFeatureType(gpefeature); |
|
349 |
|
|
350 |
//Initialize the envelope |
|
351 |
try { |
|
352 |
envelope = geomManager.createEnvelope(SUBTYPES.GEOM2D); |
|
353 |
} catch (CreateEnvelopeException e) { |
|
354 |
getErrorHandler().addError(e); |
|
355 |
} |
|
356 |
//Calculates the envelope |
|
357 |
envelope = currentEnvelope; |
|
358 |
}else{ |
|
359 |
//Calculates the envelope |
|
360 |
if (currentEnvelope != null){ |
|
361 |
envelope.add(currentEnvelope); |
|
362 |
} |
|
363 |
} |
|
364 |
//If it is null is a multilayer: not supported yet |
|
365 |
if (layer != null){ |
|
366 |
FeatureProvider data = new DefaultFeatureProvider(featureType.getNotEditableCopy(), storeProvider.createNewOID()); |
|
367 |
Map elements = gpefeature.getelements(); |
|
368 |
Iterator keys = elements.keySet().iterator(); |
|
369 |
String gid = gpefeature.getId(); |
|
370 |
data.setOID(gid); |
|
371 |
while (keys.hasNext()){ |
|
372 |
String elementName = (String)keys.next(); |
|
373 |
if (featureType.getIndex(elementName) != -1) { |
|
374 |
/* |
|
375 |
* If attribute exists, set its value |
|
376 |
* (if a field description was not properly parsed in the |
|
377 |
* feature type description (previous http request) then |
|
378 |
* perhaps it's not available in featureType) |
|
379 |
*/ |
|
380 |
data.set(elementName, ((GPEElement)elements.get(elementName)).getValue()); |
|
381 |
} |
|
382 |
} |
|
383 |
data.setDefaultGeometry(gpefeature.getGeometry()); |
|
384 |
data.set(featureType.getDefaultGeometryAttributeIndex(), gpefeature.getGeometry()); |
|
385 |
((HashMap)layer).put(gid, data); |
|
386 |
} |
|
387 |
} |
|
388 |
|
|
389 |
private void createFeatureType(GPEFeature gpefeature){ |
|
390 |
featureType = store.createFeatureType(); |
|
391 |
|
|
392 |
//Adding the Geometry field |
|
393 |
EditableFeatureAttributeDescriptor attributeDescriptor = featureType.add("the_geom", DataTypes.GEOMETRY).setGeometryType(geometryType); |
|
394 |
attributeDescriptor.setGeometrySubType(SUBTYPES.GEOM2D); |
|
395 |
attributeDescriptor.setSRS(srs); |
|
396 |
featureType.setDefaultGeometryAttributeName("the_geom"); |
|
397 |
|
|
398 |
//Adding the ID |
|
399 |
EditableFeatureAttributeDescriptor ed = featureType.add("gid", DataTypes.LONG); |
|
400 |
ed.setSize(10); |
|
401 |
|
|
402 |
featureType.setHasOID(true); |
|
403 |
|
|
404 |
if (gpefeature != null){ |
|
405 |
Map elements = gpefeature.getelements(); |
|
406 |
Iterator keys = elements.keySet().iterator(); |
|
407 |
while (keys.hasNext()){ |
|
408 |
String elementName = (String)keys.next(); |
|
409 |
if (!elementName.equals("the_geom") && !elementName.equals("gid")){ |
|
410 |
ed = featureType.add(elementName, DataTypes.STRING); |
|
411 |
ed.setSize(80); |
|
412 |
} |
|
413 |
} |
|
414 |
} |
|
415 |
|
|
416 |
FeatureType defaultType = featureType.getNotEditableCopy(); |
|
417 |
List types = new ArrayList(1); |
|
418 |
types.add(defaultType); |
|
419 |
this.store.setFeatureTypes(types, defaultType); |
|
420 |
} |
|
421 |
|
|
422 |
/* |
|
423 |
* (non-Javadoc) |
|
424 |
* @see org.gvsig.gpe.IGPEContentHandler#addInnerPolygonToPolygon(java.lang.Object, java.lang.Object) |
|
425 |
*/ |
|
426 |
public void addInnerPolygonToPolygon(Object innerPolygon, Object Polygon) { |
|
427 |
//((Geometry)Polygon).addGeometry((GPEGeometry)innerPolygon); |
|
428 |
} |
|
429 |
|
|
430 |
/* |
|
431 |
* (non-Javadoc) |
|
432 |
* @see org.gvsig.gpe.IGPEContentHandler#addNameToFeature(java.lang.String, java.lang.Object) |
|
433 |
*/ |
|
434 |
public void addNameToFeature(String name, Object feature) { |
|
435 |
|
|
436 |
} |
|
437 |
|
|
438 |
/* |
|
439 |
* (non-Javadoc) |
|
440 |
* @see org.gvsig.gpe.IGPEContentHandler#addParentElementToElement(java.lang.Object, java.lang.Object) |
|
441 |
*/ |
|
442 |
public void addParentElementToElement(Object parent, Object element) { |
|
443 |
|
|
444 |
} |
|
445 |
|
|
446 |
/* |
|
447 |
* (non-Javadoc) |
|
448 |
* @see org.gvsig.gpe.IGPEContentHandler#addSrsToLayer(java.lang.String, java.lang.Object) |
|
449 |
*/ |
|
450 |
public void addSrsToLayer(String srs, Object Layer) { |
|
451 |
// this.srs = srs; |
|
452 |
} |
|
453 |
|
|
454 |
|
|
455 |
/* (non-Javadoc) |
|
456 |
* @see org.gvsig.gpe.parser.GPEContentHandler#startBbox(java.lang.String, org.gvsig.gpe.parser.ICoordinateIterator, java.lang.String) |
|
457 |
*/ |
|
458 |
public Object startBbox(String id, ICoordinateIterator coords, String srs) { |
|
459 |
Envelope envelope = null; |
|
460 |
try { |
|
461 |
if (coords.getDimension() == 2){ |
|
462 |
envelope = geomManager.createEnvelope(SUBTYPES.GEOM2D); |
|
463 |
}else if (coords.getDimension() == 3){ |
|
464 |
envelope = geomManager.createEnvelope(SUBTYPES.GEOM3D); |
|
465 |
} |
|
466 |
double[] buffer = new double[coords.getDimension()]; |
|
467 |
|
|
468 |
if (coords.hasNext()){ |
|
469 |
coords.next(buffer); |
|
470 |
envelope.setLowerCorner(createPoint(buffer)); |
|
471 |
} |
|
472 |
if (coords.hasNext()){ |
|
473 |
coords.next(buffer); |
|
474 |
envelope.setUpperCorner(createPoint(buffer)); |
|
475 |
} |
|
476 |
} catch (IOException e) { |
|
477 |
getErrorHandler().addError(e); |
|
478 |
} catch (CreateEnvelopeException e) { |
|
479 |
getErrorHandler().addError(e); |
|
480 |
} |
|
481 |
return envelope; |
|
482 |
} |
|
483 |
|
|
484 |
/* |
|
485 |
* (non-Javadoc) |
|
486 |
* @see org.gvsig.gpe.parser.GPEContentHandler#startElement(java.lang.String, java.lang.String, java.lang.Object, org.gvsig.gpe.parser.IAttributesIterator, java.lang.Object) |
|
487 |
*/ |
|
488 |
public Object startElement(String namespace, String name, Object value, |
|
489 |
IAttributesIterator attributesIterator, Object parentElement) { |
|
490 |
return new GPEElement(name, value, (GPEElement)parentElement); |
|
491 |
} |
|
492 |
|
|
493 |
/* |
|
494 |
* (non-Javadoc) |
|
495 |
* @see org.gvsig.gpe.parser.GPEContentHandler#startFeature(java.lang.String, java.lang.String, java.lang.String, org.gvsig.gpe.parser.IAttributesIterator, java.lang.Object) |
|
496 |
*/ |
|
497 |
public Object startFeature(String id, String namespace, String name, |
|
498 |
IAttributesIterator attributes, Object layer){ |
|
499 |
String sId; |
|
500 |
if (id == null){ |
|
501 |
sId = new String(new Long(featureId).toString()); |
|
502 |
}else{ |
|
503 |
sId = id; |
|
504 |
} |
|
505 |
featureId++; |
|
506 |
//Check the xml schema... |
|
507 |
// for (int i=0 ; i<schemas.size() ; i++){ |
|
508 |
// IXSSchema schema = schemas.get(i); |
|
509 |
// IXSElementDeclaration element = schema.getElementDeclarationByName(namespace, name); |
|
510 |
// if (element != null){ |
|
511 |
// featureType = store.createFeatureType(); |
|
512 |
// IXSTypeDefinition type = element.getTypeDefinition(); |
|
513 |
// if (type instanceof IXSComplexTypeDefinition){ |
|
514 |
// IXSComplexTypeDefinition complexType = (IXSComplexTypeDefinition)type; |
|
515 |
// complexType.getContentType(). |
|
516 |
// } |
|
517 |
// |
|
518 |
// featureType.add("the_geom", DataTypes.GEOMETRY).setGeometryType(TYPES.GEOMETRY); |
|
519 |
// featureType.setDefaultGeometryAttributeName("the_geom"); |
|
520 |
// featureType.setHasOID(true); |
|
521 |
// while (keys.hasNext()){ |
|
522 |
// String elementName = (String)keys.next(); |
|
523 |
// featureType.add(elementName, DataTypes.STRING); |
|
524 |
// } |
|
525 |
// FeatureType defaultType = featureType.getNotEditableCopy(); |
|
526 |
// List types = new ArrayList(1); |
|
527 |
// types.add(defaultType); |
|
528 |
// this.store.setFeatureTypes(types, defaultType); |
|
529 |
// |
|
530 |
// //Initialize the envelope |
|
531 |
// try { |
|
532 |
// envelope = geomManager.createEnvelope(SUBTYPES.GEOM2D); |
|
533 |
// } catch (CreateEnvelopeException e) { |
|
534 |
// getErrorHandler().addError(e); |
|
535 |
// } |
|
536 |
// } |
|
537 |
// } |
|
538 |
return new GPEFeature(sId, |
|
539 |
name, name); |
|
540 |
} |
Also available in: Unified diff