org.deegree_impl.model.geometry
Class PostGISAdapter

java.lang.Object
  extended byorg.deegree_impl.model.geometry.PostGISAdapter

public class PostGISAdapter
extends java.lang.Object

Version:
$Revision: 1.9 $
Author:
Jeronimo Wanhoff, Andreas Poth

Constructor Summary
PostGISAdapter()
           
 
Method Summary
private static GM_Curve createCurve(LineString lineString, CS_CoordinateSystem crs)
          creates a deegree curve from a PostGIS linestring
private static GM_MultiCurve createMultiCurve(MultiLineString mlinestring, CS_CoordinateSystem crs)
          creates a deegree multi curve from a PostGIS multi lineString
private static GM_MultiPoint createMultiPoint(MultiPoint mpoint, CS_CoordinateSystem crs)
          creates a deegree multi point from a PostGIS multi point
private static GM_MultiSurface createMultiSurface(MultiPolygon mpolygon, CS_CoordinateSystem crs)
          creates a deegree multi surface from a PostGIS multi polygon
private static GM_Point createPoint(Point ppoint, CS_CoordinateSystem crs)
          creates a deegree point from a PostGIS point
private static GM_Surface createSurface(Polygon polygon, CS_CoordinateSystem crs)
          creates a deegree surface from a PostGIS polygon
private static LineString export(GM_Curve curve)
          transforms the passed deegree GM_Curve to a postgis LineString
private static MultiLineString export(GM_MultiCurve mcurve)
          transforms the passed deegree GM_MultiCurve to a postgis MultiLineString
private static MultiPoint export(GM_MultiPoint mpoint)
          transforms the passed deegree GM_MultiPoint to a postgis multipoint
private static MultiPolygon export(GM_MultiSurface msurface)
          transforms the passed deegree GM_MultiSurface to a postgis MultiPolygon
static Geometry export(GM_Object geom)
          exports the passed deegree geometry as the corresponding postgis geometry
private static Point export(GM_Point point)
          transforms the passed deegree GM_Point to a postgis point
private static Polygon export(GM_Surface surface)
          transforms the passed deegree GM_Surface to a postgis Polygon
static GM_Object wrap(PGgeometry geom, CS_CoordinateSystem crs)
          creates a deegree geometry from the passed postgis geometry and CRS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostGISAdapter

public PostGISAdapter()
Method Detail

wrap

public static GM_Object wrap(PGgeometry geom,
                             CS_CoordinateSystem crs)
                      throws GM_Exception
creates a deegree geometry from the passed postgis geometry and CRS

Parameters:
geom - postgis geometry
crs - coordinate reference system
Returns:
deegree geometry
Throws:
GM_Exception

export

public static Geometry export(GM_Object geom)
                       throws GM_Exception
exports the passed deegree geometry as the corresponding postgis geometry

Parameters:
geom - deegree geometry
Returns:
postgis geometry
Throws:
GM_Exception

createPoint

private static GM_Point createPoint(Point ppoint,
                                    CS_CoordinateSystem crs)
                             throws GM_Exception
creates a deegree point from a PostGIS point

Parameters:
ppoint - postgis point
Throws:
GM_Exception

createCurve

private static GM_Curve createCurve(LineString lineString,
                                    CS_CoordinateSystem crs)
                             throws GM_Exception
creates a deegree curve from a PostGIS linestring

Parameters:
lineString - postgis linestring
Throws:
GM_Exception

createSurface

private static GM_Surface createSurface(Polygon polygon,
                                        CS_CoordinateSystem crs)
                                 throws GM_Exception
creates a deegree surface from a PostGIS polygon

Parameters:
polygon - postgis polygon
Throws:
GM_Exception

createMultiPoint

private static GM_MultiPoint createMultiPoint(MultiPoint mpoint,
                                              CS_CoordinateSystem crs)
                                       throws GM_Exception
creates a deegree multi point from a PostGIS multi point

Parameters:
mpoint - postgis multi point
Throws:
GM_Exception

createMultiCurve

private static GM_MultiCurve createMultiCurve(MultiLineString mlinestring,
                                              CS_CoordinateSystem crs)
                                       throws GM_Exception
creates a deegree multi curve from a PostGIS multi lineString

Parameters:
mlinestring - postgis multi lineString
Throws:
GM_Exception

createMultiSurface

private static GM_MultiSurface createMultiSurface(MultiPolygon mpolygon,
                                                  CS_CoordinateSystem crs)
                                           throws GM_Exception
creates a deegree multi surface from a PostGIS multi polygon

Parameters:
mpolygon - postgis multi polygon
Throws:
GM_Exception

export

private static Point export(GM_Point point)
                     throws GM_Exception
transforms the passed deegree GM_Point to a postgis point

Parameters:
point - deegree GM_Point
Throws:
GM_Exception

export

private static LineString export(GM_Curve curve)
                          throws GM_Exception
transforms the passed deegree GM_Curve to a postgis LineString

Parameters:
curve - deegree GM_Curve
Throws:
GM_Exception

export

private static Polygon export(GM_Surface surface)
                       throws GM_Exception
transforms the passed deegree GM_Surface to a postgis Polygon

Parameters:
surface - deegree GM_Surface
Throws:
GM_Exception

export

private static MultiPoint export(GM_MultiPoint mpoint)
                          throws GM_Exception
transforms the passed deegree GM_MultiPoint to a postgis multipoint

Parameters:
mpoint - deegree GM_MultiPoint
Throws:
GM_Exception

export

private static MultiLineString export(GM_MultiCurve mcurve)
                               throws GM_Exception
transforms the passed deegree GM_MultiCurve to a postgis MultiLineString

Parameters:
mcurve - deegree GM_MultiCurve
Throws:
GM_Exception

export

private static MultiPolygon export(GM_MultiSurface msurface)
                            throws GM_Exception
transforms the passed deegree GM_MultiSurface to a postgis MultiPolygon

Parameters:
msurface - deegree GM_MultiSurface
Throws:
GM_Exception