OmniSciDB  471d68cefb
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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

boolean isAutoCommitDisabledRequired ()
 
String get_wkt (ResultSet rs, int column_number, String gis_type_name) throws SQLException
 
GisType 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 String gis_type_to_str (GisType type)
 
- Static Protected Attributes inherited from com.mapd.utility.db_vendors.Db_vendor_types
static HashSet< Integer > valid_srid
 

Detailed Description

Definition at line 70 of file Db_vendor_types.java.

Constructor & Destructor Documentation

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

Definition at line 71 of file Db_vendor_types.java.

71 {}

Member Function Documentation

GisType 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 93 of file Db_vendor_types.java.

References com.mapd.utility.db_vendors.OmniSciGeo_types.geo_types, run_benchmark_import.result, com.mapd.utility.db_vendors.OmniSciGeo_types.subtypes, and com.mapd.utility.db_vendors.Db_vendor_types.valid_srid.

95  {
96  String column_name = metadata.getColumnName(column_number);
97  String column_type_name = metadata.getColumnTypeName(column_number);
98  if (!geo_types.contains(column_type_name.toLowerCase()))
99  throw new SQLException(
100  "type not supported: " + column_type_name + " for column " + column_name);
101  int srid = metadata.getScale(column_number);
102  if (!valid_srid.contains(srid) && srid != 0)
103  throw new SQLException(
104  "srid is not supported: " + srid + " for column " + column_name);
105  int subtype = metadata.getPrecision(column_number);
106  if (!subtypes.containsKey(subtype))
107  throw new SQLException(
108  "Subtype is not supported: " + subtype + " for column " + column_name);
109  GisType result = new GisType();
110  result.srid = srid;
111  result.subtype = subtypes.get(subtype);
112  result.type = column_type_name.toUpperCase();
113  return result;
114  }
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 88 of file Db_vendor_types.java.

89  {
90  return rs.getString(column_number);
91  }
boolean com.mapd.utility.db_vendors.OmniSciGeo_types.isAutoCommitDisabledRequired ( )
inlinevirtual

Implements com.mapd.utility.db_vendors.Db_vendor_types.

Definition at line 73 of file Db_vendor_types.java.

73  {
74  return false;
75  }

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 76 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 81 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: