OmniSciDB  95562058bd
 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

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

Constructor & Destructor Documentation

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

Definition at line 73 of file Db_vendor_types.java.

73 {}

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 95 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.

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

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

Implements com.mapd.utility.db_vendors.Db_vendor_types.

Definition at line 75 of file Db_vendor_types.java.

75  {
76  return false;
77  }

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 78 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 83 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: