Revision 2026

View differences:

org.gvsig.gpe/library/trunk/org.gvsig.gpe/org.gvsig.gpe.app/org.gvsig.gpe.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml
53 53
      <useTransitiveDependencies>false</useTransitiveDependencies>
54 54
      <outputDirectory>lib</outputDirectory>
55 55
      <includes>
56
    	<include>org.gvsig:org.gvsig.gpe.dal</include>
56 57
    	<include>org.gvsig:org.gvsig.gpe.lib.api</include>
57 58
    	<include>org.gvsig:org.gvsig.gpe.lib.spi</include>
58 59
    	<include>org.gvsig:org.gvsig.gpe.lib.impl</include>
org.gvsig.gpe/library/trunk/org.gvsig.gpe/org.gvsig.gpe.app/org.gvsig.gpe.app.mainplugin/src/main/java/org/gvsig/fmap/dal/store/gpe/GPEFileSystemServerProvider.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 org.apache.commons.io.FilenameUtils;
32
import org.apache.commons.lang3.StringUtils;
33

  
34
import org.gvsig.fmap.dal.DALLocator;
35
import org.gvsig.fmap.dal.DataServerExplorer;
36
import org.gvsig.fmap.dal.DataStoreParameters;
37
import org.gvsig.fmap.dal.NewDataStoreParameters;
38
import org.gvsig.fmap.dal.exception.CreateException;
39
import org.gvsig.fmap.dal.exception.DataException;
40
import org.gvsig.fmap.dal.exception.RemoveException;
41
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
42
import org.gvsig.fmap.dal.feature.exception.CreateGeometryException;
43
import org.gvsig.fmap.dal.resource.spi.ResourceConsumer;
44
import org.gvsig.fmap.dal.resource.spi.ResourceProvider;
45
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer;
46
import org.gvsig.fmap.dal.serverexplorer.filesystem.impl.AbstractFilesystemServerExplorerProvider;
47
import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider;
48
import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderServices;
49
import org.gvsig.fmap.geom.Geometry;
50
import org.gvsig.fmap.geom.GeometryLocator;
51
import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
52
import org.gvsig.fmap.geom.primitive.Envelope;
53
import org.gvsig.gpe.lib.api.GPELocator;
54
import org.gvsig.gpe.lib.api.GPEManager;
55
import org.gvsig.tools.locator.LocatorException;
56

  
57
/**
58
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
59
 */
60
public class GPEFileSystemServerProvider extends AbstractFilesystemServerExplorerProvider 
61
	implements FilesystemServerExplorerProvider, ResourceConsumer {
62
	protected FilesystemServerExplorerProviderServices serverExplorer;
63

  
64
	private static final GPEManager GPE_MANAGER = GPELocator.getGPEManager();
65
	
66
	public boolean canCreate() {
67
		// TODO Auto-generated method stub
68
		return false;
69
	}
70
	
71
	public int getMode() {
72
		return DataServerExplorer.MODE_FEATURE | DataServerExplorer.MODE_GEOMETRY;
73
	}
74

  
75
	public boolean canCreate(NewDataStoreParameters parameters) {
76
		return false;
77
	}
78

  
79
	public void create(NewDataStoreParameters parameters, boolean overwrite)
80
	throws CreateException {
81
		// TODO Auto-generated method stub
82

  
83
	}
84

  
85
	public NewDataStoreParameters getCreateParameters() throws DataException {
86
		
87
		GPEStoreParameters np = new GPEStoreParameters();
88
		Envelope env = null;
89
		try {
90
			env = GeometryLocator.getGeometryManager().createEnvelope(
91
					-180, -90, 180, 90, Geometry.SUBTYPES.GEOM2D);
92
		} catch (Exception e) {
93
			throw new CreateGeometryException(e);
94
		}
95
		np.setEnvelope(env);
96
		// =================================
97
		np.setDefaultFeatureType(this.serverExplorer
98
				.getServerExplorerProviderServices().createNewFeatureType());
99
		return np;
100
	}
101

  
102
	public void initialize(
103
			FilesystemServerExplorerProviderServices serverExplorer) {
104
		this.serverExplorer = serverExplorer;		
105
	}
106

  
107
	public void remove(DataStoreParameters parameters) throws RemoveException {
108
		// TODO Auto-generated method stub
109

  
110
	}
111

  
112
	public String getDataStoreProviderName() {
113
		return GPEStoreProvider.NAME;
114
	}
115

  
116
	public String getDescription() {
117
		return GPEStoreProvider.DESCRIPTION;
118
	}
119

  
120
	public boolean accept(File pathName) {
121
        if(StringUtils.endsWithIgnoreCase(pathName.getName(), ".gml")){
122
            return false;
123
        }
124
	    return GPE_MANAGER.accept(pathName.toURI());	   
125
	}
126

  
127
	public boolean closeResourceRequested(ResourceProvider resource) {
128
		// TODO Auto-generated method stub
129
		return false;
130
	}
131

  
132
	public void resourceChanged(ResourceProvider resource) {
133
		// TODO Auto-generated method stub
134

  
135
	}
136

  
137
}
138

  
org.gvsig.gpe/library/trunk/org.gvsig.gpe/org.gvsig.gpe.app/org.gvsig.gpe.app.mainplugin/src/main/java/org/gvsig/fmap/dal/store/gpe/GPESetProvider.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.util.HashMap;
31
import java.util.Iterator;
32

  
33
import org.gvsig.fmap.dal.exception.DataException;
34
import org.gvsig.fmap.dal.feature.FeatureQuery;
35
import org.gvsig.fmap.dal.feature.FeatureType;
36
import org.gvsig.fmap.dal.feature.spi.AbstractFeatureProviderIterator;
37
import org.gvsig.fmap.dal.feature.spi.AbstractFeatureSetProvider;
38
import org.gvsig.tools.exception.BaseException;
39

  
40
/**
41
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
42
 */
43
public class GPESetProvider extends AbstractFeatureSetProvider {
44

  
45
	public GPESetProvider(GPEStoreProvider store,
46
			FeatureQuery query) {
47
		super(store, query, null);
48
	}
49

  
50
	public GPESetProvider(GPEStoreProvider store,
51
			FeatureQuery query, FeatureType featureType) {
52
		super(store, query, featureType);
53
	}
54

  
55
	/* (non-Javadoc)
56
	 * @see org.gvsig.fmap.dal.feature.spi.FeatureSetProvider#canFilter()
57
	 */
58
	public boolean canFilter() {
59
		// TODO Auto-generated method stub
60
		return false;
61
	}
62

  
63
	/* (non-Javadoc)
64
	 * @see org.gvsig.fmap.dal.feature.spi.FeatureSetProvider#canIterateFromIndex()
65
	 */
66
	public boolean canIterateFromIndex() {
67
		// TODO Auto-generated method stub
68
		return false;
69
	}
70

  
71
	/* (non-Javadoc)
72
	 * @see org.gvsig.fmap.dal.feature.spi.FeatureSetProvider#canOrder()
73
	 */
74
	public boolean canOrder() {
75
		// TODO Auto-generated method stub
76
		return false;
77
	}
78

  
79
	/* (non-Javadoc)
80
	 * @see org.gvsig.fmap.dal.feature.spi.FeatureSetProvider#getSize()
81
	 */
82
	public long getSize() throws DataException {
83
		return getStore().getFeatureCount();
84
	}
85

  
86
	/* (non-Javadoc)
87
	 * @see org.gvsig.fmap.dal.feature.spi.FeatureSetProvider#isEmpty()
88
	 */
89
	public boolean isEmpty() throws DataException {
90
		// TODO Auto-generated method stub
91
		return false;
92
	}
93

  
94
	protected AbstractFeatureProviderIterator createFastIterator(long index)
95
			throws DataException {
96
		return new GPEFastIterator((GPEStoreProvider) getStore(),
97
				getFeatureType());
98
	}
99

  
100
	protected AbstractFeatureProviderIterator createIterator(long index)
101
			throws DataException {
102
		return new GPEIterator((GPEStoreProvider) getStore(), getFeatureType());
103
	}
104

  
105
	protected class GPEIterator extends AbstractFeatureProviderIterator {
106
		protected FeatureType type;
107
		Iterator keys = null;
108
		HashMap features = null;
109

  
110
		public GPEIterator(GPEStoreProvider store, FeatureType type)
111
				throws DataException {
112
			super(store);
113
			this.type = type;
114
			features = store.getContentHandler().getFeatureSet();
115
			keys = features.keySet().iterator();
116
		}
117

  
118
		protected boolean internalHasNext() {
119
			return keys.hasNext();
120
		}
121

  
122
		protected Object internalNext() {
123
			return features.get(keys.next());
124
		}
125

  
126
		/*
127
		 * (non-Javadoc)
128
		 * @see java.util.Iterator#remove()
129
		 */
130
		public void remove() {
131
			throw new UnsupportedOperationException();
132
		}
133

  
134
		protected void doDispose() throws BaseException {
135
			
136
		}
137
	}
138
	
139
	protected class GPEFastIterator extends GPEIterator {
140

  
141
		public GPEFastIterator(GPEStoreProvider store, FeatureType type) throws DataException {
142
			super(store, type);
143
		}
144
	}
145

  
146
	protected void doDispose() throws BaseException {
147
		// Nothing to do
148
	}
149
}
150

  
org.gvsig.gpe/library/trunk/org.gvsig.gpe/org.gvsig.gpe.app/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
                getGPEParameters().getUseAxisOrderYX()
272
            );
273
            if (getStoreServices().getDefaultFeatureType() != null){
274
                contentHandler.setFeatureType(getStoreServices().getDefaultFeatureType().getEditable());
275
            }
276
            contentHandler.setEnvelope((Envelope)getDynValue("Envelope"));
277
            isOpen = true;
278
            gpeManager.parse(contentHandler, errorHandler, m_Fich.toURI());			
279
        } catch (Exception e) {
280
            throw new OpenException("Imposible create a parser",e);
281
        }
282
        if (errorHandler.getErrorsSize()>0) {
283
            throw new OpenException("Error when open gpe",errorHandler.getErrorAt(0));
284
        }
285
    }
286

  
287
    protected IProjection getSRS(){
288
        return getGPEParameters().getCRS();
289
    }	
290

  
291
    protected int getGeometryType() {
292
        return TYPES.GEOMETRY;
293
    }
294

  
295
    /* (non-Javadoc)
296
     * @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#createSet(org.gvsig.fmap.dal.feature.FeatureQuery, org.gvsig.fmap.dal.feature.FeatureType)
297
     */
298
    public FeatureSetProvider createSet(FeatureQuery query,
299
        FeatureType featureType) throws DataException {
300
        return new GPESetProvider(this, query, featureType);
301
    }
302

  
303
    public long getFeatureCount() throws DataException {		
304
        return contentHandler.getFeaturesCount();
305
    }
306

  
307
    /* (non-Javadoc)
308
     * @see org.gvsig.fmap.dal.feature.spi.AbstractFeatureStoreProvider#getEnvelope()
309
     */
310
    public Envelope getEnvelope() throws DataException {
311
        this.open();
312
        return (Envelope) this.getDynValue("Envelope");
313
    }
314

  
315
    public void setEnvelope(Envelope envelope) {
316
        this.setDynValue("Envelope", envelope);
317
    }
318

  
319
    public ResourceProvider getResource() {
320
        return gpeResource;
321
    }
322

  
323
    public DataServerExplorer getExplorer() throws ReadException,
324
    ValidateDataParametersException {
325
        DataManager manager = DALLocator.getDataManager();
326
        FilesystemServerExplorerParameters params;
327
        try {
328
            params = (FilesystemServerExplorerParameters) manager
329
            .createServerExplorerParameters(FilesystemServerExplorer.NAME);
330
            params.setRoot(this.getGPEParameters().getFile().getParent());
331
            return manager.createServerExplorer(params);
332
        } catch (DataException e) {
333
            throw new ReadException(this.getProviderName(), e);
334
        } catch (ValidateDataParametersException e) {
335
            // TODO Auto-generated catch block
336
            throw new ReadException(this.getProviderName(), e);
337
        }
338
    }
339

  
340
    /**
341
     * @return the contentHandler
342
     */
343
    public FmapContentHandler getContentHandler() {
344
        return contentHandler;
345
    }
346

  
347
    /**
348
     * @return the errorHandler
349
     */
350
    public FmapErrorHandler getErrorHandler() {
351
        return errorHandler;
352
    }
353

  
354
}
org.gvsig.gpe/library/trunk/org.gvsig.gpe/org.gvsig.gpe.app/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
import org.apache.commons.lang3.BooleanUtils;
32

  
33
import org.cresques.cts.IProjection;
34
import org.gvsig.fmap.dal.DataStore;
35
import org.gvsig.fmap.dal.FileHelper;
36
import org.gvsig.fmap.dal.feature.EditableFeatureType;
37
import org.gvsig.fmap.dal.feature.FeatureType;
38
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
39
import org.gvsig.fmap.dal.feature.OpenFeatureStoreParameters;
40
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
41
import org.gvsig.fmap.dal.spi.AbstractDataStoreParameters;
42
import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
43
import org.gvsig.fmap.geom.primitive.Envelope;
44
import org.gvsig.gpe.lib.api.GPELocator;
45
import org.gvsig.gpe.lib.api.GPEManager;
46
import org.gvsig.gpe.lib.api.exceptions.ParserCreationException;
47
import org.gvsig.tools.ToolsLocator;
48
import org.gvsig.tools.dataTypes.CoercionException;
49
import org.gvsig.tools.dataTypes.DataTypesManager;
50
import org.gvsig.tools.dynobject.DelegatedDynObject;
51
import org.gvsig.tools.dynobject.DynStruct;
52
import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException;
53
import org.gvsig.tools.locator.LocatorException;
54
import org.slf4j.Logger;
55
import org.slf4j.LoggerFactory;
56

  
57
/**
58
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
59
 */
60
public class GPEStoreParameters extends AbstractDataStoreParameters implements
61
OpenFeatureStoreParameters, FilesystemStoreParameters,
62
NewFeatureStoreParameters {
63

  
64
    public static final String PARAMETERS_DEFINITION_NAME = "GPEStoreParameters";
65

  
66
    private static final String FILE_PARAMETER_NAME = "File";
67
    private static final String CRS_PARAMETER_NAME = "CRS";
68
    private static final String ENVELOPE_PARAMETER_NAME = "Envelope";
69
    private static final String FEATURETYPE_PARAMETER_NAME = "FeatureType";
70

  
71
    private DelegatedDynObject parameters;
72

  
73
    private static Logger logger = LoggerFactory.getLogger(GPEStoreParameters.class);
74

  
75
    public GPEStoreParameters() {
76
        this(PARAMETERS_DEFINITION_NAME);
77
    }
78

  
79
    protected GPEStoreParameters(String parametersDefinitionName) {
80
        this(parametersDefinitionName, GPEStoreProvider.NAME);
81
    }
82

  
83
    public GPEStoreParameters(String parametersDefinitionName, String name) {
84
        super();
85
        this.parameters = (DelegatedDynObject) FileHelper.newParameters(parametersDefinitionName);
86
        this.setDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME, name);
87
    }
88

  
89
    protected static void registerParametersDefinition(){
90
        DynStruct dynStruct = FileHelper.registerParametersDefinition(
91
            GPEStoreParameters.PARAMETERS_DEFINITION_NAME,
92
            GPEStoreParameters.class, "GPEParameters.xml");
93

  
94
        dynStruct.addDynFieldObject(ENVELOPE_PARAMETER_NAME).
95
        setClassOfValue(Envelope.class).setMandatory(false);
96

  
97
        dynStruct.addDynFieldObject(FEATURETYPE_PARAMETER_NAME).
98
        setClassOfValue(FeatureType.class).setMandatory(false);
99
    }
100

  
101
    protected DelegatedDynObject getDelegatedDynObject() {
102
        return parameters;
103
    }
104

  
105
    public String getDataStoreName() {
106
        return GPEStoreProvider.NAME;
107
    }
108

  
109
    public String getDescription() {
110
        return GPEStoreProvider.DESCRIPTION;
111
    }
112

  
113
    public boolean isValid() {
114
        return (this.getFile() != null);
115
    }
116

  
117
    public File getFile() {
118
        return (File) this.getDynValue(FILE_PARAMETER_NAME);
119
    }
120

  
121
    public void setFile(File file) {
122
        this.setDynValue(FILE_PARAMETER_NAME, file);
123
    }
124

  
125
    public String getFileName() {
126
        return this.getFile().getAbsolutePath();
127
    }
128

  
129
    public void setFileName(String fileName) {
130
        this.setDynValue(FILE_PARAMETER_NAME, fileName);
131
    }
132

  
133
    public IProjection getCRS() {
134
        return (IProjection) this.getDynValue(CRS_PARAMETER_NAME);
135
    }
136

  
137
    public void setCRS(IProjection srs) {
138
        this.setDynValue(CRS_PARAMETER_NAME, srs);
139
    }
140

  
141
    public void setCRS(String srs) {
142
        this.setDynValue(CRS_PARAMETER_NAME, srs);
143
    }
144

  
145
    public Envelope getEnvelope() {
146
        return (Envelope) this.getDynValue(ENVELOPE_PARAMETER_NAME);
147
    }
148

  
149
    public void setEnvelope(Envelope envelope) {
150
        this.setDynValue(ENVELOPE_PARAMETER_NAME, envelope);
151
    }
152

  
153
    public void setDynValue(String name, Object val) {
154
    	super.setDynValue(name, val);
155
    }
156

  
157
    public boolean getUseAxisOrderYX()  {
158
        boolean x = BooleanUtils.isTrue((Boolean) this.getDynValue("useAxisOrderYX"));
159
        return x;
160
    }
161

  
162
	public EditableFeatureType getDefaultFeatureType() {
163
		return (EditableFeatureType) this.getDynValue(FEATURETYPE_PARAMETER_NAME);
164
	}
165

  
166
	public void setDefaultFeatureType(FeatureType featureType) {
167
		this.setDynValue(FEATURETYPE_PARAMETER_NAME, featureType);
168
	}
169

  
170
    public Object getDynValue(String name) throws DynFieldNotFoundException {
171
        if (DataStore.METADATA_CRS.equalsIgnoreCase(name)) {
172
            try {
173
                GPEManager gpeManager=GPELocator.getGPEManager();
174
                String crs=gpeManager.getDefaultProjection(getFile());
175
                DataTypesManager dataTypesManager=ToolsLocator.getDataTypesManager();
176
                IProjection projection=(IProjection) dataTypesManager.coerce(org.cresques.DataTypes.CRS, crs);
177
                if (projection!=null){
178
                    setCRS(projection);
179
                }
180
            } catch (LocatorException  | ParserCreationException | CoercionException e) {
181
                logger.warn("Couldn't get default projection",e);
182
            }
183
        }
184
        return super.getDynValue(name);
185
    }
186
}
org.gvsig.gpe/library/trunk/org.gvsig.gpe/org.gvsig.gpe.app/org.gvsig.gpe.app.mainplugin/pom.xml
1 1
<?xml version="1.0" encoding="ISO-8859-1"?>
2 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>
3
    <modelVersion>4.0.0</modelVersion>
4
    <artifactId>org.gvsig.gpe.app.mainplugin</artifactId>
5
    <packaging>jar</packaging>
6 6
  
7
  <name>org.gvsig.gpe.app.mainplugin</name>
7
    <name>org.gvsig.gpe.app.mainplugin</name>
8 8
  
9
  <parent>
10
    <groupId>org.gvsig</groupId>
11
    <artifactId>org.gvsig.gpe.app</artifactId>
12
    <version>2.1.261-SNAPSHOT</version>
13
  </parent>
9
    <parent>
10
        <groupId>org.gvsig</groupId>
11
        <artifactId>org.gvsig.gpe.app</artifactId>
12
        <version>2.1.261-SNAPSHOT</version>
13
    </parent>
14 14

  
15
  <dependencies>
15
    <dependencies>
16 16
        <dependency>
17 17
            <groupId>org.slf4j</groupId>
18 18
            <artifactId>slf4j-api</artifactId>
19 19
            <scope>compile</scope>
20 20
        </dependency>
21
		<dependency>
22
			<groupId>org.gvsig</groupId>
23
			<artifactId>org.gvsig.gpe.lib.api</artifactId>
21
        <dependency>
22
            <groupId>org.gvsig</groupId>
23
            <artifactId>org.gvsig.gpe.dal</artifactId>
24 24
            <scope>compile</scope>
25
		</dependency>			
26
		<dependency>
27
			<groupId>org.gvsig</groupId>
28
			<artifactId>org.gvsig.gpe.lib.impl</artifactId>
25
        </dependency>			
26
        <dependency>
27
            <groupId>org.gvsig</groupId>
28
            <artifactId>org.gvsig.gpe.lib.api</artifactId>
29 29
            <scope>compile</scope>
30
		</dependency>	
30
        </dependency>			
31
        <dependency>
32
            <groupId>org.gvsig</groupId>
33
            <artifactId>org.gvsig.gpe.lib.impl</artifactId>
34
            <scope>compile</scope>
35
        </dependency>	
31 36
		
32
		<dependency>
33
			<groupId>org.gvsig</groupId>
34
			<artifactId>org.gvsig.gpe.lib.spi</artifactId>
37
        <dependency>
38
            <groupId>org.gvsig</groupId>
39
            <artifactId>org.gvsig.gpe.lib.spi</artifactId>
35 40
            <scope>runtime</scope>
36
		</dependency>				
37
		<dependency>
38
			<groupId>org.gvsig</groupId>
39
			<artifactId>org.gvsig.xmlschema.lib.api</artifactId>
41
        </dependency>				
42
        <dependency>
43
            <groupId>org.gvsig</groupId>
44
            <artifactId>org.gvsig.xmlschema.lib.api</artifactId>
40 45
            <scope>compile</scope>
41
		</dependency>
42
		<dependency>
43
			<groupId>org.gvsig</groupId>
44
			<artifactId>org.gvsig.xmlschema.lib.impl</artifactId>
45
			<scope>runtime</scope>
46
		</dependency>
47
		<dependency>
46
        </dependency>
47
        <dependency>
48 48
            <groupId>org.gvsig</groupId>
49
            <artifactId>org.gvsig.xmlschema.lib.impl</artifactId>
50
            <scope>runtime</scope>
51
        </dependency>
52
        <dependency>
53
            <groupId>org.gvsig</groupId>
49 54
            <artifactId>org.gvsig.xmlschema.lib.spi</artifactId>
50 55
            <scope>runtime</scope>
51 56
        </dependency> 
......
54 59
            <artifactId>org.gvsig.xmlschema.prov.kxml</artifactId>
55 60
            <scope>runtime</scope>
56 61
        </dependency>     	
57
	    <dependency>
58
        	<groupId>org.gvsig</groupId>
62
        <dependency>
63
            <groupId>org.gvsig</groupId>
59 64
            <artifactId>org.gvsig.projection.api</artifactId>
60 65
            <scope>compile</scope>
61 66
        </dependency>
62
		<dependency>
63
			<groupId>org.gvsig</groupId>
64
			<artifactId>org.gvsig.andami</artifactId>
67
        <dependency>
68
            <groupId>org.gvsig</groupId>
69
            <artifactId>org.gvsig.andami</artifactId>
65 70
            <scope>compile</scope>
66
		</dependency>
67
		<dependency>
68
			<groupId>org.gvsig</groupId>
69
			<artifactId>org.gvsig.app.mainplugin</artifactId>
71
        </dependency>
72
        <dependency>
73
            <groupId>org.gvsig</groupId>
74
            <artifactId>org.gvsig.app.mainplugin</artifactId>
70 75
            <scope>compile</scope>
71
		</dependency>
72
		<dependency>
73
			<groupId>org.gvsig</groupId>
74
			<artifactId>org.gvsig.fmap.dal.api</artifactId>
76
        </dependency>
77
        <dependency>
78
            <groupId>org.gvsig</groupId>
79
            <artifactId>org.gvsig.fmap.dal.api</artifactId>
75 80
            <scope>compile</scope>
76
		</dependency>
81
        </dependency>
77 82
        <dependency>
78 83
            <groupId>org.gvsig</groupId>
79 84
            <artifactId>org.gvsig.fmap.dal.spi</artifactId>
......
119 124
        
120 125
        
121 126
        <!-- tests --> 
122
	    <dependency>
123
    	    <groupId>org.gvsig</groupId>
124
        	<artifactId>org.gvsig.fmap.dal.impl</artifactId>
125
        	<type>test-jar</type>
126
        	<scope>test</scope>
127
    	</dependency>
127
        <dependency>
128
            <groupId>org.gvsig</groupId>
129
            <artifactId>org.gvsig.fmap.dal.impl</artifactId>
130
            <type>test-jar</type>
131
            <scope>test</scope>
132
        </dependency>
128 133
        
129
		<!-- runtime -->
130
		<dependency>
131
			<groupId>org.gvsig</groupId>
132
			<artifactId>org.gvsig.gpe.prov.xml</artifactId>
133
			<scope>runtime</scope>
134
		</dependency>
135
		<dependency>
136
			<groupId>org.gvsig</groupId>
137
			<artifactId>org.gvsig.gpe.prov.gml</artifactId>
138
			<scope>runtime</scope>
139
		</dependency>	
140
		<dependency>
141
			<groupId>org.gvsig</groupId>
142
			<artifactId>org.gvsig.gpe.prov.kml</artifactId>
143
			<scope>runtime</scope>
144
		</dependency>	
145
		<dependency>
146
			<groupId>org.gvsig</groupId>
147
			<artifactId>org.gvsig.xmlpull.lib.api</artifactId>
148
			<scope>runtime</scope>
149
		</dependency>
150
		<dependency>
151
			<groupId>org.gvsig</groupId>
152
			<artifactId>org.gvsig.xmlpull.lib.spi</artifactId>
153
			<scope>runtime</scope>
154
		</dependency>
155
		<dependency>
156
			<groupId>org.gvsig</groupId>
157
			<artifactId>org.gvsig.xmlpull.lib.impl</artifactId>
158
			<scope>runtime</scope>
159
		</dependency>
160
		<dependency>
161
			<groupId>org.gvsig</groupId>
162
			<artifactId>org.gvsig.xmlpull.prov.stax</artifactId>
163
			<scope>runtime</scope>
164
		</dependency>	
165
		<dependency>
166
			<groupId>org.gvsig</groupId>
167
			<artifactId>org.gvsig.xmlpull.prov.kxml</artifactId>
168
			<scope>runtime</scope>
169
		</dependency>	
134
        <!-- runtime -->
170 135
        <dependency>
136
            <groupId>org.gvsig</groupId>
137
            <artifactId>org.gvsig.gpe.prov.xml</artifactId>
138
            <scope>runtime</scope>
139
        </dependency>
140
        <dependency>
141
            <groupId>org.gvsig</groupId>
142
            <artifactId>org.gvsig.gpe.prov.gml</artifactId>
143
            <scope>runtime</scope>
144
        </dependency>	
145
        <dependency>
146
            <groupId>org.gvsig</groupId>
147
            <artifactId>org.gvsig.gpe.prov.kml</artifactId>
148
            <scope>runtime</scope>
149
        </dependency>	
150
        <dependency>
151
            <groupId>org.gvsig</groupId>
152
            <artifactId>org.gvsig.xmlpull.lib.api</artifactId>
153
            <scope>runtime</scope>
154
        </dependency>
155
        <dependency>
156
            <groupId>org.gvsig</groupId>
157
            <artifactId>org.gvsig.xmlpull.lib.spi</artifactId>
158
            <scope>runtime</scope>
159
        </dependency>
160
        <dependency>
161
            <groupId>org.gvsig</groupId>
162
            <artifactId>org.gvsig.xmlpull.lib.impl</artifactId>
163
            <scope>runtime</scope>
164
        </dependency>
165
        <dependency>
166
            <groupId>org.gvsig</groupId>
167
            <artifactId>org.gvsig.xmlpull.prov.stax</artifactId>
168
            <scope>runtime</scope>
169
        </dependency>	
170
        <dependency>
171
            <groupId>org.gvsig</groupId>
172
            <artifactId>org.gvsig.xmlpull.prov.kxml</artifactId>
173
            <scope>runtime</scope>
174
        </dependency>	
175
        <dependency>
171 176
            <groupId>jfree</groupId>
172 177
            <artifactId>jcommon</artifactId>
173 178
            <scope>compile</scope>
174 179
        </dependency>
175 180
        
176
		<!--
177
		<dependency>
178
			<groupId>org.gvsig</groupId>
179
			<artifactId>org.gvsig.fmap.dal.index.spatial</artifactId>
180
			<classifier>jts</classifier>
181
			<scope>test</scope>
182
		</dependency>
183
		
181
        <!--
182
                <dependency>
183
                        <groupId>org.gvsig</groupId>
184
                        <artifactId>org.gvsig.fmap.dal.index.spatial</artifactId>
185
                        <classifier>jts</classifier>
186
                        <scope>test</scope>
187
                </dependency>
188
                
184 189
        <dependency>
185 190
                <groupId>org.gvsig</groupId>
186 191
                <artifactId>org.gvsig.fmap.geometry.generalpath</artifactId>
org.gvsig.gpe/library/trunk/org.gvsig.gpe/org.gvsig.gpe.dal/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.dal</artifactId>
5
  <packaging>jar</packaging>
6
  
7
  <name>${project.artifactId}</name>
8
  
9
  <parent>
10
    <groupId>org.gvsig</groupId>
11
    <artifactId>org.gvsig.gpe</artifactId>
12
    <version>2.1.261-SNAPSHOT</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
		<dependency>
38
			<groupId>org.gvsig</groupId>
39
			<artifactId>org.gvsig.xmlschema.lib.api</artifactId>
40
            <scope>compile</scope>
41
		</dependency>
42
		<dependency>
43
			<groupId>org.gvsig</groupId>
44
			<artifactId>org.gvsig.xmlschema.lib.impl</artifactId>
45
			<scope>runtime</scope>
46
		</dependency>
47
		<dependency>
48
            <groupId>org.gvsig</groupId>
49
            <artifactId>org.gvsig.xmlschema.lib.spi</artifactId>
50
            <scope>runtime</scope>
51
        </dependency> 
52
        <dependency>
53
            <groupId>org.gvsig</groupId>
54
            <artifactId>org.gvsig.xmlschema.prov.kxml</artifactId>
55
            <scope>runtime</scope>
56
        </dependency>     	
57
	    <dependency>
58
        	<groupId>org.gvsig</groupId>
59
            <artifactId>org.gvsig.projection.api</artifactId>
60
            <scope>compile</scope>
61
        </dependency>
62
		<dependency>
63
			<groupId>org.gvsig</groupId>
64
			<artifactId>org.gvsig.fmap.dal.api</artifactId>
65
            <scope>compile</scope>
66
		</dependency>
67
        <dependency>
68
            <groupId>org.gvsig</groupId>
69
            <artifactId>org.gvsig.fmap.dal.spi</artifactId>
70
            <scope>compile</scope>
71
        </dependency>
72
        <dependency>
73
            <groupId>org.gvsig</groupId>
74
            <artifactId>org.gvsig.fmap.dal.file.lib</artifactId>
75
            <scope>compile</scope>
76
        </dependency>
77
        <dependency>
78
            <groupId>org.gvsig</groupId>
79
            <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
80
            <scope>compile</scope>
81
        </dependency>
82
        <dependency>
83
            <groupId>org.gvsig</groupId>
84
            <artifactId>org.gvsig.fmap.geometry.api</artifactId>
85
            <scope>compile</scope>
86
        </dependency>
87
        
88
        <!--
89
        <dependency>
90
            <groupId>org.gvsig</groupId>
91
            <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
92
            <scope>compile</scope>
93
        </dependency>
94
        -->
95
        
96
        <dependency>
97
            <groupId>org.gvsig</groupId>
98
            <artifactId>org.gvsig.tools.lib</artifactId>
99
            <scope>compile</scope>
100
        </dependency>
101
        
102
        <!--
103
        <dependency>
104
            <groupId>org.gvsig</groupId>
105
            <artifactId>org.gvsig.timesupport.lib.api</artifactId>
106
            <scope>compile</scope>
107
        </dependency>
108
        -->
109
        
110
        
111
        <!-- tests --> 
112
	    <dependency>
113
    	    <groupId>org.gvsig</groupId>
114
        	<artifactId>org.gvsig.fmap.dal.impl</artifactId>
