OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
com.mapd.utility.db_vendors.OmniSciGeo_types Class Reference
+ Inheritance diagram for com.mapd.utility.db_vendors.OmniSciGeo_types:
+ Collaboration diagram for com.mapd.utility.db_vendors.OmniSciGeo_types:

Public Member Functions

String get_wkt (ResultSet rs, int column_number, String gis_type_name) throws SQLException
 
String find_gis_type (Connection conn, ResultSetMetaData metadata, int column_number) throws SQLException
 

Protected Member Functions

 OmniSciGeo_types ()
 
- Protected Member Functions inherited from com.mapd.utility.db_vendors.Db_vendor_types
 Db_vendor_types ()
 

Static Private Attributes

static final HashSet< String > geo_types
 
static Hashtable< Integer, String > subtypes
 

Additional Inherited Members

- Static Public Member Functions inherited from com.mapd.utility.db_vendors.Db_vendor_types
static
com.mapd.utility.db_vendors.Db_vendor_types 
Db_vendor_factory (String connection_str)
 
- Static Protected Attributes inherited from com.mapd.utility.db_vendors.Db_vendor_types
static HashSet< Integer > valid_srid
 

Detailed Description

Definition at line 35 of file Db_vendor_types.java.

Constructor & Destructor Documentation

com.mapd.utility.db_vendors.OmniSciGeo_types.OmniSciGeo_types ( )
inlineprotected

Definition at line 36 of file Db_vendor_types.java.

36 {}

Member Function Documentation

String com.mapd.utility.db_vendors.OmniSciGeo_types.find_gis_type ( Connection  conn,
ResultSetMetaData  metadata,
int  column_number 
) throws SQLException
inlinevirtual

Implements com.mapd.utility.db_vendors.Db_vendor_types.

Definition at line 55 of file Db_vendor_types.java.

References com.mapd.utility.db_vendors.OmniSciGeo_types.geo_types, Experimental.String, com.mapd.utility.db_vendors.OmniSciGeo_types.subtypes, and com.mapd.utility.db_vendors.Db_vendor_types.valid_srid.

57  {
58  String column_name = metadata.getColumnName(column_number);
59  String column_type_name = metadata.getColumnTypeName(column_number);
60  if (!geo_types.contains(column_type_name.toLowerCase()))
61  throw new SQLException(
62  "type not supported: " + column_type_name + " for column " + column_name);
63  int srid = metadata.getScale(column_number);
64  if (!valid_srid.contains(srid) && srid != 0)
65  throw new SQLException(
66  "srid is not supported: " + srid + " for column " + column_name);
67  int subtype = metadata.getPrecision(column_number);
68  if (!subtypes.containsKey(subtype))
69  throw new SQLException(
70  "Subtype is not supported: " + subtype + " for column " + column_name);
71 
72  StringBuffer column_sql_definition = new StringBuffer();
73  column_sql_definition.append(subtypes.get(subtype) + "(");
74  column_sql_definition.append(column_type_name.toUpperCase());
75  if (srid != 0) {
76  column_sql_definition.append("," + srid);
77  }
78  column_sql_definition.append(")");
79  return column_sql_definition.toString();
80  }
static final HashSet< String > geo_types
static Hashtable< Integer, String > subtypes
String com.mapd.utility.db_vendors.OmniSciGeo_types.get_wkt ( ResultSet  rs,
int  column_number,
String  gis_type_name 
) throws SQLException
inlinevirtual

Implements com.mapd.utility.db_vendors.Db_vendor_types.

Definition at line 50 of file Db_vendor_types.java.

51  {
52  return rs.getString(column_number);
53  }

Member Data Documentation

final HashSet<String> com.mapd.utility.db_vendors.OmniSciGeo_types.geo_types
staticprivate
Initial value:
=
new HashSet<>(Arrays.asList("point", "linestring", "polygon", "multipolygon"))

Definition at line 38 of file Db_vendor_types.java.

Referenced by com.mapd.utility.db_vendors.OmniSciGeo_types.find_gis_type().

Hashtable<Integer, String> com.mapd.utility.db_vendors.OmniSciGeo_types.subtypes
staticprivate
Initial value:
= new Hashtable() {
{
put(23, "GEOMETRY");
put(24, "GEOGRAPHY");
}
}

Definition at line 43 of file Db_vendor_types.java.

Referenced by com.mapd.utility.db_vendors.OmniSciGeo_types.find_gis_type().


The documentation for this class was generated from the following file: