| /trunk/hibernate-spatial-postgis/src/test/java/org/hibernatespatial/postgis/test/GenerateData.java |
|---|
| 1,14 → 1,15 |
| /** |
| * $Id$ |
| * |
| * This file is part of Spatial Hibernate, an extension to the |
| * This file is part of Hibernate Spatial, an extension to the |
| * hibernate ORM solution for geographic data. |
| * |
| * Copyright © 2007 Geovise BVBA |
| * Copyright © 2007 K.U. Leuven LRD, Spatial Applications Division, Belgium |
| * |
| * This work was partially supported by the European Commission, |
| * under the 6th Framework Programme, contract IST-2-004688-STP. |
| * |
| * |
| * This library is free software; you can redistribute it and/or |
| * modify it under the terms of the GNU Lesser General Public |
| * License as published by the Free Software Foundation; either |
| 23,18 → 24,17 |
| * License along with this library; if not, write to the Free Software |
| * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| * |
| * For more information, visit: http://www.cadrie.com/ |
| * For more information, visit: http://www.hibernatespatial.org/ |
| */ |
| package org.hibernatespatial.postgis.test; |
| import org.hibernatespatial.test.model.DataGenerator; |
| public class GenerateData { |
| public static void main(String[] args) { |
| DataGenerator generator = new DataGenerator(); |
| generator.generate(); |
| } |
| public static void main(String[] args) { |
| DataGenerator generator = new DataGenerator(); |
| generator.generate(); |
| } |
| } |
| /trunk/hibernate-spatial-postgis/src/test/java/org/hibernatespatial/postgis/test/TestPostgisSpatialQueries.java |
|---|
| 1,14 → 1,15 |
| /** |
| * $Id:TestPostgisSpatialQueries.java 40 2007-09-20 15:33:24Z maesenka $ |
| * $Id$ |
| * |
| * This file is part of Spatial Hibernate, an extension to the |
| * This file is part of Hibernate Spatial, an extension to the |
| * hibernate ORM solution for geographic data. |
| * |
| * Copyright © 2007 Geovise BVBA |
| * Copyright © 2007 K.U. Leuven LRD, Spatial Applications Division, Belgium |
| * |
| * This work was partially supported by the European Commission, |
| * under the 6th Framework Programme, contract IST-2-004688-STP. |
| * |
| * |
| * This library is free software; you can redistribute it and/or |
| * modify it under the terms of the GNU Lesser General Public |
| * License as published by the Free Software Foundation; either |
| 23,9 → 24,8 |
| * License along with this library; if not, write to the Free Software |
| * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| * |
| * For more information, visit: http://www.cadrie.com/ |
| * For more information, visit: http://www.hibernatespatial.org/ |
| */ |
| package org.hibernatespatial.postgis.test; |
| import java.sql.Connection; |
| /trunk/hibernate-spatial-postgis/src/test/java/org/hibernatespatial/postgis/test/TestPostgisCRUD.java |
|---|
| 1,14 → 1,15 |
| /** |
| * $Id$ |
| * |
| * This file is part of Spatial Hibernate, an extension to the |
| * This file is part of Hibernate Spatial, an extension to the |
| * hibernate ORM solution for geographic data. |
| * |
| * Copyright © 2007 Geovise BVBA |
| * Copyright © 2007 K.U. Leuven LRD, Spatial Applications Division, Belgium |
| * |
| * This work was partially supported by the European Commission, |
| * under the 6th Framework Programme, contract IST-2-004688-STP. |
| * |
| * |
| * This library is free software; you can redistribute it and/or |
| * modify it under the terms of the GNU Lesser General Public |
| * License as published by the Free Software Foundation; either |
| 23,9 → 24,8 |
| * License along with this library; if not, write to the Free Software |
| * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| * |
| * For more information, visit: http://www.cadrie.com/ |
| * For more information, visit: http://www.hibernatespatial.org/ |
| */ |
| package org.hibernatespatial.postgis.test; |
| import junit.framework.JUnit4TestAdapter; |
| 35,37 → 35,36 |
| import org.junit.BeforeClass; |
| import org.junit.Test; |
| public class TestPostgisCRUD { |
| private final static TestCRUD delegate; |
| private final static TestCRUD delegate; |
| static { |
| delegate = new TestCRUD(); |
| } |
| static { |
| delegate = new TestCRUD(); |
| } |
| @BeforeClass |
| public static void setUpBeforeClass() throws Exception { |
| delegate.setUpBeforeClass(); |
| } |
| @BeforeClass |
| public static void setUpBeforeClass() throws Exception { |
| delegate.setUpBeforeClass(); |
| } |
| @AfterClass |
| public static void tearDownAfterClass() throws Exception { |
| delegate.tearDownAfterClass(); |
| } |
| @AfterClass |
| public static void tearDownAfterClass() throws Exception { |
| delegate.tearDownAfterClass(); |
| } |
| @Test |
| public void testSaveLineStringEntity() throws Exception { |
| delegate.testSaveLineStringEntity(); |
| } |
| @Test |
| public void testSaveLineStringEntity() throws Exception { |
| delegate.testSaveLineStringEntity(); |
| } |
| @Test |
| public void testSaveNullLineStringEntity() throws Exception { |
| delegate.testSaveNullLineStringEntity(); |
| } |
| @Test |
| public void testSaveNullLineStringEntity() throws Exception { |
| delegate.testSaveNullLineStringEntity(); |
| } |
| public static junit.framework.Test suite() { |
| return new JUnit4TestAdapter(TestPostgisCRUD.class); |
| } |
| public static junit.framework.Test suite() { |
| return new JUnit4TestAdapter(TestPostgisCRUD.class); |
| } |
| } |
| /trunk/hibernate-spatial-postgis/src/test/java/log4j.properties |
|---|
| 12,8 → 12,10 |
| ### set log levels - for more verbose logging change 'info' to 'debug' ### |
| log4j.rootLogger=info, stdout |
| log4j.rootLogger=debug, stdout |
| log4j.logger.org.hibernatespatial.test=debug |
| log4j.logger.org.hibernate=info |
| #log4j.logger.org.hibernate=debug |
| /trunk/hibernate-spatial-postgis/src/main/java/org/hibernatespatial/postgis/DialectProvider.java |
|---|
| 1,14 → 1,15 |
| /** |
| * $Id$ |
| * |
| * This file is part of Spatial Hibernate, an extension to the |
| * This file is part of Hibernate Spatial, an extension to the |
| * hibernate ORM solution for geographic data. |
| * |
| * Copyright © 2007 Geovise BVBA |
| * Copyright © 2007 K.U. Leuven LRD, Spatial Applications Division, Belgium |
| * |
| * This work was partially supported by the European Commission, |
| * under the 6th Framework Programme, contract IST-2-004688-STP. |
| * |
| * |
| * This library is free software; you can redistribute it and/or |
| * modify it under the terms of the GNU Lesser General Public |
| * License as published by the Free Software Foundation; either |
| 23,9 → 24,8 |
| * License along with this library; if not, write to the Free Software |
| * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| * |
| * For more information, visit: http://www.cadrie.com/ |
| * For more information, visit: http://www.hibernatespatial.org/ |
| */ |
| package org.hibernatespatial.postgis; |
| import java.util.Map; |
| 33,7 → 33,6 |
| import org.hibernatespatial.SpatialDialect; |
| import org.hibernatespatial.spi.SpatialDialectProvider; |
| /** |
| * PostGIS DialectProvider |
| * |
| 41,37 → 40,37 |
| */ |
| public class DialectProvider implements SpatialDialectProvider { |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.hibernatespatial.spi.SpatialDialectProvider#createSpatialDialect(java.lang.String, |
| * java.util.Map) |
| */ |
| public SpatialDialect createSpatialDialect(String dialect, Map map) { |
| if (dialect.equals(PostgisDialect.class.getCanonicalName()) |
| || dialect.equals("org.hibernate.dialect.PostgreSQLDialect") |
| || dialect.equals("postgis")) |
| return new PostgisDialect(); |
| else |
| return null; |
| } |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.hibernatespatial.spi.SpatialDialectProvider#createSpatialDialect(java.lang.String, |
| * java.util.Map) |
| */ |
| public SpatialDialect createSpatialDialect(String dialect, Map map) { |
| if (dialect.equals(PostgisDialect.class.getCanonicalName()) |
| || dialect.equals("org.hibernate.dialect.PostgreSQLDialect") |
| || dialect.equals("postgis")) |
| return new PostgisDialect(); |
| else |
| return null; |
| } |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.hibernatespatial.spi.SpatialDialectProvider#getDefaultDialect() |
| */ |
| public SpatialDialect getDefaultDialect() { |
| return new PostgisDialect(); |
| } |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.hibernatespatial.spi.SpatialDialectProvider#getDefaultDialect() |
| */ |
| public SpatialDialect getDefaultDialect() { |
| return new PostgisDialect(); |
| } |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.hibernatespatial.spi.SpatialDialectProvider#getSupportedDialects() |
| */ |
| public String[] getSupportedDialects() { |
| return new String[] { PostgisDialect.class.getCanonicalName() }; |
| } |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.hibernatespatial.spi.SpatialDialectProvider#getSupportedDialects() |
| */ |
| public String[] getSupportedDialects() { |
| return new String[] { PostgisDialect.class.getCanonicalName() }; |
| } |
| } |
| /trunk/hibernate-spatial-postgis/src/main/java/org/hibernatespatial/postgis/PGGeometryUserType.java |
|---|
| 1,14 → 1,15 |
| /** |
| * $Id$ |
| * |
| * This file is part of Spatial Hibernate, an extension to the |
| * This file is part of Hibernate Spatial, an extension to the |
| * hibernate ORM solution for geographic data. |
| * |
| * Copyright © 2007 Geovise BVBA |
| * Copyright © 2007 K.U. Leuven LRD, Spatial Applications Division, Belgium |
| * |
| * This work was partially supported by the European Commission, |
| * under the 6th Framework Programme, contract IST-2-004688-STP. |
| * |
| * |
| * This library is free software; you can redistribute it and/or |
| * modify it under the terms of the GNU Lesser General Public |
| * License as published by the Free Software Foundation; either |
| 23,9 → 24,8 |
| * License along with this library; if not, write to the Free Software |
| * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| * |
| * For more information, visit: http://www.cadrie.com/ |
| * For more information, visit: http://www.hibernatespatial.org/ |
| */ |
| package org.hibernatespatial.postgis; |
| import java.sql.Connection; |
| 47,282 → 47,293 |
| import com.vividsolutions.jts.geom.GeometryFactory; |
| /** |
| * Specific <code>GeometryType</code> for Postgis geometry type |
| * Specific <code>GeometryType</code> for Postgis geometry type |
| * |
| * @author Karel Maesen |
| */ |
| public class PGGeometryUserType extends AbstractDBGeometryType { |
| private static final int[] geometryTypes = new int[] { Types.STRUCT }; |
| private static final int[] geometryTypes = new int[] { Types.STRUCT }; |
| private static final GeometryFactory geomFactory = new GeometryFactory(); |
| private static final GeometryFactory geomFactory = new GeometryFactory(); |
| public int[] sqlTypes() { |
| return geometryTypes;// PostgisDialect.getGeometrySQLType() |
| } |
| public int[] sqlTypes() { |
| return geometryTypes;// PostgisDialect.getGeometrySQLType() |
| } |
| /** |
| * Converts the native geometry object to a JTS <code>Geometry</code>. |
| * |
| * @param geomObj |
| * native database geometry object (depends on the JDBC spatial |
| * extension of the database) |
| * @return JTS geometry corresponding to geomObj. |
| */ |
| public Geometry convert2JTS(Object object) { |
| if (object == null) |
| return null; |
| PGgeometry geom = (PGgeometry) object; |
| com.vividsolutions.jts.geom.Geometry out = null; |
| switch (geom.getGeoType()) { |
| case org.postgis.Geometry.POINT: |
| out = convertPoint((org.postgis.Point) geom.getGeometry()); |
| break; |
| case org.postgis.Geometry.LINESTRING: |
| out = convertLineString((org.postgis.LineString) geom |
| .getGeometry()); |
| break; |
| case org.postgis.Geometry.POLYGON: |
| out = convertPolygon((org.postgis.Polygon) geom.getGeometry()); |
| break; |
| case org.postgis.Geometry.MULTILINESTRING: |
| out = convertMultiLineString((org.postgis.MultiLineString) geom |
| .getGeometry()); |
| break; |
| case org.postgis.Geometry.MULTIPOINT: |
| out = convertMultiPoint((org.postgis.MultiPoint) geom |
| .getGeometry()); |
| break; |
| case org.postgis.Geometry.MULTIPOLYGON: |
| out = convertMultiPolygon((org.postgis.MultiPolygon) geom |
| .getGeometry()); |
| break; |
| case org.postgis.Geometry.GEOMETRYCOLLECTION: |
| out = convertGeometryCollection((org.postgis.GeometryCollection) geom |
| .getGeometry()); |
| } |
| /** |
| * Converts the native geometry object to a JTS <code>Geometry</code>. |
| * |
| * @param object |
| * native database geometry object (depends on the JDBC spatial |
| * extension of the database) |
| * @return JTS geometry corresponding to geomObj. |
| */ |
| public Geometry convert2JTS(Object object) { |
| if (object == null) |
| return null; |
| return out; |
| } |
| // in some cases, Postgis returns not PGgeometry objects |
| // but org.postgis.Geometry instances. |
| // This has been observed when retrieving GeometryCollections |
| // as the result of an SQL-operation such as Union. |
| if (object instanceof org.postgis.Geometry) { |
| object = new PGgeometry((org.postgis.Geometry) object); |
| } |
| private Geometry convertGeometryCollection(GeometryCollection collection) { |
| org.postgis.Geometry[] geometries = collection.getGeometries(); |
| com.vividsolutions.jts.geom.Geometry[] jtsGeometries = new com.vividsolutions.jts.geom.GeometryCollection[geometries.length]; |
| for (int i = 0; i < geometries.length; i++) { |
| jtsGeometries[i] = convert2JTS(geometries[i]); |
| } |
| com.vividsolutions.jts.geom.GeometryCollection jtsGCollection = geomFactory |
| .createGeometryCollection(jtsGeometries); |
| return jtsGCollection; |
| } |
| if (!(object instanceof PGgeometry)) { |
| throw new IllegalArgumentException( |
| "Object to convert is neither PGgeometry, nor org.postgis.Geometry"); |
| } |
| PGgeometry geom = (PGgeometry) object; |
| com.vividsolutions.jts.geom.Geometry out = null; |
| switch (geom.getGeoType()) { |
| case org.postgis.Geometry.POINT: |
| out = convertPoint((org.postgis.Point) geom.getGeometry()); |
| break; |
| case org.postgis.Geometry.LINESTRING: |
| out = convertLineString((org.postgis.LineString) geom.getGeometry()); |
| break; |
| case org.postgis.Geometry.POLYGON: |
| out = convertPolygon((org.postgis.Polygon) geom.getGeometry()); |
| break; |
| case org.postgis.Geometry.MULTILINESTRING: |
| out = convertMultiLineString((org.postgis.MultiLineString) geom |
| .getGeometry()); |
| break; |
| case org.postgis.Geometry.MULTIPOINT: |
| out = convertMultiPoint((org.postgis.MultiPoint) geom.getGeometry()); |
| break; |
| case org.postgis.Geometry.MULTIPOLYGON: |
| out = convertMultiPolygon((org.postgis.MultiPolygon) geom |
| .getGeometry()); |
| break; |
| case org.postgis.Geometry.GEOMETRYCOLLECTION: |
| out = convertGeometryCollection((org.postgis.GeometryCollection) geom |
| .getGeometry()); |
| } |
| private Geometry convertMultiPolygon(MultiPolygon pgMultiPolygon) { |
| com.vividsolutions.jts.geom.Polygon[] polygons = new com.vividsolutions.jts.geom.Polygon[pgMultiPolygon |
| .numPolygons()]; |
| return out; |
| } |
| for (int i = 0; i < polygons.length; i++) { |
| Polygon pgPolygon = pgMultiPolygon.getPolygon(i); |
| polygons[i] = (com.vividsolutions.jts.geom.Polygon) convertPolygon(pgPolygon); |
| } |
| private Geometry convertGeometryCollection(GeometryCollection collection) { |
| org.postgis.Geometry[] geometries = collection.getGeometries(); |
| com.vividsolutions.jts.geom.Geometry[] jtsGeometries = new com.vividsolutions.jts.geom.Geometry[geometries.length]; |
| for (int i = 0; i < geometries.length; i++) { |
| jtsGeometries[i] = convert2JTS(geometries[i]); |
| } |
| com.vividsolutions.jts.geom.GeometryCollection jtsGCollection = geomFactory |
| .createGeometryCollection(jtsGeometries); |
| return jtsGCollection; |
| } |
| com.vividsolutions.jts.geom.MultiPolygon out = geomFactory |
| .createMultiPolygon(polygons); |
| out.setSRID(pgMultiPolygon.srid); |
| return out; |
| } |
| private Geometry convertMultiPolygon(MultiPolygon pgMultiPolygon) { |
| com.vividsolutions.jts.geom.Polygon[] polygons = new com.vividsolutions.jts.geom.Polygon[pgMultiPolygon |
| .numPolygons()]; |
| private Geometry convertMultiPoint(MultiPoint pgMultiPoint) { |
| com.vividsolutions.jts.geom.Point[] points = new com.vividsolutions.jts.geom.Point[pgMultiPoint |
| .numPoints()]; |
| for (int i = 0; i < polygons.length; i++) { |
| Polygon pgPolygon = pgMultiPolygon.getPolygon(i); |
| polygons[i] = (com.vividsolutions.jts.geom.Polygon) convertPolygon(pgPolygon); |
| } |
| for (int i = 0; i < points.length; i++) { |
| points[i] = convertPoint(pgMultiPoint.getPoint(i)); |
| } |
| com.vividsolutions.jts.geom.MultiPoint out = geomFactory |
| .createMultiPoint(points); |
| out.setSRID(pgMultiPoint.srid); |
| return out; |
| } |
| com.vividsolutions.jts.geom.MultiPolygon out = geomFactory |
| .createMultiPolygon(polygons); |
| out.setSRID(pgMultiPolygon.srid); |
| return out; |
| } |
| private com.vividsolutions.jts.geom.Geometry convertMultiLineString( |
| MultiLineString mlstr) { |
| private Geometry convertMultiPoint(MultiPoint pgMultiPoint) { |
| com.vividsolutions.jts.geom.Point[] points = new com.vividsolutions.jts.geom.Point[pgMultiPoint |
| .numPoints()]; |
| com.vividsolutions.jts.geom.LineString[] lstrs = new com.vividsolutions.jts.geom.LineString[mlstr |
| .numLines()]; |
| for (int i = 0; i < points.length; i++) { |
| points[i] = convertPoint(pgMultiPoint.getPoint(i)); |
| } |
| com.vividsolutions.jts.geom.MultiPoint out = geomFactory |
| .createMultiPoint(points); |
| out.setSRID(pgMultiPoint.srid); |
| return out; |
| } |
| for (int i = 0; i < mlstr.numLines(); i++) { |
| lstrs[i] = geomFactory.createLineString(toJTSCoordinates(mlstr |
| .getLine(i).getPoints())); |
| } |
| com.vividsolutions.jts.geom.MultiLineString out = geomFactory |
| .createMultiLineString(lstrs); |
| out.setSRID(mlstr.srid); |
| return out; |
| } |
| private com.vividsolutions.jts.geom.Geometry convertMultiLineString( |
| MultiLineString mlstr) { |
| protected com.vividsolutions.jts.geom.Geometry convertPolygon( |
| Polygon polygon) { |
| com.vividsolutions.jts.geom.LinearRing shell = geomFactory |
| .createLinearRing(toJTSCoordinates(polygon.getRing(0) |
| .getPoints())); |
| com.vividsolutions.jts.geom.Polygon out = null; |
| if (polygon.numRings() > 1) { |
| com.vividsolutions.jts.geom.LinearRing[] rings = new com.vividsolutions.jts.geom.LinearRing[polygon |
| .numRings() - 1]; |
| for (int r = 1; r < polygon.numRings(); r++) { |
| rings[r - 1] = geomFactory |
| .createLinearRing(toJTSCoordinates(polygon.getRing(r) |
| .getPoints())); |
| } |
| out = geomFactory.createPolygon(shell, rings); |
| } else { |
| out = geomFactory.createPolygon(shell, null); |
| } |
| out.setSRID(polygon.srid); |
| return out; |
| } |
| com.vividsolutions.jts.geom.LineString[] lstrs = new com.vividsolutions.jts.geom.LineString[mlstr |
| .numLines()]; |
| protected com.vividsolutions.jts.geom.Point convertPoint(Point pnt) { |
| com.vividsolutions.jts.geom.Point g = geomFactory |
| .createPoint(new Coordinate(pnt.x, pnt.y)); |
| g.setSRID(pnt.getSrid()); |
| return g; |
| } |
| for (int i = 0; i < mlstr.numLines(); i++) { |
| lstrs[i] = geomFactory.createLineString(toJTSCoordinates(mlstr |
| .getLine(i).getPoints())); |
| } |
| com.vividsolutions.jts.geom.MultiLineString out = geomFactory |
| .createMultiLineString(lstrs); |
| out.setSRID(mlstr.srid); |
| return out; |
| } |
| protected com.vividsolutions.jts.geom.LineString convertLineString( |
| org.postgis.LineString lstr) { |
| com.vividsolutions.jts.geom.LineString out = geomFactory |
| .createLineString(toJTSCoordinates(lstr.getPoints())); |
| out.setSRID(lstr.getSrid()); |
| return out; |
| } |
| protected com.vividsolutions.jts.geom.Geometry convertPolygon( |
| Polygon polygon) { |
| com.vividsolutions.jts.geom.LinearRing shell = geomFactory |
| .createLinearRing(toJTSCoordinates(polygon.getRing(0) |
| .getPoints())); |
| com.vividsolutions.jts.geom.Polygon out = null; |
| if (polygon.numRings() > 1) { |
| com.vividsolutions.jts.geom.LinearRing[] rings = new com.vividsolutions.jts.geom.LinearRing[polygon |
| .numRings() - 1]; |
| for (int r = 1; r < polygon.numRings(); r++) { |
| rings[r - 1] = geomFactory |
| .createLinearRing(toJTSCoordinates(polygon.getRing(r) |
| .getPoints())); |
| } |
| out = geomFactory.createPolygon(shell, rings); |
| } else { |
| out = geomFactory.createPolygon(shell, null); |
| } |
| out.setSRID(polygon.srid); |
| return out; |
| } |
| private com.vividsolutions.jts.geom.Coordinate[] toJTSCoordinates( |
| Point[] points) { |
| Coordinate[] coordinates = new Coordinate[points.length]; |
| for (int i = 0; i < points.length; i++) { |
| coordinates[i] = new Coordinate(points[i].x, points[i].y); |
| } |
| return coordinates; |
| } |
| protected com.vividsolutions.jts.geom.Point convertPoint(Point pnt) { |
| com.vividsolutions.jts.geom.Point g = geomFactory |
| .createPoint(new Coordinate(pnt.x, pnt.y)); |
| g.setSRID(pnt.getSrid()); |
| return g; |
| } |
| private Point[] toPoints(Coordinate[] coordinates) { |
| Point[] points = new Point[coordinates.length]; |
| for (int i = 0; i < coordinates.length; i++) { |
| points[i] = new Point(coordinates[i].x, coordinates[i].y); |
| } |
| return points; |
| } |
| protected com.vividsolutions.jts.geom.LineString convertLineString( |
| org.postgis.LineString lstr) { |
| com.vividsolutions.jts.geom.LineString out = geomFactory |
| .createLineString(toJTSCoordinates(lstr.getPoints())); |
| out.setSRID(lstr.getSrid()); |
| return out; |
| } |
| /** |
| * Converts a JTS <code>Geometry</code> to a native geometry object. |
| * |
| * @param jtsGeom |
| * JTS Geometry to convert |
| * @param connection |
| * the current database connection |
| * @return native database geometry object corresponding to jtsGeom. |
| */ |
| public Object conv2DBGeometry(Geometry jtsGeom, Connection connection) { |
| org.postgis.Geometry geom = null; |
| if (jtsGeom.getClass() == com.vividsolutions.jts.geom.Point.class) { |
| geom = convertJTSPoint((com.vividsolutions.jts.geom.Point) jtsGeom); |
| } else if (jtsGeom.getClass() == com.vividsolutions.jts.geom.LineString.class) { |
| geom = convertJTSLineString((com.vividsolutions.jts.geom.LineString) jtsGeom); |
| } else if (jtsGeom.getClass() == com.vividsolutions.jts.geom.MultiLineString.class) { |
| geom = convertJTSMultiLineSTring((com.vividsolutions.jts.geom.MultiLineString) jtsGeom); |
| } else if (jtsGeom.getClass() == com.vividsolutions.jts.geom.Polygon.class) { |
| geom = convertJTSPolygon((com.vividsolutions.jts.geom.Polygon) jtsGeom); |
| } else if (jtsGeom.getClass() == com.vividsolutions.jts.geom.MultiPoint.class) { |
| geom = convertJTSMultiPoint((com.vividsolutions.jts.geom.MultiPoint) jtsGeom); |
| } else if (jtsGeom.getClass() == com.vividsolutions.jts.geom.MultiPolygon.class) { |
| geom = convertJTSMultiPolygon((com.vividsolutions.jts.geom.MultiPolygon) jtsGeom); |
| } |
| private com.vividsolutions.jts.geom.Coordinate[] toJTSCoordinates( |
| Point[] points) { |
| Coordinate[] coordinates = new Coordinate[points.length]; |
| for (int i = 0; i < points.length; i++) { |
| coordinates[i] = new Coordinate(points[i].x, points[i].y); |
| } |
| return coordinates; |
| } |
| if (geom != null) |
| return new PGgeometry(geom); |
| else |
| throw new UnsupportedOperationException("Conversion of " |
| + jtsGeom.getClass().getSimpleName() |
| + " to PGgeometry not supported"); |
| } |
| private Point[] toPoints(Coordinate[] coordinates) { |
| Point[] points = new Point[coordinates.length]; |
| for (int i = 0; i < coordinates.length; i++) { |
| points[i] = new Point(coordinates[i].x, coordinates[i].y); |
| } |
| return points; |
| } |
| private MultiPolygon convertJTSMultiPolygon( |
| com.vividsolutions.jts.geom.MultiPolygon multiPolygon) { |
| Polygon[] pgPolygons = new Polygon[multiPolygon.getNumGeometries()]; |
| for (int i = 0; i < pgPolygons.length; i++) { |
| pgPolygons[i] = convertJTSPolygon((com.vividsolutions.jts.geom.Polygon) multiPolygon |
| .getGeometryN(i)); |
| } |
| MultiPolygon mpg = new MultiPolygon(pgPolygons); |
| mpg.setSrid(multiPolygon.getSRID()); |
| return mpg; |
| } |
| /** |
| * Converts a JTS <code>Geometry</code> to a native geometry object. |
| * |
| * @param jtsGeom |
| * JTS Geometry to convert |
| * @param connection |
| * the current database connection |
| * @return native database geometry object corresponding to jtsGeom. |
| */ |
| public Object conv2DBGeometry(Geometry jtsGeom, Connection connection) { |
| org.postgis.Geometry geom = null; |
| if (jtsGeom.getClass() == com.vividsolutions.jts.geom.Point.class) { |
| geom = convertJTSPoint((com.vividsolutions.jts.geom.Point) jtsGeom); |
| } else if (jtsGeom.getClass() == com.vividsolutions.jts.geom.LineString.class) { |
| geom = convertJTSLineString((com.vividsolutions.jts.geom.LineString) jtsGeom); |
| } else if (jtsGeom.getClass() == com.vividsolutions.jts.geom.MultiLineString.class) { |
| geom = convertJTSMultiLineSTring((com.vividsolutions.jts.geom.MultiLineString) jtsGeom); |
| } else if (jtsGeom.getClass() == com.vividsolutions.jts.geom.Polygon.class) { |
| geom = convertJTSPolygon((com.vividsolutions.jts.geom.Polygon) jtsGeom); |
| } else if (jtsGeom.getClass() == com.vividsolutions.jts.geom.MultiPoint.class) { |
| geom = convertJTSMultiPoint((com.vividsolutions.jts.geom.MultiPoint) jtsGeom); |
| } else if (jtsGeom.getClass() == com.vividsolutions.jts.geom.MultiPolygon.class) { |
| geom = convertJTSMultiPolygon((com.vividsolutions.jts.geom.MultiPolygon) jtsGeom); |
| } |
| private MultiPoint convertJTSMultiPoint( |
| com.vividsolutions.jts.geom.MultiPoint multiPoint) { |
| Point[] pgPoints = new Point[multiPoint.getNumGeometries()]; |
| for (int i = 0; i < pgPoints.length; i++) { |
| pgPoints[i] = convertJTSPoint((com.vividsolutions.jts.geom.Point) multiPoint |
| .getGeometryN(i)); |
| } |
| MultiPoint mp = new MultiPoint(pgPoints); |
| mp.setSrid(multiPoint.getSRID()); |
| return mp; |
| } |
| if (geom != null) |
| return new PGgeometry(geom); |
| else |
| throw new UnsupportedOperationException("Conversion of " |
| + jtsGeom.getClass().getSimpleName() |
| + " to PGgeometry not supported"); |
| } |
| private Polygon convertJTSPolygon( |
| com.vividsolutions.jts.geom.Polygon jtsPolygon) { |
| int numRings = jtsPolygon.getNumInteriorRing(); |
| org.postgis.LinearRing[] rings = new org.postgis.LinearRing[numRings + 1]; |
| rings[0] = convertJTSLineStringToLinearRing(jtsPolygon |
| .getExteriorRing()); |
| for (int i = 0; i < numRings; i++) { |
| rings[i + 1] = convertJTSLineStringToLinearRing(jtsPolygon |
| .getInteriorRingN(i)); |
| } |
| Polygon polygon = new org.postgis.Polygon(rings); |
| polygon.setSrid(jtsPolygon.getSRID()); |
| return polygon; |
| } |
| private MultiPolygon convertJTSMultiPolygon( |
| com.vividsolutions.jts.geom.MultiPolygon multiPolygon) { |
| Polygon[] pgPolygons = new Polygon[multiPolygon.getNumGeometries()]; |
| for (int i = 0; i < pgPolygons.length; i++) { |
| pgPolygons[i] = convertJTSPolygon((com.vividsolutions.jts.geom.Polygon) multiPolygon |
| .getGeometryN(i)); |
| } |
| MultiPolygon mpg = new MultiPolygon(pgPolygons); |
| mpg.setSrid(multiPolygon.getSRID()); |
| return mpg; |
| } |
| private LinearRing convertJTSLineStringToLinearRing( |
| com.vividsolutions.jts.geom.LineString lineString) { |
| LinearRing lr = new org.postgis.LinearRing(toPoints(lineString |
| .getCoordinates())); |
| lr.setSrid(lineString.getSRID()); |
| return lr; |
| } |
| private MultiPoint convertJTSMultiPoint( |
| com.vividsolutions.jts.geom.MultiPoint multiPoint) { |
| Point[] pgPoints = new Point[multiPoint.getNumGeometries()]; |
| for (int i = 0; i < pgPoints.length; i++) { |
| pgPoints[i] = convertJTSPoint((com.vividsolutions.jts.geom.Point) multiPoint |
| .getGeometryN(i)); |
| } |
| MultiPoint mp = new MultiPoint(pgPoints); |
| mp.setSrid(multiPoint.getSRID()); |
| return mp; |
| } |
| private LineString convertJTSLineString( |
| com.vividsolutions.jts.geom.LineString string) { |
| LineString ls = new org.postgis.LineString(toPoints(string |
| .getCoordinates())); |
| ls.setSrid(string.getSRID()); |
| return ls; |
| } |
| private Polygon convertJTSPolygon( |
| com.vividsolutions.jts.geom.Polygon jtsPolygon) { |
| int numRings = jtsPolygon.getNumInteriorRing(); |
| org.postgis.LinearRing[] rings = new org.postgis.LinearRing[numRings + 1]; |
| rings[0] = convertJTSLineStringToLinearRing(jtsPolygon |
| .getExteriorRing()); |
| for (int i = 0; i < numRings; i++) { |
| rings[i + 1] = convertJTSLineStringToLinearRing(jtsPolygon |
| .getInteriorRingN(i)); |
| } |
| Polygon polygon = new org.postgis.Polygon(rings); |
| polygon.setSrid(jtsPolygon.getSRID()); |
| return polygon; |
| } |
| private MultiLineString convertJTSMultiLineSTring( |
| com.vividsolutions.jts.geom.MultiLineString string) { |
| org.postgis.LineString[] lines = new org.postgis.LineString[string |
| .getNumGeometries()]; |
| for (int i = 0; i < string.getNumGeometries(); i++) { |
| lines[i] = new org.postgis.LineString(toPoints(string |
| .getGeometryN(i).getCoordinates())); |
| } |
| MultiLineString mls = new MultiLineString(lines); |
| mls.setSrid(string.getSRID()); |
| return mls; |
| } |
| private LinearRing convertJTSLineStringToLinearRing( |
| com.vividsolutions.jts.geom.LineString lineString) { |
| LinearRing lr = new org.postgis.LinearRing(toPoints(lineString |
| .getCoordinates())); |
| lr.setSrid(lineString.getSRID()); |
| return lr; |
| } |
| private Point convertJTSPoint(com.vividsolutions.jts.geom.Point point) { |
| org.postgis.Point pgPoint = new org.postgis.Point(); |
| pgPoint.srid = point.getSRID(); |
| pgPoint.x = point.getX(); |
| pgPoint.y = point.getY(); |
| pgPoint.haveMeasure = false; |
| pgPoint.dimension = 2; |
| return pgPoint; |
| } |
| private LineString convertJTSLineString( |
| com.vividsolutions.jts.geom.LineString string) { |
| LineString ls = new org.postgis.LineString(toPoints(string |
| .getCoordinates())); |
| ls.setSrid(string.getSRID()); |
| return ls; |
| } |
| private MultiLineString convertJTSMultiLineSTring( |
| com.vividsolutions.jts.geom.MultiLineString string) { |
| org.postgis.LineString[] lines = new org.postgis.LineString[string |
| .getNumGeometries()]; |
| for (int i = 0; i < string.getNumGeometries(); i++) { |
| lines[i] = new org.postgis.LineString(toPoints(string.getGeometryN( |
| i).getCoordinates())); |
| } |
| MultiLineString mls = new MultiLineString(lines); |
| mls.setSrid(string.getSRID()); |
| return mls; |
| } |
| private Point convertJTSPoint(com.vividsolutions.jts.geom.Point point) { |
| org.postgis.Point pgPoint = new org.postgis.Point(); |
| pgPoint.srid = point.getSRID(); |
| pgPoint.x = point.getX(); |
| pgPoint.y = point.getY(); |
| pgPoint.haveMeasure = false; |
| pgPoint.dimension = 2; |
| return pgPoint; |
| } |
| } |
| /trunk/hibernate-spatial-postgis/src/main/java/org/hibernatespatial/postgis/PostgisDialect.java |
|---|
| 1,14 → 1,15 |
| /** |
| * $Id$ |
| * |
| * This file is part of Spatial Hibernate, an extension to the |
| * This file is part of Hibernate Spatial, an extension to the |
| * hibernate ORM solution for geographic data. |
| * |
| * Copyright © 2007 Geovise BVBA |
| * Copyright © 2007 K.U. Leuven LRD, Spatial Applications Division, Belgium |
| * |
| * This work was partially supported by the European Commission, |
| * under the 6th Framework Programme, contract IST-2-004688-STP. |
| * |
| * |
| * This library is free software; you can redistribute it and/or |
| * modify it under the terms of the GNU Lesser General Public |
| * License as published by the Free Software Foundation; either |
| 23,9 → 24,8 |
| * License along with this library; if not, write to the Free Software |
| * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| * |
| * For more information, visit: http://www.cadrie.com/ |
| * For more information, visit: http://www.hibernatespatial.org/ |
| */ |
| package org.hibernatespatial.postgis; |
| import org.hibernate.Hibernate; |
| 36,146 → 36,147 |
| import org.hibernatespatial.SpatialDialect; |
| import org.hibernatespatial.SpatialRelation; |
| /** |
| * Extends the PostgreSQLDialect by also including information on spatial |
| * operators, constructors and processing functions. |
| * |
| * @author Karel Maesen |
| */ |
| public class PostgisDialect extends PostgreSQLDialect implements |
| SpatialDialect { |
| public class PostgisDialect extends PostgreSQLDialect implements SpatialDialect { |
| public PostgisDialect() { |
| super(); |
| registerColumnType(java.sql.Types.STRUCT, "geometry"); |
| public PostgisDialect() { |
| super(); |
| registerColumnType(java.sql.Types.STRUCT, "geometry"); |
| // registering OGC functions |
| // (spec_simplefeatures_sql_99-04.pdf) |
| // registering OGC functions |
| // (spec_simplefeatures_sql_99-04.pdf) |
| // section 2.1.1.1 |
| // Registerfunction calls for registering geometry functions: |
| // first argument is the OGC standard functionname, second the name as |
| // it occurs in the spatial dialect |
| registerFunction("dimension", new StandardSQLFunction("dimension", |
| Hibernate.INTEGER)); |
| registerFunction("geometrytype", new StandardSQLFunction( |
| "geometrytype", Hibernate.STRING)); |
| registerFunction("srid", new StandardSQLFunction("srid", |
| Hibernate.INTEGER)); |
| registerFunction("envelope", new StandardSQLFunction("envelope", |
| new CustomType(PGGeometryUserType.class, null))); |
| registerFunction("astext", new StandardSQLFunction("astext", |
| Hibernate.STRING)); |
| registerFunction("asbinary", new StandardSQLFunction("asbinary", |
| Hibernate.BINARY)); |
| registerFunction("isempty", new StandardSQLFunction("isempty", |
| Hibernate.BOOLEAN)); |
| registerFunction("issimple", new StandardSQLFunction("issimple", |
| Hibernate.BOOLEAN)); |
| registerFunction("boundary", new StandardSQLFunction("boundary", |
| new CustomType(PGGeometryUserType.class, null))); |
| // section 2.1.1.1 |
| // Registerfunction calls for registering geometry functions: |
| // first argument is the OGC standard functionname, second the name as |
| // it occurs in the spatial dialect |
| registerFunction("dimension", new StandardSQLFunction("dimension", |
| Hibernate.INTEGER)); |
| registerFunction("geometrytype", new StandardSQLFunction( |
| "geometrytype", Hibernate.STRING)); |
| registerFunction("srid", new StandardSQLFunction("srid", |
| Hibernate.INTEGER)); |
| registerFunction("envelope", new StandardSQLFunction("envelope", |
| new CustomType(PGGeometryUserType.class, null))); |
| registerFunction("astext", new StandardSQLFunction("astext", |
| Hibernate.STRING)); |
| registerFunction("asbinary", new StandardSQLFunction("asbinary", |
| Hibernate.BINARY)); |
| registerFunction("isempty", new StandardSQLFunction("isempty", |
| Hibernate.BOOLEAN)); |
| registerFunction("issimple", new StandardSQLFunction("issimple", |
| Hibernate.BOOLEAN)); |
| registerFunction("boundary", new StandardSQLFunction("boundary", |
| new CustomType(PGGeometryUserType.class, null))); |
| // Register functions for spatial relation constructs |
| registerFunction("overlaps", new StandardSQLFunction("overlaps", |
| Hibernate.BOOLEAN)); |
| registerFunction("intersects", new StandardSQLFunction("intersects", |
| Hibernate.BOOLEAN)); |
| registerFunction("equals", new StandardSQLFunction("equals", |
| Hibernate.BOOLEAN)); |
| registerFunction("contains", new StandardSQLFunction("contains", |
| Hibernate.BOOLEAN)); |
| registerFunction("crosses", new StandardSQLFunction("crosses", |
| Hibernate.BOOLEAN)); |
| registerFunction("disjoint", new StandardSQLFunction("disjoint", |
| Hibernate.BOOLEAN)); |
| registerFunction("touches", new StandardSQLFunction("touches", |
| Hibernate.BOOLEAN)); |
| registerFunction("within", new StandardSQLFunction("within", |
| Hibernate.BOOLEAN)); |
| registerFunction("relate", new StandardSQLFunction("relate", |
| Hibernate.BOOLEAN)); |
| // Register functions for spatial relation constructs |
| registerFunction("overlaps", new StandardSQLFunction("overlaps", |
| Hibernate.BOOLEAN)); |
| registerFunction("intersects", new StandardSQLFunction("intersects", |
| Hibernate.BOOLEAN)); |
| registerFunction("equals", new StandardSQLFunction("equals", |
| Hibernate.BOOLEAN)); |
| registerFunction("contains", new StandardSQLFunction("contains", |
| Hibernate.BOOLEAN)); |
| registerFunction("crosses", new StandardSQLFunction("crosses", |
| Hibernate.BOOLEAN)); |
| registerFunction("disjoint", new StandardSQLFunction("disjoint", |
| Hibernate.BOOLEAN)); |
| registerFunction("touches", new StandardSQLFunction("touches", |
| Hibernate.BOOLEAN)); |
| registerFunction("within", new StandardSQLFunction("within", |
| Hibernate.BOOLEAN)); |
| registerFunction("relate", new StandardSQLFunction("relate", |
| Hibernate.BOOLEAN)); |
| // register the spatial analysis functions |
| registerFunction("distance", new StandardSQLFunction("distance", |
| Hibernate.DOUBLE)); |
| registerFunction("buffer", new StandardSQLFunction("buffer", |
| new CustomType(PGGeometryUserType.class, null))); |
| registerFunction("convexhull", new StandardSQLFunction("convexhull", |
| new CustomType(PGGeometryUserType.class, null))); |
| registerFunction("difference", new StandardSQLFunction("difference", |
| new CustomType(PGGeometryUserType.class, null))); |
| registerFunction("intersection", |
| new StandardSQLFunction("intersection", new CustomType( |
| PGGeometryUserType.class, null))); |
| registerFunction("symdifference", new StandardSQLFunction( |
| "symdifference", |
| new CustomType(PGGeometryUserType.class, null))); |
| registerFunction("geomunion", new StandardSQLFunction("geomunion", |
| new CustomType(PGGeometryUserType.class, null))); |
| // register the spatial analysis functions |
| registerFunction("distance", new StandardSQLFunction("distance", |
| Hibernate.DOUBLE)); |
| registerFunction("buffer", new StandardSQLFunction("buffer", |
| new CustomType(PGGeometryUserType.class, null))); |
| registerFunction("convexhull", new StandardSQLFunction("convexhull", |
| new CustomType(PGGeometryUserType.class, null))); |
| registerFunction("difference", new StandardSQLFunction("difference", |
| new CustomType(PGGeometryUserType.class, null))); |
| registerFunction("intersection", new StandardSQLFunction( |
| "intersection", new CustomType(PGGeometryUserType.class, null))); |
| registerFunction("symdifference", |
| new StandardSQLFunction("symdifference", new CustomType( |
| PGGeometryUserType.class, null))); |
| registerFunction("geomunion", new StandardSQLFunction("geomunion", |
| new CustomType(PGGeometryUserType.class, null))); |
| } |
| } |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.walkonweb.spatial.dialect.SpatialEnabledDialect#getSpatialRelateExpression(java.lang.String, |
| * int, boolean) |
| */ |
| public String getSpatialRelateSQL(String columnName, int spatialRelation, |
| boolean hasFilter) { |
| switch (spatialRelation) { |
| case SpatialRelation.WITHIN: |
| return hasFilter ? "(" + columnName + " && ? AND within(" |
| + columnName + ", ?))" : " within(" + columnName + ",?)"; |
| case SpatialRelation.CONTAINS: |
| return hasFilter ? "(" + columnName + " && ? AND contains(" |
| + columnName + ", ?))" : " contains(" + columnName |
| + ", ?)"; |
| case SpatialRelation.CROSSES: |
| return hasFilter ? "(" + columnName + " && ? AND crosses(" |
| + columnName + ", ?))" : " crosses(" + columnName + ", ?)"; |
| case SpatialRelation.OVERLAPS: |
| return hasFilter ? "(" + columnName + " && ? AND overlaps(" |
| + columnName + ", ?))" : " overlaps(" + columnName |
| + ", ?)"; |
| case SpatialRelation.DISJOINT: |
| return hasFilter ? "(" + columnName + " && ? AND disjoint(" |
| + columnName + ", ?))" : " disjoint(" + columnName |
| + ", ?)"; |
| case SpatialRelation.INTERSECTS: |
| return hasFilter ? "(" + columnName + " && ? AND intersects(" |
| + columnName + ", ?))" : " intersects(" + columnName |
| + ", ?)"; |
| case SpatialRelation.TOUCHES: |
| return hasFilter ? "(" + columnName + " && ? AND touches(" |
| + columnName + ", ?))" : " touches(" + columnName + ", ?)"; |
| case SpatialRelation.EQUALS: |
| return hasFilter ? "(" + columnName + " && ? AND equals(" |
| + columnName + ", ?))" : " equals(" + columnName + ", ?)"; |
| default: |
| throw new IllegalArgumentException( |
| "Spatial relation is not known by this dialect"); |
| } |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.walkonweb.spatial.dialect.SpatialEnabledDialect#getSpatialRelateExpression(java.lang.String, |
| * int, boolean) |
| */ |
| public String getSpatialRelateSQL(String columnName, int spatialRelation, |
| boolean hasFilter) { |
| switch (spatialRelation) { |
| case SpatialRelation.WITHIN: |
| return hasFilter ? "(" + columnName + " && ? AND within(" |
| + columnName + ", ?))" : " within(" + columnName + ",?)"; |
| case SpatialRelation.CONTAINS: |
| return hasFilter ? "(" + columnName + " && ? AND contains(" |
| + columnName + ", ?))" : " contains(" + columnName + ", ?)"; |
| case SpatialRelation.CROSSES: |
| return hasFilter ? "(" + columnName + " && ? AND crosses(" |
| + columnName + ", ?))" : " crosses(" + columnName + ", ?)"; |
| case SpatialRelation.OVERLAPS: |
| return hasFilter ? "(" + columnName + " && ? AND overlaps(" |
| + columnName + ", ?))" : " overlaps(" + columnName + ", ?)"; |
| case SpatialRelation.DISJOINT: |
| return hasFilter ? "(" + columnName + " && ? AND disjoint(" |
| + columnName + ", ?))" : " disjoint(" + columnName + ", ?)"; |
| case SpatialRelation.INTERSECTS: |
| return hasFilter ? "(" + columnName + " && ? AND intersects(" |
| + columnName + ", ?))" : " intersects(" + columnName |
| + ", ?)"; |
| case SpatialRelation.TOUCHES: |
| return hasFilter ? "(" + columnName + " && ? AND touches(" |
| + columnName + ", ?))" : " touches(" + columnName + ", ?)"; |
| case SpatialRelation.EQUALS: |
| return hasFilter ? "(" + columnName + " && ? AND equals(" |
| + columnName + ", ?))" : " equals(" + columnName + ", ?)"; |
| default: |
| throw new IllegalArgumentException( |
| "Spatial relation is not known by this dialect"); |
| } |
| } |
| } |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.walkonweb.spatial.dialect.SpatialEnabledDialect#getSpatialFilterExpression(java.lang.String) |
| */ |
| public String getSpatialFilterExpression(String columnName) { |
| return "(" + columnName + " && ? ) "; |
| } |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.walkonweb.spatial.dialect.SpatialEnabledDialect#getSpatialFilterExpression(java.lang.String) |
| */ |
| public String getSpatialFilterExpression(String columnName) { |
| return "(" + columnName + " && ? ) "; |
| } |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.hibernatespatial.SpatialDialect#getGeometryUserType() |
| */ |
| public UserType getGeometryUserType() { |
| return new PGGeometryUserType(); |
| } |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.hibernatespatial.SpatialDialect#getGeometryUserType() |
| */ |
| public UserType getGeometryUserType() { |
| return new PGGeometryUserType(); |
| } |
| public String getSpatialAggregateSQL(String columnName, int aggregation, |
| boolean isProjection) { |
| // todo needs implemented |
| throw new UnsupportedOperationException( |
| "This method is not yet supported in PostGis"); |
| } |
| } |
| /trunk/hibernate-spatial-postgis/src/site/site.xml |
|---|
| 1,15 → 1,11 |
| <?xml version="1.0" encoding="ISO-8859-1"?> |
| <project name="Hibernate"> |
| <project name="Hibernate Spatial Postgis provider"> |
| <bannerLeft> |
| <name>Hibernate Spatial</name> |
| <href>http://www.cadrie.com/projects/majas-hibernate</href> |
| <name>Hibernate Spatial Postgis Provider</name> |
| <href>http://www.hibernatespatial.org/hibernate-spatial-postgis/index.html</href> |
| </bannerLeft> |
| <bannerRight> |
| <name>Cadrie</name> |
| <src>http://www.cadrie.com/</src> |
| </bannerRight> |
| <skin> |
| <groupId>org.apache.maven.skins</groupId> |
| 21,8 → 17,8 |
| <body> |
| <menu name="Overview" inherit="top"> |
| <item name="Introduction" href="hibernate-spatial-postgis/index.html"/> |
| <item name="Usage" href="hibernate-spatial-postgis/usage.html"/> |
| <item name="Introduction" href="index.html"/> |
| <item name="Usage" href="usage.html"/> |
| </menu> |
| /trunk/hibernate-spatial-postgis/pom.xml |
|---|
| 18,13 → 18,20 |
| <description> |
| Postgis (Postgresql) dialect provider for Hibernate Spatial |
| </description> |
| <dependencies> |
| <dependency> |
| <groupId>${project.groupId}</groupId> |
| <artifactId>hibernate-spatial</artifactId> |
| <version>${project.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>${project.groupId}</groupId> |
| <artifactId>hibernate-spatial</artifactId> |
| <version>${project.version}</version> |
| <classifier>tests</classifier> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.postgis</groupId> |
| <artifactId>postgis-jdbc</artifactId> |