115
        	<type>test-jar</type>
116
        	<scope>test</scope>
117
    	</dependency>
118
        
119
		<!-- runtime -->
120
		<dependency>
121
			<groupId>org.gvsig</groupId>
122
			<artifactId>org.gvsig.gpe.prov.xml</artifactId>
123
			<scope>runtime</scope>
124
		</dependency>
125
		<dependency>
126
			<groupId>org.gvsig</groupId>
127
			<artifactId>org.gvsig.gpe.prov.gml</artifactId>
128
			<scope>runtime</scope>
129
		</dependency>	
130
		<dependency>
131
			<groupId>org.gvsig</groupId>
132
			<artifactId>org.gvsig.gpe.prov.kml</artifactId>
133
			<scope>runtime</scope>
134
		</dependency>	
135
		<dependency>
136
			<groupId>org.gvsig</groupId>
137
			<artifactId>org.gvsig.xmlpull.lib.api</artifactId>
138
			<scope>runtime</scope>
139
		</dependency>
140
		<dependency>
141
			<groupId>org.gvsig</groupId>
142
			<artifactId>org.gvsig.xmlpull.lib.spi</artifactId>
143
			<scope>runtime</scope>
144
		</dependency>
145
		<dependency>
146
			<groupId>org.gvsig</groupId>
147
			<artifactId>org.gvsig.xmlpull.lib.impl</artifactId>
148
			<scope>runtime</scope>
149
		</dependency>
150
		<dependency>
151
			<groupId>org.gvsig</groupId>
152
			<artifactId>org.gvsig.xmlpull.prov.stax</artifactId>
153
			<scope>runtime</scope>
154
		</dependency>	
155
		<dependency>
156
			<groupId>org.gvsig</groupId>
157
			<artifactId>org.gvsig.xmlpull.prov.kxml</artifactId>
158
			<scope>runtime</scope>
159
		</dependency>	
160
        <dependency>
161
            <groupId>jfree</groupId>
162
            <artifactId>jcommon</artifactId>
163
            <scope>compile</scope>
164
        </dependency>
165
        
166
		<!--
167
		<dependency>
168
			<groupId>org.gvsig</groupId>
169
			<artifactId>org.gvsig.fmap.dal.index.spatial</artifactId>
170
			<classifier>jts</classifier>
171
			<scope>test</scope>
172
		</dependency>
173
		
174
        <dependency>
175
                <groupId>org.gvsig</groupId>
176
                <artifactId>org.gvsig.fmap.geometry.generalpath</artifactId>
177
                <scope>test</scope>
178
        </dependency>
179
        -->
180
        <dependency>
181
            <groupId>org.gvsig</groupId>
182
            <artifactId>org.gvsig.tools.lib</artifactId>
183
            <type>test-jar</type>
184
            <scope>test</scope>
185
        </dependency>
186
		
187
        <!-- TODO: Remove those entries when updated in libGPE -->
188
        <dependency>
189
            <groupId>stax</groupId>
190
            <artifactId>stax-api</artifactId>
191
            <scope>runtime</scope>
192
        </dependency>
193
		
194
        <dependency>
195
            <groupId>stax</groupId>
196
            <artifactId>stax</artifactId>
197
            <scope>runtime</scope>
198
        </dependency>
199
    </dependencies>
200
  
201
    <build>
202
        <plugins>
203
  	
204
            <plugin>
205
                <groupId>org.apache.maven.plugins</groupId>
206
                <artifactId>maven-surefire-plugin</artifactId>
207
                <configuration>
208
                    <skipTests>true</skipTests>
209
                </configuration>
210
            </plugin>
211
        </plugins>
212
    </build>
213
  
214
    <properties>
215
    </properties>  
216
</project>
org.gvsig.gpe/library/trunk/org.gvsig.gpe/org.gvsig.gpe.dal/src/test/resources/testdata/GML-lines.gml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<gml:FeatureCollection xmlns:cit="http://www.gvsig.com/cit" xmlns:gml="http://www.opengis.net/gml"
3
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
  xsi:schemaLocation="http://www.gvsig.com/cit GML-lines.xsd">
5
  <gml:boundedBy>
6
    <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#23030">
7
      <gml:coordinates decimal="." cs="," ts=" ">
8
        627820.0,4191291.0 797117.0,4519166.0
9
      </gml:coordinates>
10
    </gml:Box>
11
  </gml:boundedBy>
12
  <gml:featureMember>
13
    <cit:lines>
14
      <cit:the_geom>
15
        <gml:MultiLineString srsName='0'>
16
          <gml:lineStringMember>
17
            <gml:LineString srsName='0'>
18
              <gml:coordinates>
19
                685442.45,4209825.64 685445.64,4209832.3 685450.18,4209842.27 685452.54,4209848.61
20
                685454.35,4209855.13 685454.85,4209858.27 685455.09,4209862.0 685454.91,4209874.11
21
                685454.53,4209898.4 685454.28,4209907.47 685454.16,4209919.58 685454.28,4209927.52
22
                685454.59,4209935.16 685455.15,4209941.24 685455.71,4209947.12 685456.71,4209953.46
23
                685458.2,4209959.42 685460.37,4209966.78 685463.29,4209976.35 685467.33,4209986.88
24
                685472.11,4209999.24 685481.62,4210024.05 685492.81,4210052.4 685505.24,4210084.23
25
                685518.53,4210118.29 685532.01,4210152.78 685546.0,4210188.26 685558.49,4210220.89
26
                685567.62,4210243.65 685580.8,4210277.59 685595.08,4210313.87 685611.48,4210355.63
27
                685629.36,4210402.89 685636.82,4210425.32 685641.98,4210442.14 685647.76,4210465.16
28
                685651.17,4210482.16 685654.96,4210501.95 685659.5,4210529.06 685666.03,4210565.48
29
                685673.49,4210609.46 685679.64,4210645.81 685687.96,4210693.82 685694.74,4210732.84
30
                685703.62,4210787.18 685705.1,4210802.29 685706.78,4210822.51 685707.28,4210846.57
31
                685707.29,4210885.98 685706.54,4210924.01 685706.17,4210959.12 685705.62,4210997.7
32
                685705.12,4211037.34 685705.05,4211052.13 685705.11,4211060.57 685705.36,4211065.16
33
                685705.98,4211071.62 685706.85,4211076.71 685707.65,4211079.79 685709.46,4211085.82
34
                685712.01,4211092.34 685715.33,4211099.63 685717.79,4211103.89 685721.01,4211108.76
35
                685726.04,4211114.97 685733.19,4211121.81 685741.13,4211127.81 685762.0,4211141.13
