OmniSciDB  06b3bd477c
 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
 
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 55 of file Db_vendor_types.java.

Constructor & Destructor Documentation

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

Definition at line 56 of file Db_vendor_types.java.

56 {}

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

77  {
78  String column_name = metadata.getColumnName(column_number);
79  String column_type_name = metadata.getColumnTypeName(column_number);
80  if (!geo_types.contains(column_type_name.toLowerCase()))
81  throw new SQLException(
82  "type not supported: " + column_type_name + " for column " + column_name);
83  int srid = metadata.getScale(column_number);
84  if (!valid_srid.contains(srid) && srid != 0)
85  throw new SQLException(
86  "srid is not supported: " + srid + " for column " + column_name);
87  int subtype = metadata.getPrecision(column_number);
88  if (!subtypes.containsKey(subtype))
89  throw new SQLException(
90  "Subtype is not supported: " + subtype + " for column " + column_name);
91  GisType result = new GisType();
92  result.srid = srid;
93  result.subtype = subtypes.get(subtype);
94  result.type = column_type_name.toUpperCase();
95  return result;
96  }
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 70 of file Db_vendor_types.java.

71  {
72  return rs.getString(column_number);
73  }

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 58 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 63 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: