deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.crs.configuration.deegree.db
Class CRSDBExporter

java.lang.Object
  extended by org.deegree.crs.configuration.deegree.db.CRSDBExporter

public class CRSDBExporter
extends Object

The CRSDBExporter class inserts a CRS object in the database. In order not to introduce an object twice, the codetype( sometimes - when the code is not provided - the objects's data) is checked not to exist already in the database.

Version:
$Revision: $, $Date: $
Author:
Andrei Ionita, last edited by: $Author: aionita $

Constructor Summary
CRSDBExporter()
          CRS database exporter
 
Method Summary
protected  int export(Axis axis)
          Inserts the Axis properties into the database
protected  int export(CompoundCRS compound)
          Insert into the database the supplied Compound CRS
protected  int export(CoordinateSystem crs)
          Delegate the CRS to the specific exporting method
protected  int export(Ellipsoid ellipsoid)
          Insert the Ellipsoid object data into the database
protected  int export(GeocentricCRS geocentric)
          Insert the Geocentric CRS data into the database
protected  int export(GeodeticDatum gdatum)
          Insert the Geodetic Datum properties into the database
protected  int export(GeographicCRS geographic)
          Inserts the GeographicCRS data into the database
protected  int export(Helmert helmert)
          Insert the Helmert Transformation properties into the database
protected  int export(LambertAzimuthalEqualArea lambertAzimuthal)
          Insert into the database the Lambert Azimuthal Equal Area projection properties
protected  int export(LambertConformalConic lambertConformal)
          Insert into the database the Lambert Conformal Conic projection properties
 void export(List<CoordinateSystem> crsList)
          Export to database the supplied list of CoordinateSystems
protected  int export(Mercator mercator)
          Inserts the Mercator projection into the database
protected  int export(PrimeMeridian pm)
          Insert the Prime Meridian properties into the database
protected  int export(ProjectedCRS projected)
          Inserts the Projected CRS data into the database
protected  int export(Projection projection)
          Checks for the type of projection that is supplied and delegates the insertion to the specific methods.
protected  int export(StereographicAlternative stereographicAl)
          Inserts into the database the Stereographic Alternative projection properties
protected  int export(StereographicAzimuthal stereographicAz)
          Insert into the database the Stereographic Azimuthal projection properties
protected  int export(TransverseMercator transMercator)
          Inserts the Transverse Mercator projection into the database
protected  int export(VerticalCRS vertical)
          Insert the Vertical CRS data into the database
protected  int export(VerticalDatum vDatum)
          Export the Vertical Datum to the database
protected  void exportIdentifiableProperties(CRSIdentifiable crsObject)
          Insert into the database the core Identifiable properties of an object
static void main(String[] args)
          Command-line tool for inserting a CRS that is provided in a either in WKT format (via a filename argument), or in XML format (through its codetype).
protected  void setConnection(Connection connection)
          Set the database connection (that is usually obtained from DatabaseCRSProvider)
protected  void setNullDoubleIf(double d, int pos, PreparedStatement preparedSt)
          Checks if the double variable to be inserted in the database is NULL, and if so, sets the database value to NULL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRSDBExporter

public CRSDBExporter()
CRS database exporter

Method Detail

setConnection

protected void setConnection(Connection connection)
Set the database connection (that is usually obtained from DatabaseCRSProvider)

Parameters:
connection - the database connection

exportIdentifiableProperties

protected void exportIdentifiableProperties(CRSIdentifiable crsObject)
Insert into the database the core Identifiable properties of an object

Parameters:
crsObject - any CRS object

export

protected int export(LambertAzimuthalEqualArea lambertAzimuthal)
              throws SQLException
Insert into the database the Lambert Azimuthal Equal Area projection properties

Parameters:
lambertAzimuthal - the Lambert Azimuthal Equal Area projection object
Returns:
the internal database ID assigned to the supplied object
Throws:
SQLException - when an SQLException occurs

export

protected int export(StereographicAlternative stereographicAl)
              throws SQLException
Inserts into the database the Stereographic Alternative projection properties

Parameters:
stereographicAl - the Stereographic Alternative projection object
Returns:
the internal database ID assigned to the object
Throws:
SQLException - when an SQLException occurs

export

protected int export(StereographicAzimuthal stereographicAz)
              throws SQLException
Insert into the database the Stereographic Azimuthal projection properties

Parameters:
stereographicAz - the Stereographic Azimuthal projection object
Returns:
the internal database ID assigned to the object
Throws:
SQLException - when an SQLException occurs

export

protected int export(LambertConformalConic lambertConformal)
              throws SQLException
Insert into the database the Lambert Conformal Conic projection properties

Parameters:
lambertConformal - the Lambert Conformal projection object
Returns:
the internal database ID assigned to the object
Throws:
SQLException - when an SQLException occurs

setNullDoubleIf

protected void setNullDoubleIf(double d,
                               int pos,
                               PreparedStatement preparedSt)
Checks if the double variable to be inserted in the database is NULL, and if so, sets the database value to NULL. Otherwise simply fill the insert statement with the double variable.

Parameters:
d - the double variable from the insert statement
pos - the position of the variable in the PreparedStatement from the java.sql
preparedSt - the PreparedStatement

export

protected int export(TransverseMercator transMercator)
              throws SQLException
Inserts the Transverse Mercator projection into the database

Parameters:
transMercator - the Transform Mercator projection object
Returns:
the internal database ID assigned to the object
Throws:
SQLException - when an SQLException occurs

export

protected int export(Mercator mercator)
              throws SQLException
Inserts the Mercator projection into the database

Parameters:
mercator - the Mercator projection object
Returns:
the internal database ID assigned to the object
Throws:
SQLException - when an SQLException occurs

export

protected int export(Axis axis)
              throws SQLException
Inserts the Axis properties into the database

Parameters:
axis - the Axis object
Returns:
the internal database ID assigned to the Axis object
Throws:
SQLException - when an SQLException occurs

export

protected int export(VerticalDatum vDatum)
              throws SQLException
Export the Vertical Datum to the database

Parameters:
vDatum - the Vertical Datum object
Returns:
the internal database ID assigned to the Vertical Datum
Throws:
SQLException - when an SQLException occurs

export

protected int export(VerticalCRS vertical)
              throws SQLException
Insert the Vertical CRS data into the database

Parameters:
vertical - the Vertical CRS object
Returns:
the database internal ID assigned to the Vertical CRS
Throws:
SQLException - when an SQLException occurs

export

protected int export(Helmert helmert)
              throws SQLException
Insert the Helmert Transformation properties into the database

Parameters:
helmert - the helmert transformation object to be exported
Returns:
the internal database ID assigned to the Helmert transformation object
Throws:
SQLException - when an SQLException occurs

export

protected int export(PrimeMeridian pm)
              throws SQLException
Insert the Prime Meridian properties into the database

Parameters:
pm - the Prime Meridian object
Returns:
the internal database ID assigned to the object
Throws:
SQLException - when an SQLException occurs

export

protected int export(Ellipsoid ellipsoid)
              throws SQLException
Insert the Ellipsoid object data into the database

Parameters:
ellipsoid - the ellipsoid object
Returns:
the internal database ID assigned to the ellipsoid
Throws:
SQLException - when an SQLException occurs

export

protected int export(GeodeticDatum gdatum)
              throws SQLException
Insert the Geodetic Datum properties into the database

Parameters:
gdatum - the Geodetic Datum object
Returns:
the internal database ID assigned to the Geodetic Datum
Throws:
SQLException - when an SQLException occurs

export

protected int export(GeocentricCRS geocentric)
              throws SQLException
Insert the Geocentric CRS data into the database

Parameters:
geocentric - the Geocentric CRS object
Returns:
the database internal ID assigned to the Geocentric CRS
Throws:
SQLException - when an SQLException occurs

export

protected int export(GeographicCRS geographic)
              throws SQLException
Inserts the GeographicCRS data into the database

Parameters:
geographic - the Geographic CRS object
Returns:
the internal database ID for the Geographic CRS
Throws:
SQLException - when an SQLException occurs

export

protected int export(Projection projection)
              throws SQLException
Checks for the type of projection that is supplied and delegates the insertion to the specific methods.

Parameters:
projection - the Projection object
Returns:
the internal database ID that was assigned to the projection
Throws:
SQLException - when and SQLException occurs

export

protected int export(ProjectedCRS projected)
              throws SQLException
Inserts the Projected CRS data into the database

Parameters:
projected - the projected CRS object
Returns:
the database internal ID assigned to the Geocentric CRS
Throws:
SQLException

export

protected int export(CompoundCRS compound)
              throws SQLException,
                     CRSException
Insert into the database the supplied Compound CRS

Parameters:
compound - the Compound CRS object
Returns:
the internal database ID assigned to the Compound CRS
Throws:
SQLException
CRSException

export

protected int export(CoordinateSystem crs)
              throws SQLException,
                     CRSException
Delegate the CRS to the specific exporting method

Parameters:
crs - the CRS object
Returns:
the internal database id that was assigned to the supplied CoordinateSystem
Throws:
SQLException
CRSException

export

public void export(List<CoordinateSystem> crsList)
            throws SQLException,
                   CRSException
Export to database the supplied list of CoordinateSystems

Parameters:
crsList - the CoordinateSystems as a List
Throws:
SQLException
CRSException

main

public static void main(String[] args)
                 throws IOException,
                        UnknownCRSException
Command-line tool for inserting a CRS that is provided in a either in WKT format (via a filename argument), or in XML format (through its codetype).

Parameters:
args -
Throws:
IOException
UnknownCRSException

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org

]]>