36
                685790.6,4211159.76 685819.92,4211178.05 685840.13,4211191.4 685876.04,4211214.73
37
                685910.26,4211236.36 685947.84,4211260.81 685970.7,4211275.18 685978.54,4211280.33
38
                685984.57,4211284.24 685990.04,4211287.91 685995.32,4211291.82 686000.5,4211296.25
39
                686006.29,4211301.77 686011.51,4211307.92 686015.49,4211313.64 686018.54,4211319.1
40
                686021.77,4211326.0 686024.38,4211332.37 686025.68,4211337.71 686026.68,4211342.12
41
                686027.24,4211347.59 686027.55,4211353.28 686027.49,4211359.18 686027.24,4211365.01
42
                686026.37,4211371.47 686025.13,4211377.54 686022.95,4211386.23 686018.55,4211400.12
43
                686012.83,4211417.17 686006.31,4211433.05 686001.96,4211441.8 685996.38,4211450.98
44
                685990.48,4211459.42 685982.62,4211470.37 685977.53,4211477.95 685973.24,4211484.78
45
                685970.06,4211491.12 685967.28,4211497.98 685965.48,4211503.69 685963.98,4211509.47
46
                685962.55,4211515.8 685962.06,4211521.7 685961.87,4211527.75 685962.0,4211535.89
47
                685962.74,4211544.27 685964.79,4211553.55 685968.4,4211565.73 685976.23,4211587.05
48
                685987.17,4211614.13 686000.84,4211647.18 686005.87,4211656.89 686010.28,4211663.85
49
                686015.32,4211669.62 686020.98,4211674.96 686027.32,4211679.12 686034.91,4211682.97
50
                686043.53,4211686.18 686050.06,4211687.99 686055.1,4211688.79 686061.23,4211689.03
51
                686068.94,4211688.72 686074.1,4211687.98 686081.25,4211686.17 686087.69,4211683.94
52
                686094.72,4211680.71 686102.31,4211676.73 686116.9,4211668.17 686123.41,4211664.76
53
                686128.88,4211662.15 686136.47,4211659.23 686144.84,4211656.69 686152.18,4211655.2
54
                686160.14,4211654.09 686169.28,4211653.53 686175.29,4211653.78 686182.69,4211654.71
55
                686191.02,4211656.89 686202.4,4211660.61 686247.0,4211676.13 686294.0,4211692.61
56
                686339.89,4211708.57 686374.31,4211720.73 686427.25,4211739.29 686518.08,4211771.05
57
                686623.13,4211807.59 686707.63,4211837.12 686801.38,4211869.74 686866.31,4211892.58
58
                686889.95,4211900.29 686899.83,4211903.21 686909.04,4211905.13 686917.55,4211906.13
59
                686924.77,4211906.25 686932.54,4211905.88 686940.59,4211904.95 686948.37,4211902.71
60
                686954.65,4211900.35 686960.06,4211897.5 686965.56,4211893.86 686971.47,4211888.95
61
                686975.57,4211884.85 686980.05,4211878.89 686984.76,4211871.46 686989.85,4211862.76
62
                687003.83,4211836.83 687024.51,4211797.26 687038.8,4211769.41 687050.79,4211747.02
63
                687063.59,4211722.16 687070.43,4211709.98 687074.96,4211703.48 687081.43,4211695.03
64
                687088.44,4211686.91 687099.2,4211675.98 687110.31,4211665.63 687115.41,4211661.53
65
                687120.88,4211657.81 687124.47,4211655.6 687130.13,4211652.68 687136.16,4211650.14
66
                687141.2,4211648.52 687146.05,4211647.47 687151.34,4211646.66 687155.94,4211646.22
67
                687162.71,4211646.04 687168.54,4211646.54 687174.01,4211647.35 687179.85,4211649.02
68
                687186.19,4211651.38 687191.73,4211653.43 687203.46,4211659.44 687215.77,4211667.14
69
                687237.09,4211680.73 687250.24,4211688.9 687256.52,4211692.57 687263.36,4211695.73
70
                687268.64,4211697.85 687275.48,4211699.59 687285.04,4211701.62 687303.26,4211705.23
71
                687347.55,4211713.78 687371.19,4211718.48 687379.77,4211720.34 687385.62,4211722.02
72
                687389.97,4211723.69 687394.07,4211725.43 687397.3,4211727.1 687401.09,4211729.4
73
                687404.7,4211731.88 687408.31,4211734.74 687413.28,4211739.4 687419.12,4211745.28
74
                687432.18,4211758.95 687440.92,4211767.43 687447.08,4211772.71 687451.8,4211776.12
75
                687455.28,4211778.36 687460.94,4211781.34 687467.66,4211784.2 687475.9,4211786.54
76
                687483.11,4211788.22 687491.2,4211788.9 687497.29,4211789.27 687503.6,4211789.08
77
                687510.81,4211788.46 687518.03,4211787.22 687526.05,4211785.17 687533.57,4211782.81
78
                687539.08,4211780.63 687547.41,4211776.47 687557.8,4211770.39 687580.23,4211756.79
79
                687620.42,4211732.47 687657.45,4211710.51 687693.86,4211688.98 687736.42,4211664.12
80
                687766.42,4211646.38 687777.99,4211639.99 687791.39,4211633.11 687797.17,4211630.51
81
                687804.69,4211627.77 687811.53,4211625.97 687818.74,4211624.67 687828.59,4211623.94
82
                687838.98,4211623.69 687848.8,4211624.19 687857.51,4211625.43 687867.56,4211627.97
83
                687877.26,4211631.7 687885.91,4211635.55 687894.09,4211639.88 687901.8,4211644.53
84
                687912.81,4211651.74 687926.27,4211660.97 687946.23,4211674.45 687974.31,4211693.56
85
                687982.6,4211698.98 687990.62,4211703.45 687997.08,4211706.68 688003.92,4211709.04
86
                688009.77,4211710.53 688015.61,4211711.34 688021.4,4211711.58 688027.8,4211711.46
87
                688034.24,4211711.08 688040.27,4211710.4 688046.11,4211709.16 688053.08,4211707.05
88
                688061.29,4211703.76 688067.17,4211701.04 688073.14,4211697.62 688077.36,4211694.83
89
                688083.01,4211690.44 688089.04,4211684.91 688093.02,4211680.07 688097.55,4211674.24
90
                688101.16,4211668.46 688104.2,4211662.69 688107.61,4211653.76 688110.23,4211645.62
91
                688117.74,4211617.83 688126.86,4211585.46 688135.74,4211553.45 688141.28,4211533.13
92
                688142.4,4211528.09 688143.39,4211522.01 688143.83,4211516.67 688143.7,4211511.36
