Quick Search:

View

Revision:

Diff

Diff from 155 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/HibernateSpatial/trunk/hibernate-spatial-sqlserver/src/test/java/org/hibernatespatial/sqlserver/TestGeometries.java

Annotated File View

maesenka
149
1 /*
2  * $Id: GeometryTestCases.java 155 2010-01-13 21:00:35Z maesenka $
3  *
4  * This file is part of Hibernate Spatial, an extension to the
5  * hibernate ORM solution for geographic data.
6  *
7  * Copyright © 2009 Geovise BVBA
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library 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 GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; 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, visit: http://www.hibernatespatial.org/
24  */
25
26 package org.hibernatespatial.sqlserver;
27
28 import java.util.ArrayList;
29 import java.util.List;
30
maesenka
150
31 class GeometryTestCases {
maesenka
149
32
33     //TODO -- how to define EMPTY Geomtries in SQL?
34
35     final static List<TestWKTTEST_WKTS = new ArrayList<TestWKT>();
36
37     static {
38         //POINT test cases
39         TEST_WKTS.add(new TestWKT(1"POINT""POINT(10 5)"0));
40         TEST_WKTS.add(new TestWKT(2"POINT""POINT(52.25  2.53)"4326));
41         TEST_WKTS.add(new TestWKT(3"POINT""POINT(150000 200000)"31370));
42         TEST_WKTS.add(new TestWKT(4"POINT""POINT(10.0 2.0 1.0 3.0)"4326));
43         //LINESTRING test cases
44         TEST_WKTS.add(new TestWKT(5"LINESTRING""LINESTRING(10.0 5.0, 20.0 15.0)"4326));
45         TEST_WKTS.add(new TestWKT(6"LINESTRING""LINESTRING(10.0 5.0, 20.0 15.0, 30.3 22.4, 10 30.0)"4326));
46         TEST_WKTS.add(new TestWKT(7"LINESTRING""LINESTRING(10.0 5.0 0.0, 20.0 15.0 3.0)"4326));
47         TEST_WKTS.add(new TestWKT(8"LINESTRING""LINESTRING(10.0 5.0 0.0 0.0, 20.0 15.0 3.0 1.0)"4326));
48         TEST_WKTS.add(new TestWKT(9"LINESTRING""LINESTRING(10.0 5.0 1, 20.0 15.0 2, 30.3 22.4 5, 10 30.0 2)"4326));
49         TEST_WKTS.add(new TestWKT(10"LINESTRING",
50                 "LINESTRING(10.0 5.0 1 1, 20.0 15.0 2 3, 30.3 22.4 5 10, 10 30.0 2 12)"4326));
51         //MULTILINESTRING test cases
52         TEST_WKTS.add(new TestWKT(11"MULTILINESTRING",
53                 "MULTILINESTRING((10.0 5.0, 20.0 15.0),( 25.0 30.0, 30.0 20.0))"4326));
54         TEST_WKTS.add(new TestWKT(12"MULTILINESTRING",
55                 "MULTILINESTRING((10.0 5.0, 20.0 15.0, 30.3 22.4, 10 30.0), (40.0 20.0, 42.0 18.0, 43.0 16.0, 40 14.0))"4326));
56         TEST_WKTS.add(new TestWKT(13"MULTILINESTRING",
57                 "MULTILINESTRING((10.0 5.0 1.0, 20.0 15.0 2.0, 30.3 22.4 1.0, 10 30.0 1.0),(40.0 20.0 0.0, 42.0 18.0 1.0, 43.0 16.0 2.0, 40 14.0 3.0))"4326));
58         TEST_WKTS.add(new TestWKT(14"MULTILINESTRING",
59                 "MULTILINESTRING((10.0 5.0 1.0, 20.0 15.0 2.0 0.0, 30.3 22.4 1.0 1.0, 10 30.0 1.0 2.0),(40.0 20.0 0.0 3.0, 42.0 18.0 1.0 4.0, 43.0 16.0 2.0 5.0, 40 14.0 3.0 6.0))"4326));
60         TEST_WKTS.add(new TestWKT(15"MULTILINESTRING",
61                 "MULTILINESTRING((10.0 5.0 1.0, 20.0 15.0 2.0 0.0, 30.3 22.4 1.0 1.0, 10 30.0 1.0 2.0))"4326));
62
63         //Polygon
64         TEST_WKTS.add(new TestWKT(16"POLYGON",
65                 "POLYGON( (0 0, 0 10, 10 10, 10 0, 0 0) )"4326));
66         TEST_WKTS.add(new TestWKT(17"POLYGON",
67                 "POLYGON( (0 0 0, 0 10 1, 10 10 1, 10 0 1, 0 0 0) )"4326));
68         TEST_WKTS.add(new TestWKT(18"POLYGON",
69                 "POLYGON( (0 0, 0 10, 10 10, 10 0, 0 0), " +
70                         "(2 2, 2 5, 5 5,5 2, 2 2))"4326));
71
maesenka
150
72         //MULTIPOLYGON
73         TEST_WKTS.add(new TestWKT(20"MULTIPOLYGON",
74                 "MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)), ((5 0, 20 40, 30 34, 5 0)) )"4326));
75         TEST_WKTS.add(new TestWKT(21"MULTIPOLYGON",
76                 "MULTIPOLYGON( ((10 20 1, 30 40 2, 44 50 2, 10 20 1)), ((5 0 0, 20 40 10, 30 34 20, 5 0 0)) )"4326));
77         TEST_WKTS.add(new TestWKT(22"MULTIPOLYGON",
78                 "MULTIPOLYGON( " +
79                         "( (0 0, 0 50, 50 50, 0 0), (10 10, 10 20, 20 20, 20 10, 10 10) ), " +
80                         "((5 0, 20 40, 30 34, 5 0)) )"4326));
81
maesenka
151
82         //MultiPoint
83         TEST_WKTS.add(new TestWKT(25"MULTIPOINT""MULTIPOINT(21 2, 25 5, 30 3)"4326));
84         TEST_WKTS.add(new TestWKT(26"MULTIPOINT""MULTIPOINT(21 2)"4326));
85         TEST_WKTS.add(new TestWKT(27"MULTIPOINT""MULTIPOINT(21 2 1, 25 5 2, 30 3 5)"4326));
86         TEST_WKTS.add(new TestWKT(28"MULTIPOINT""MULTIPOINT(21 2 1 0, 25 5 2 4, 30 3 5 2)"4326));
87
maesenka
149
88
89     }
90 }
FishEye: Open Source License registered to Hibernate Spatial.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, Subversion, CVS & Perforce analysis. (Version:1.5.2 Build:build-298 2008-05-26 ) - Administration - Page generated 2010-09-08 05:55 +0200