svn-gvsig-desktop / trunk / libraries / libGPE / src-test / org / gvsig / gpe / writer / GPELayerWithBboxTest.java @ 20219
History | View | Annotate | Download (2.72 KB)
1 |
package org.gvsig.gpe.writer; |
---|---|
2 |
|
3 |
import org.gvsig.gpe.containers.CoordinatesIterator; |
4 |
import org.gvsig.gpe.containers.GeometryAsserts; |
5 |
import org.gvsig.gpe.containers.Layer; |
6 |
|
7 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
8 |
*
|
9 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
10 |
*
|
11 |
* This program is free software; you can redistribute it and/or
|
12 |
* modify it under the terms of the GNU General Public License
|
13 |
* as published by the Free Software Foundation; either version 2
|
14 |
* of the License, or (at your option) any later version.
|
15 |
*
|
16 |
* This program is distributed in the hope that it will be useful,
|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19 |
* GNU General Public License for more details.
|
20 |
*
|
21 |
* You should have received a copy of the GNU General Public License
|
22 |
* along with this program; if not, write to the Free Software
|
23 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
24 |
*
|
25 |
* For more information, contact:
|
26 |
*
|
27 |
* Generalitat Valenciana
|
28 |
* Conselleria d'Infraestructures i Transport
|
29 |
* Av. Blasco Ib??ez, 50
|
30 |
* 46010 VALENCIA
|
31 |
* SPAIN
|
32 |
*
|
33 |
* +34 963862235
|
34 |
* gvsig@gva.es
|
35 |
* www.gvsig.gva.es
|
36 |
*
|
37 |
* or
|
38 |
*
|
39 |
* IVER T.I. S.A
|
40 |
* Salamanca 50
|
41 |
* 46005 Valencia
|
42 |
* Spain
|
43 |
*
|
44 |
* +34 963163400
|
45 |
* dac@iver.es
|
46 |
*/
|
47 |
/* CVS MESSAGES:
|
48 |
*
|
49 |
* $Id: GPELayerWithBboxTest.java 144 2007-06-07 14:53:59Z jorpiell $
|
50 |
* $Log$
|
51 |
* Revision 1.3 2007/06/07 14:52:28 jorpiell
|
52 |
* Add the schema support
|
53 |
*
|
54 |
* Revision 1.2 2007/05/09 08:35:58 jorpiell
|
55 |
* fixed an exception
|
56 |
*
|
57 |
* Revision 1.1 2007/05/02 11:46:07 jorpiell
|
58 |
* Writing tests updated
|
59 |
*
|
60 |
*
|
61 |
*/
|
62 |
/**
|
63 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es)
|
64 |
*/
|
65 |
public abstract class GPELayerWithBboxTest extends GPEWriterBaseTest{ |
66 |
private String layerId = "l1"; |
67 |
private String srs = "EPSG:23030"; |
68 |
private String bboxId = "bboxID"; |
69 |
private double[] bboxX = generateRandomBBox(); |
70 |
private double[] bboxY = generateRandomBBox(); |
71 |
private double[] bboxZ = generateRandomBBox(); |
72 |
/*
|
73 |
* (non-Javadoc)
|
74 |
* @see org.gvsig.gpe.writers.GPEWriterBaseTest#readObjects()
|
75 |
*/
|
76 |
public void readObjects() { |
77 |
Layer[] layers = getLayers();
|
78 |
assertEquals(layers.length, 1);
|
79 |
Layer layer = layers[0];
|
80 |
GeometryAsserts.bbox(layer.getBbox(),bboxX,bboxY,bboxZ); |
81 |
} |
82 |
|
83 |
/*
|
84 |
* (non-Javadoc)
|
85 |
* @see org.gvsig.gpe.writers.GPEWriterBaseTest#writeObjects()
|
86 |
*/
|
87 |
public void writeObjects() { |
88 |
getWriterHandler().initialize(); |
89 |
getWriterHandler().startLayer(layerId, null, null, srs, null); |
90 |
getWriterHandler().startBbox(bboxId, new CoordinatesIterator(bboxX, bboxY, bboxZ), srs);
|
91 |
getWriterHandler().endBbox(); |
92 |
getWriterHandler().endLayer(); |
93 |
getWriterHandler().close(); |
94 |
} |
95 |
} |