Quick Search:

View

Revision:

Diff

Diff from 156 to:

Annotations

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

Annotated File View

maesenka
141
1 /*
maesenka
146
2  * $Id: PointDecoder.java 156 2010-01-28 22:59:30Z maesenka $
maesenka
141
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.convertors;
27
maesenka
145
28 import com.vividsolutions.jts.geom.Coordinate;
maesenka
141
29 import com.vividsolutions.jts.geom.Point;
30
31 /**
32  * @author Karel Maesen, Geovise BVBA.
33  *         Date: Nov 2, 2009
34  */
maesenka
145
35 class PointDecoder extends AbstractDecoder<Point> {
maesenka
141
36
maesenka
156
37     @Override
38     protected OpenGisType getOpenGisType() {
39         return OpenGisType.POINT;
maesenka
141
40     }
41
maesenka
145
42     protected Point createNullGeometry() {
43         return getGeometryFactory().createPoint((Coordinatenull);
maesenka
141
44     }
45
maesenka
145
46     protected Point createGeometry(SqlGeometryV1 nativeGeom) {
maesenka
156
47         return createPoint(nativeGeom0);
48     }
49
50     @Override
51     protected Point createGeometry(SqlGeometryV1 nativeGeomint shapeIndex) {
52         int figureOffset = nativeGeom.getStartFigureForShape(shapeIndex);
53         int pntOffset = nativeGeom.getStartPointForFigure(figureOffset);
54         return createPoint(nativeGeompntOffset);
55     }
56
57     private Point createPoint(SqlGeometryV1 nativeGeomint pntOffset){
58         return getGeometryFactory().createPoint(nativeGeom.getCoordinate(pntOffset));
maesenka
141
59     }
60
61
62 }
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-09 22:40 +0200