27 #include "../common/Translator.h"
28 #include "../datatype.h"
29 #include "../dataaccess/dataset/DataSetType.h"
30 #include "../dataaccess/dataset/ForeignKey.h"
31 #include "../dataaccess/dataset/CheckConstraint.h"
32 #include "../dataaccess/dataset/Constraint.h"
33 #include "../dataaccess/dataset/PrimaryKey.h"
34 #include "../dataaccess/dataset/UniqueKey.h"
35 #include "../dataaccess/utils/Utils.h"
36 #include "../geometry/GeometryProperty.h"
37 #include "../geometry/Envelope.h"
38 #include "../geometry/Enums.h"
39 #include "../memory/DataSet.h"
40 #include "../memory/DataSetItem.h"
48 #include <boost/format.hpp>
49 #include <boost/lexical_cast.hpp>
53 if( FAILED(hr) ) _com_issue_error( hr );
63 SAFEARRAYBOUND rgsabound[1];
64 rgsabound[0].lLbound = 0;
65 rgsabound[0].cElements = size;
67 psa = SafeArrayCreate(VT_I1, 1, rgsabound);
69 if(SafeArrayAccessData(psa,(
void **)&pByte) == NOERROR)
70 memcpy(pByte, blob, size);
71 SafeArrayUnaccessData(psa);
73 var.vt = VT_ARRAY | VT_UI1;
78 throw Exception(
TR_ADO(e.Description()));
84 std::map<std::string, std::string>::const_iterator it = dsInfo.find(
"PROVIDER");
85 std::map<std::string, std::string>::const_iterator it_end = dsInfo.end();
89 connInfo +=
"Provider=" + it->second;
91 it = dsInfo.find(
"DB_NAME");
94 connInfo +=
";Data Source=" + it->second;
96 it = dsInfo.find(
"USER_NAME");
99 connInfo +=
";User Id=" + it->second;
101 it = dsInfo.find(
"PASSWORD");
104 connInfo +=
";Jet OLEDB:Database Password=" + it->second +
";";
114 if(var.vt == (VT_ARRAY | VT_UI1))
116 SafeArrayAccessData(var.parray,(
void **)&cdata);
117 blob =
new char[size];
118 memcpy(blob, cdata, size);
119 SafeArrayUnaccessData(var.parray);
124 throw Exception(
TR_ADO(e.Description()));
134 return ADOX::adWChar;
138 return ADOX::adInteger;
142 return ADOX::adInteger;
146 return ADOX::adInteger;
155 return ADOX::adDouble;
159 return ADOX::adLongVarWChar;
163 return ADOX::adBoolean;
167 return ADOX::adLongVarBinary;
172 return ADOX::adLongVarBinary;
176 throw te::ado::Exception(
TR_ADO(
"The informed type could not be mapped to ADO type system!"));
185 char* wkb =
new char[size];
189 unsigned int newWkbSize = size+4;
191 char* newWkb =
new char[newWkbSize];
193 memcpy(newWkb, wkb, size);
195 unsigned int srid = geo->
getSRID();
197 memcpy(newWkb+size, &srid, 4);
206 case ADOX::adBoolean:
215 case ADOX::adVarBinary:
216 case ADOX::adLongVarBinary:
220 case ADOX::adVarWChar:
222 case ADOX::adVarChar:
223 case ADOX::adLongVarChar:
224 case ADOX::adLongVarWChar:
239 case ADOX::adDecimal:
243 case ADOX::adInteger:
247 case ADOX::adTinyInt:
248 case ADOX::adSmallInt:
252 case ADOX::adUnsignedBigInt:
256 case ADOX::adUnsignedInt:
260 case ADOX::adUnsignedSmallInt:
261 case ADOX::adUnsignedTinyInt:
268 case ADOX::adDBTimeStamp:
304 case ::adLongVarBinary:
311 case ::adLongVarChar:
312 case ::adLongVarWChar:
340 case ::adUnsignedBigInt:
344 case ::adUnsignedInt:
348 case ::adUnsignedSmallInt:
349 case ::adUnsignedTinyInt:
356 case ::adDBTimeStamp:
382 _bstr_t cName = column->GetName();
384 ADOX::DataTypeEnum cType = column->GetType();
386 long cSize = column->GetDefinedSize();
397 case ::adLongVarChar:
398 case ::adLongVarWChar:
404 case ADOX::adTinyInt:
405 case ADOX::adSmallInt:
409 case ADOX::adInteger:
418 case ADOX::adDecimal:
422 case ::adUnsignedBigInt:
426 case ::adUnsignedInt:
430 case ::adUnsignedSmallInt:
431 case ::adUnsignedTinyInt:
435 case ADOX::adLongVarBinary:
448 case ADOX::adDBTimeStamp:
453 throw te::ado::Exception(
TR_ADO(
"The informed column could not be mapped to TerraLib Data Set Type!"));
461 std::vector<te::dt::Property*> properties;
463 for(
long i = 0; i < columns->GetCount(); i++)
472 if(key->GetType() == ADOX::adKeyPrimary)
479 else if(key->GetType() == ADOX::adKeyForeign)
486 else if(key->GetType() == ADOX::adKeyUnique)
494 throw te::ado::Exception(
TR_ADO(
"Unknown type!"));
503 return Globals::sm_geometryTypeName;
507 return Globals::sm_pointTypeName;
511 return Globals::sm_lineStringTypeName;
515 return Globals::sm_polygonTypeName;
519 return Globals::sm_multiPointTypeName;
523 return Globals::sm_multiLineStringTypeName;
527 return Globals::sm_multiPolygonTypeName;
531 return Globals::sm_curvePolygonTypeName;
535 return Globals::sm_polyhedralSurfaceTypeName;
539 return Globals::sm_geometryZTypeName;
543 return Globals::sm_pointZTypeName;
547 return Globals::sm_lineStringZTypeName;
551 return Globals::sm_polygonZTypeName;
555 return Globals::sm_multiPointZTypeName;
559 return Globals::sm_multiLineStringZTypeName;
563 return Globals::sm_multiPolygonZTypeName;
567 return Globals::sm_curvePolygonZTypeName;
571 return Globals::sm_polyhedralSurfaceZTypeName;
575 return Globals::sm_geometryMTypeName;
579 return Globals::sm_pointMTypeName;
583 return Globals::sm_lineStringMTypeName;
587 return Globals::sm_polygonMTypeName;
591 return Globals::sm_multiPointMTypeName;
595 return Globals::sm_multiLineStringMTypeName;
599 return Globals::sm_multiPolygonMTypeName;
603 return Globals::sm_curvePolygonMTypeName;
607 return Globals::sm_polyhedralSurfaceMTypeName;
611 return Globals::sm_geometryZMTypeName;
615 return Globals::sm_pointZMTypeName;
619 return Globals::sm_lineStringZMTypeName;
623 return Globals::sm_polygonZMTypeName;
627 return Globals::sm_multiPointZMTypeName;
631 return Globals::sm_multiLineStringZMTypeName;
635 return Globals::sm_multiPolygonZMTypeName;
639 return Globals::sm_curvePolygonZMTypeName;
643 return Globals::sm_polyhedralSurfaceZMTypeName;
647 return Globals::sm_geometryTypeName;
654 if(t == Globals::sm_geometryTypeName)
657 else if(t == Globals::sm_pointTypeName)
661 else if(t == Globals::sm_lineStringTypeName)
665 else if(t == Globals::sm_polygonTypeName)
669 else if(t == Globals::sm_multiPointTypeName)
673 else if(t == Globals::sm_multiLineStringTypeName)
677 else if(t == Globals::sm_multiPolygonTypeName)
681 else if(t == Globals::sm_curvePolygonTypeName)
685 else if(t == Globals::sm_polyhedralSurfaceTypeName)
689 else if(t == Globals::sm_geometryZTypeName)
693 else if(t == Globals::sm_pointZTypeName)
697 else if(t == Globals::sm_lineStringZTypeName)
701 else if(t == Globals::sm_polygonZTypeName)
705 else if(t == Globals::sm_multiPointZTypeName)
709 else if(t == Globals::sm_multiLineStringZTypeName)
713 else if(t == Globals::sm_multiPolygonZTypeName)
717 else if(t == Globals::sm_curvePolygonZTypeName)
721 else if(t == Globals::sm_polyhedralSurfaceZTypeName)
725 else if(t == Globals::sm_geometryMTypeName)
729 else if(t == Globals::sm_pointMTypeName)
733 else if(t == Globals::sm_lineStringMTypeName)
737 else if(t == Globals::sm_polygonMTypeName)
741 else if(t == Globals::sm_multiPointMTypeName)
745 else if(t == Globals::sm_multiLineStringMTypeName)
749 else if(t == Globals::sm_multiPolygonMTypeName)
753 else if(t == Globals::sm_curvePolygonMTypeName)
757 else if(t == Globals::sm_polyhedralSurfaceMTypeName)
761 else if(t == Globals::sm_geometryZMTypeName)
765 else if(t == Globals::sm_pointZMTypeName)
769 else if(t == Globals::sm_lineStringZMTypeName)
773 else if(t == Globals::sm_polygonZMTypeName)
777 else if(t == Globals::sm_multiPointZMTypeName)
781 else if(t == Globals::sm_multiLineStringZMTypeName)
785 else if(t == Globals::sm_multiPolygonZMTypeName)
789 else if(t == Globals::sm_curvePolygonZMTypeName)
793 else if(t == Globals::sm_polyhedralSurfaceZMTypeName)
801 int te::ado::GetSRID(_ConnectionPtr adoConn, std::string tableName, std::string geomPropName)
803 _RecordsetPtr recset;
804 TESTHR(recset.CreateInstance(__uuidof(Recordset)));
806 std::string sel =
"SELECT * FROM geometry_columns where f_table_name = '";
807 sel += tableName +
"' and f_geometry_column = '" + geomPropName +
"'";
809 _variant_t variantSel;
810 variantSel.SetString(sel.c_str());
814 TESTHR(recset->Open(variantSel, _variant_t((IDispatch *)adoConn),
815 adOpenStatic, adLockReadOnly, adCmdText));
819 throw Exception(
TR_ADO(e.Description()));
822 return (int32_t)recset->GetFields()->GetItem(
"srid")->GetValue();
827 _RecordsetPtr recset;
828 TESTHR(recset.CreateInstance(__uuidof(Recordset)));
830 std::string sel =
"SELECT * FROM geometry_columns where f_table_name = '";
831 sel += tableName +
"' and f_geometry_column = '" + geomPropName +
"'";
833 _variant_t variantSel;
834 variantSel.SetString(sel.c_str());
838 TESTHR(recset->Open(variantSel, _variant_t((IDispatch *)adoConn),
839 adOpenStatic, adLockReadOnly, adCmdText));
843 throw Exception(
TR_ADO(e.Description()));
846 std::string type = (LPCSTR)(_bstr_t)recset->GetFields()->GetItem(
"type")->GetValue();
853 ADOX::_CatalogPtr pCatalog;
855 TESTHR(pCatalog.CreateInstance(__uuidof(ADOX::Catalog)));
859 pCatalog->PutActiveConnection(variant_t((IDispatch *)adoConn));
861 for(
long i = 0; i < pCatalog->GetTables()->Count; i++)
863 if(std::string(pCatalog->GetTables()->GetItem(i)->GetName()) ==
"geometry_columns")
865 _RecordsetPtr recset;
866 TESTHR(recset.CreateInstance(__uuidof(Recordset)));
868 TESTHR(recset->Open(_bstr_t(
"geometry_columns"),
869 _variant_t((IDispatch*)adoConn,
true), adOpenKeyset, adLockOptimistic, adCmdTable));
871 while(!recset->EndOfFile)
873 if(std::string((_bstr_t)recset->Fields->GetItem(
"f_table_name")->Value) == tableName
874 && std::string((_bstr_t)recset->Fields->GetItem(
"f_geometry_column")->Value) == columnName)
884 throw Exception(
TR_ADO(e.Description()));
892 if( (type >= 1000 && type < 2000) || (type >= 3000 && type < 4000) )
899 std::string key =
"Control Panel\\International";
900 std::string dateFormat =
"sShortDate";
901 std::string timeFormat =
"sTimeFormat";
902 std::string hourFormat =
"iTime";
903 std::string indicatorAM =
"s1159";
904 std::string indicatorPM =
"s2359";
905 std::string dateSeparator =
"sDate";
906 std::string timeSeparator =
"sTime";
908 std::string rdateFormat;
909 std::string rtimeFormat;
910 std::string rhourFormat;
911 std::string rdateSeparator;
912 std::string rtimeSeparator;
915 DWORD DataSize = 1024;
919 if (RegOpenKeyExA(HKEY_CURRENT_USER, key.c_str(), 0, KEY_READ, &hk) == ERROR_SUCCESS)
921 memset (buf, 0, 1024);
924 if (RegQueryValueExA(hk, dateFormat.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
927 memset (buf, 0, 1024);
930 if (RegQueryValueExA(hk, dateSeparator.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
931 rdateSeparator = buf;
933 memset (buf, 0, 1024);
936 if (RegQueryValueExA(hk, timeFormat.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
939 memset (buf, 0, 1024);
942 if (RegQueryValueExA(hk, hourFormat.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
945 memset (buf, 0, 1024);
948 if (RegQueryValueExA(hk, indicatorAM.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
951 memset (buf, 0, 1024);
954 if (RegQueryValueExA(hk, indicatorPM.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
957 memset (buf, 0, 1024);
960 if (RegQueryValueExA(hk, timeSeparator.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
961 rtimeSeparator = buf;
966 sepD = rdateSeparator;
967 sepT = rtimeSeparator;
971 int pos = rdateFormat.find(rdateSeparator);
972 std::string firstD = rdateFormat.substr(0,pos);
973 std::string temp = rdateFormat.substr(pos+1);
975 pos = temp.find(rdateSeparator);
976 std::string secondD = temp.substr(0,pos);
977 std::string thirdD = temp.substr(pos+1);
980 if(firstD.find(
"a")==0)
981 replace(firstD.begin(), firstD.end(), 97, 89);
982 else if(secondD.find(
"a")==0)
983 replace(secondD.begin(), secondD.end(),97, 89);
984 else if(thirdD.find(
"a")==0)
985 replace(thirdD.begin(), thirdD.end(), 97, 89);
989 pos = rtimeFormat.find(rtimeSeparator);
990 std::string firstT = rtimeFormat.substr(0,pos);
991 temp = rtimeFormat.substr(pos+1);
993 pos = temp.find(rtimeSeparator);
994 std::string secondT = temp.substr(0,pos);
995 int posEmpth = temp.find(
" ");
999 thirdT = temp.substr(pos+1);
1001 thirdT = temp.substr(pos+1, (posEmpth-(pos+1)));
1003 int hFormat = atoi(rhourFormat.c_str());
1011 if((firstT.find(
"M")==0))
1012 replace(firstT.begin(), firstT.end(), 77, 109);
1013 else if(secondT.find(
"M")==0)
1014 replace(secondT.begin(), secondT.end(), 77, 109);
1015 else if(thirdT.find(
"M")==0)
1016 replace(thirdT.begin(), thirdT.end(), 77, 109);
1040 else if(tempM==
"FEB")
1042 else if(tempM==
"MAR")
1044 else if(tempM==
"APR")
1046 else if(tempM==
"MAY")
1048 else if(tempM==
"JUN")
1050 else if(tempM==
"JUL")
1052 else if(tempM==
"AUG")
1054 else if(tempM==
"SEP")
1056 else if(tempM==
"OCT")
1058 else if(tempM==
"NOV")
1060 else if(tempM==
"DEC")
1067 std::string& sepD, std::string& sepT)
1076 if(mask ==
"DDsMMsYYYYsHHsmmsSS")
1078 std::vector<std::string> tokGeneral;
1082 if(tokGeneral.size() == 1)
1084 std::vector<std::string> tokDate;
1086 std::vector<std::string> tokTime;
1090 if(tokDate.size() > 1)
1092 day = boost::lexical_cast<
int>(tokDate[0]);
1093 mon = boost::lexical_cast<
int>(tokDate[1]);
1094 year = boost::lexical_cast<
int>(tokDate[2]);
1097 else if(tokTime.size() > 1)
1099 hour = boost::lexical_cast<
int>(tokTime[0]);
1100 min = boost::lexical_cast<
int>(tokTime[1]);
1101 sec = boost::lexical_cast<
int>(tokTime[2]);
1105 else if(tokGeneral.size() == 2)
1107 std::vector<std::string> tokDate;
1109 std::vector<std::string> tokTime;
1112 day = boost::lexical_cast<
int>(tokDate[0]);
1113 mon = boost::lexical_cast<
int>(tokDate[1]);
1114 year = boost::lexical_cast<
int>(tokDate[2]);
1115 hour = boost::lexical_cast<
int>(tokTime[0]);
1116 min = boost::lexical_cast<
int>(tokTime[1]);
1117 sec = boost::lexical_cast<
int>(tokTime[2]);
1120 else if(mask ==
"MsDsYYYYsHsmmsSSsTT")
1122 std::vector<std::string> tokGeneral;
1126 if(tokGeneral.size() == 1)
1128 std::vector<std::string> tokDate;
1130 mon = boost::lexical_cast<
int>(tokDate[0]);
1131 day = boost::lexical_cast<
int>(tokDate[1]);
1132 year = boost::lexical_cast<
int>(tokDate[2]);
1135 else if(tokGeneral.size() == 2)
1137 std::vector<std::string> tokTime;
1139 hour = boost::lexical_cast<
int>(tokTime[0]);
1140 min = boost::lexical_cast<
int>(tokTime[1]);
1141 sec = boost::lexical_cast<
int>(tokTime[2]);
1144 else if(tokGeneral.size() == 3)
1146 std::vector<std::string> tokDate;
1147 std::vector<std::string> tokTime;
1151 mon = boost::lexical_cast<
int>(tokDate[0]);
1152 day = boost::lexical_cast<
int>(tokDate[1]);
1153 year = boost::lexical_cast<
int>(tokDate[2]);
1154 hour = boost::lexical_cast<
int>(tokTime[0]);
1155 min = boost::lexical_cast<
int>(tokTime[1]);
1156 sec = boost::lexical_cast<
int>(tokTime[2]);
1159 else if(mask ==
"YYYYsMMsDDsHHsmmsSS")
1161 std::vector<std::string> tokGeneral;
1165 if(tokGeneral.size() == 1)
1167 std::vector<std::string> tokDate;
1169 std::vector<std::string> tokTime;
1173 if(tokDate.size() > 1)
1175 year = boost::lexical_cast<
int>(tokDate[0]);
1176 mon = boost::lexical_cast<
int>(tokDate[1]);
1177 day = boost::lexical_cast<
int>(tokDate[2]);
1180 else if(tokTime.size() > 1)
1182 hour = boost::lexical_cast<
int>(tokTime[0]);
1183 min = boost::lexical_cast<
int>(tokTime[1]);
1184 sec = boost::lexical_cast<
int>(tokTime[2]);
1188 else if(tokGeneral.size() == 2)
1190 std::vector<std::string> tokDate;
1192 std::vector<std::string> tokTime;
1195 year = boost::lexical_cast<
int>(tokDate[0]);
1196 mon = boost::lexical_cast<
int>(tokDate[1]);
1197 day = boost::lexical_cast<
int>(tokDate[2]);
1198 hour = boost::lexical_cast<
int>(tokTime[0]);
1199 min = boost::lexical_cast<
int>(tokTime[1]);
1200 sec = boost::lexical_cast<
int>(tokTime[2]);
1204 throw Exception((boost::format(
TR_ADO(
"DateTime format not provided or invalid: %1%!")) % mask).str());
1208 if((day > 0 || mon > 0 || year > 0) && (sec > 0 || min > 0 || hour > 0))
1214 else if(day > 0 || mon > 0 || year > 0)
1218 else if(sec > 0 || min > 0 || hour > 0)
1223 return std::auto_ptr<te::dt::DateTime>(0);
1225 return std::auto_ptr<te::dt::DateTime>(result);
1230 std::string result =
"";
1234 std::string mAM, mPM, sepD, sepT;
1240 if(mask.find(
"DDsMMsYYYY") != std::string::npos)
1242 result = boost::lexical_cast<std::string>(dtime->
getDay()) + sepD;
1243 result += boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(dtime->
getMonth()))) + sepD;
1244 result += boost::lexical_cast<std::string>(dtime->
getYear());
1246 else if(mask.find(
"MsDsYYYY") != std::string::npos)
1248 result = boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(dtime->
getMonth()))) + sepD;
1249 result += boost::lexical_cast<std::string>(dtime->
getDay()) + sepD;
1250 result += boost::lexical_cast<std::string>(dtime->
getYear());
1252 else if(mask.find(
"YYYYsMMsDD") != std::string::npos)
1254 result = boost::lexical_cast<std::string>(dtime->
getYear()) + sepD;
1255 result += boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(dtime->
getMonth()))) + sepD;
1256 result += boost::lexical_cast<std::string>(dtime->
getDay());
1264 if(mask.find(
"HHsmmsSS") != std::string::npos)
1266 result = boost::lexical_cast<std::string>(tduration->
getHours()) + sepT;
1267 result += boost::lexical_cast<std::string>(tduration->
getMinutes()) + sepT;
1268 result += boost::lexical_cast<std::string>(tduration->
getSeconds());
1270 else if(mask.find(
"HsmmsSSsTT") != std::string::npos)
1272 result = boost::lexical_cast<std::string>(tduration->
getHours()) + sepT;
1273 result += boost::lexical_cast<std::string>(tduration->
getMinutes()) + sepT;
1274 result += boost::lexical_cast<std::string>(tduration->
getSeconds());
1285 if(mask ==
"DDsMMsYYYYsHHsmmsSS")
1287 result = boost::lexical_cast<std::string>(date.
getDay()) + sepD;
1288 result += boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(date.
getMonth()))) + sepD;
1289 result += boost::lexical_cast<std::string>(date.
getYear()) +
" ";
1290 result += boost::lexical_cast<std::string>(time.
getHours()) + sepT;
1291 result += boost::lexical_cast<std::string>(time.
getMinutes()) + sepT;
1292 result += boost::lexical_cast<std::string>(time.
getSeconds());
1294 else if(mask ==
"MsDsYYYYsHsmmsSSsTT")
1296 result = boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(date.
getMonth()))) + sepD;
1297 result += boost::lexical_cast<std::string>(date.
getDay()) + sepD;
1298 result += boost::lexical_cast<std::string>(date.
getYear()) +
" ";
1299 result += boost::lexical_cast<std::string>(time.
getHours()) + sepT;
1300 result += boost::lexical_cast<std::string>(time.
getMinutes()) + sepT;
1301 result += boost::lexical_cast<std::string>(time.
getSeconds());
1303 else if(mask ==
"YYYYsMMsDDsHHsmmsSS")
1305 result = boost::lexical_cast<std::string>(date.
getYear()) + sepD;
1306 result += boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(date.
getMonth()))) + sepD;
1307 result += boost::lexical_cast<std::string>(date.
getDay()) +
" ";
1308 result += boost::lexical_cast<std::string>(time.
getHours()) + sepT;
1309 result += boost::lexical_cast<std::string>(time.
getMinutes()) + sepT;
1310 result += boost::lexical_cast<std::string>(time.
getSeconds());
int Convert2Terralib(ADOX::DataTypeEnum adoType)
Bind ADOX Type to TerraLib Type.
Utility functions for ADO.
The type for variable-length multidimensional arrays.
int getSRID() const
It returns the Spatial Reference System ID associated to this geometric object.
te::gm::GeomType GetType(_ConnectionPtr adoConn, std::string tableName, std::string geomPropName)
Read the geometry_columns table end return a geometry type.
An atomic property like an integer or double.
std::size_t getWkbSize() const
It returns the size required by a WKB representation for this geometric object.
DataSet class implementation for Microsoft Access driver.
void getWkb(char *wkb, te::common::MachineByteOrder byteOrder) const
It serializes the geometry to a WKB representation into the specified buffer.
bool IsGeomProperty(_ConnectionPtr adoConn, std::string tableName, std::string columnName)
Verifies whether is in the geometry_columns table.
The type for date and time types: date, date period, date duration, time duration, time instant, time period, time instant with time zone or time period with time zone.
boost::gregorian::greg_year getYear() const
It returns the gregorian year.
boost::gregorian::greg_month getMonth() const
It returns the gregorian month - from 1 to 12.
The type for string types: FIXED_STRING, VAR_STRING or STRING.
std::string GetFormattedDateTime(te::dt::DateTime *dateTime)
It gets a formatted DateTime string for ADO.
Date getDate() const
It returns the date associated to time instant.
It describes a primary key (pk) constraint.
std::string Convert2UCase(const std::string &value)
It converts a string to upper case.
ADOX::DataTypeEnum Convert2Ado(int terralib)
Bind TerraLib Type to ADO Type.
It models a foreign key constraint for a DataSetType.
A base class for date data types.
int GetSRID(_ConnectionPtr adoConn, std::string tableName, std::string geomPropName)
Read the geometry_columns table end return a SRID.
Configuration flags for the TerraLib ADO Data Access driver.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
std::string MakeConnectionStr(const std::map< std::string, std::string > &dsInfo)
Create a connection string based on a map.
boost::gregorian::greg_day getDay() const
It returns the gregorian day - from 1 to 31.
It describes a unique key (uk) constraint.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
long getSeconds() const
It returns the seconds of a minute - from 0 to 59.
void Tokenize(const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ")
It tokenizes a given string with a delimiter of your own choice.
void Variant2Blob(const _variant_t var, int size, char *&blob)
Convert a variant to a blob.
std::string GetSystemDateTimeFormat(std::string &indAM, std::string &indPM, std::string &sepD, std::string &sepT)
It gets the system Date and Time format.
te::common::AccessPolicy Convert2Terralib(std::string accessPolicy)
long getMinutes() const
It returns the minutes of a hour - from 0 to 59.
void setProperties(const std::vector< te::dt::Property * > &properties)
It sets the properties that form the unique key.
long getHours() const
It returns the hours of a day - from 0 to 23.
StringType
The subtype of string property.
A class to represent time instant.
It models a property definition.
An static class with global definitions.
void Blob2Variant(const char *blob, int size, _variant_t &var)
Convert a blob to a variant.
int GetMonth(const std::string &month)
It gets the index of a month.
bool IsZProperty(te::gm::GeomType type)
Verifies whether Z property.
Spatial reference system transformation function.
TimeDuration getTime() const
It returns the time duration associated to time instant.
void setProperties(const std::vector< te::dt::Property * > &properties)
It sets the properties that form the primary key.
An exception class for ADO.
const std::string & GetGeometryName(te::gm::GeomType t)
It returns the geometry OGC names.
std::auto_ptr< te::dt::DateTime > GetDateTime(std::string &value, std::string &mask, std::string &sepD, std::string &sepT)
It gets the DateTime TerraLib 5 from string.
A class to represent time duration with nano-second/micro-second resolution.
const te::gm::GeomType GetGeometryType(std::string t)
It returns the geometry type concerning the OGC name.
#define TR_ADO(message)
It marks a string in order to get translated. This is a special mark used in the DataAccess module of...
void setProperties(const std::vector< te::dt::Property * > &properties)
It sets the properties that take part of the foreign key constraint.