93
                688143.21,4211505.58 688142.09,4211500.24 688140.15,4211494.58 688137.64,4211489.57
94
                688134.18,4211484.32 688129.23,4211477.66 688123.45,4211470.89 688118.35,4211465.3
95
                688113.65,4211459.68 688110.79,4211455.39 688107.55,4211449.74 688104.75,4211444.15
96
                688103.26,4211440.3 688102.39,4211437.16 688101.96,4211433.12 688101.52,4211429.27
97
                688101.58,4211423.68 688101.77,4211419.77 688102.38,4211415.31 688103.88,4211409.35
98
                688106.24,4211402.83 688111.59,4211391.55 688117.93,4211378.88 688133.52,4211348.17
99
                688143.77,4211327.58 688160.61,4211294.7 688166.81,4211283.94 688171.72,4211276.55
100
                688176.44,4211270.96 688181.05,4211266.3 688186.08,4211262.14 688190.61,4211259.42
101
                688197.45,4211255.82 688205.66,4211252.53 688212.63,4211250.54 688222.87,4211248.32
102
                688237.18,4211246.09 688260.72,4211243.3 688277.19,4211241.01 688288.69,4211238.46
103
                688301.78,4211235.05 688309.54,4211231.96 688318.12,4211227.61 688329.94,4211220.4
104
                688345.15,4211210.11 688361.75,4211198.94 688414.62,4211163.09 688457.52,4211133.97
105
                688473.81,4211123.29 688481.15,4211117.95 688487.8,4211112.54 688491.21,4211108.77
106
                688495.07,4211104.17 688499.05,4211098.71 688501.72,4211094.3 688504.26,4211089.29
107
                688507.19,4211082.33 688509.36,4211075.69 688511.97,4211065.34 688513.9,4211056.34
108
                688516.5,4211043.7 688518.06,4211037.24 688519.68,4211031.8 688521.79,4211026.15
109
                688524.22,4211021.3 688526.57,4211017.15 688530.55,4211012.25 688534.47,4211007.9
110
                688540.55,4211002.52 688546.83,4210997.3 688570.02,4210981.48 688602.57,4210959.46
111
                688625.68,4210944.03 688634.88,4210938.75 688644.75,4210933.61 688652.83,4210930.19
112
                688659.92,4210927.71 688665.64,4210926.34 688671.54,4210925.54 688677.19,4210925.29
113
                688684.16,4210925.47 688690.06,4210926.34 688696.06,4210927.7 688702.46,4210929.94
114
                688708.56,4210932.73 688715.12,4210936.71 688721.65,4210941.3 688726.38,4210945.4
115
                688731.29,4210950.43 688736.39,4210956.46 688741.36,4210963.32 688746.02,4210971.02
116
                688752.55,4210985.16 688762.43,4211009.48 688776.16,4211042.4 688789.34,4211074.67
117
                688796.04,4211089.3 688800.39,4211097.31 688802.99,4211101.45 688806.47,4211106.48
118
                688811.63,4211112.13 688817.23,4211117.35 688823.92,4211122.48 688829.89,4211125.9
119
                688836.3,4211129.0 688842.2,4211131.24 688848.67,4211133.17 688853.89,4211134.53
120
                688863.38,4211135.88 688871.9,4211136.99 688882.22,4211137.86 688899.31,4211138.67
121
                688938.64,4211140.72 688963.03,4211142.21 688974.03,4211142.21 688979.2,4211141.83
122
                688985.91,4211140.84 688990.76,4211139.6 688996.78,4211137.61 689002.68,4211134.94
123
                689009.58,4211131.34 689017.02,4211126.46 689022.62,4211122.42 689029.64,4211116.52
124
                689034.17,4211112.19 689037.92,4211107.63 689042.19,4211101.39 689045.11,4211095.74
125
                689049.02,4211087.0 689052.37,4211077.88 689054.49,4211070.61 689064.48,4211028.67
126
                689068.77,4211009.6 689072.5,4210995.94 689075.98,4210984.32 689080.76,4210972.12
127
                689085.73,4210960.51 689090.76,4210950.34 689097.23,4210939.35 689109.9,4210918.32
128
                689120.83,4210900.23 689126.55,4210890.05 689132.52,4210878.37 689141.52,4210861.39
129
                689146.44,4210853.01 689151.41,4210844.93 689160.61,4210832.84 689169.24,4210823.54
130
                689175.77,4210817.45 689189.94,4210806.12 689198.52,4210800.78 689206.35,4210796.8
131
                689214.5,4210793.76 689224.25,4210791.16 689233.33,4210789.36 689243.69,4210788.18
132
                689251.77,4210787.93 689260.6,4210788.37 689271.58,4210789.98 689283.52,4210792.52
133
                689295.89,4210795.57 689343.54,4210807.48 689383.49,4210818.14 689428.28,4210829.74
134
                689468.72,4210839.91 689484.6,4210844.37 689500.81,4210849.7 689523.2,4210858.09
135
                689552.52,4210870.32 689609.49,4210894.01 689641.29,4210907.35 689650.68,4210911.63
136
                689657.02,4210915.05 689661.09,4210917.27 689665.38,4210920.26 689669.61,4210923.8
137
                689673.09,4210927.65 689676.93,4210932.95 689680.97,4210940.41 689685.57,4210950.03
138
                689699.31,4210982.99 689711.61,4211011.72 689728.01,4211050.55 689735.41,4211066.84
139
                689739.07,4211073.61 689741.81,4211077.83 689746.41,4211083.48 689750.45,4211087.77
140
                689754.84,4211091.15 689760.38,4211094.32 689767.78,4211097.73 689782.58,4211103.7
141
                689810.88,4211114.74 689831.77,4211123.12 689857.07,4211133.36 689883.65,4211145.14
142
                689887.45,4211146.63
143
              </gml:coordinates>
144
            </gml:LineString>
145
          </gml:lineStringMember>
146
        </gml:MultiLineString>
147
      </cit:the_geom>
148
      <cit:ENTITY>Complex Chain</cit:ENTITY>
149
      <cit:LAYER>22</cit:LAYER>
150
      <cit:LEVEL>22.0</cit:LEVEL>
151
      <cit:ELEVATION>0.0</cit:ELEVATION>
152
      <cit:COLOR>6.0</cit:COLOR>
153
      <cit:ID>12106.0</cit:ID>
154
      <cit:ID_PONT></cit:ID_PONT>
155
      <cit:NOMBRE>CV-950</cit:NOMBRE>
156
      <cit:ANCHO_C>5.5</cit:ANCHO_C>
157
      <cit:CARRIL_D>1.0</cit:CARRIL_D>
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff