27 #include "../common/Exception.h"
28 #include "../common/Translator.h"
29 #include "../datatype.h"
30 #include "../dataaccess/dataset/DataSetType.h"
31 #include "../dataaccess/dataset/ForeignKey.h"
32 #include "../dataaccess/dataset/CheckConstraint.h"
33 #include "../dataaccess/dataset/Constraint.h"
34 #include "../dataaccess/dataset/PrimaryKey.h"
35 #include "../dataaccess/dataset/UniqueKey.h"
36 #include "../dataaccess/utils/Utils.h"
37 #include "../geometry/GeometryProperty.h"
38 #include "../geometry/Envelope.h"
39 #include "../geometry/Enums.h"
40 #include "../memory/DataSet.h"
41 #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;
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);
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;
187 case ADOX::adInteger:
199 case ADOX::adBoolean:
203 case ADOX::adLongVarBinary:
207 case ADOX::adLongVarWChar:
219 char* wkb =
new char[size];
223 unsigned int newWkbSize = size+4;
225 char* newWkb =
new char[newWkbSize];
227 memcpy(newWkb, wkb, size);
229 unsigned int srid = geo->
getSRID();
231 memcpy(newWkb+size, &srid, 4);
240 case ADOX::adBoolean:
249 case ADOX::adVarBinary:
250 case ADOX::adLongVarBinary:
254 case ADOX::adVarWChar:
256 case ADOX::adVarChar:
257 case ADOX::adLongVarChar:
258 case ADOX::adLongVarWChar:
273 case ADOX::adDecimal:
277 case ADOX::adInteger:
281 case ADOX::adTinyInt:
282 case ADOX::adSmallInt:
286 case ADOX::adUnsignedBigInt:
290 case ADOX::adUnsignedInt:
294 case ADOX::adUnsignedSmallInt:
295 case ADOX::adUnsignedTinyInt:
302 case ADOX::adDBTimeStamp:
338 case ::adLongVarBinary:
345 case ::adLongVarChar:
346 case ::adLongVarWChar:
374 case ::adUnsignedBigInt:
378 case ::adUnsignedInt:
382 case ::adUnsignedSmallInt:
383 case ::adUnsignedTinyInt:
390 case ::adDBTimeStamp:
416 _bstr_t cName = column->GetName();
418 ADOX::DataTypeEnum cType = column->GetType();
420 long cSize = column->GetDefinedSize();
431 case ::adLongVarChar:
432 case ::adLongVarWChar:
438 case ADOX::adTinyInt:
439 case ADOX::adSmallInt:
443 case ADOX::adInteger:
452 case ADOX::adDecimal:
456 case ::adUnsignedBigInt:
460 case ::adUnsignedInt:
464 case ::adUnsignedSmallInt:
465 case ::adUnsignedTinyInt:
469 case ADOX::adLongVarBinary:
482 case ADOX::adDBTimeStamp:
495 std::vector<te::dt::Property*> properties;
497 for(
long i = 0; i < columns->GetCount(); i++)
506 if(key->GetType() == ADOX::adKeyPrimary)
513 else if(key->GetType() == ADOX::adKeyForeign)
520 else if(key->GetType() == ADOX::adKeyUnique)
537 return Globals::sm_geometryTypeName;
541 return Globals::sm_pointTypeName;
545 return Globals::sm_lineStringTypeName;
549 return Globals::sm_polygonTypeName;
553 return Globals::sm_multiPointTypeName;
557 return Globals::sm_multiLineStringTypeName;
561 return Globals::sm_multiPolygonTypeName;
565 return Globals::sm_curvePolygonTypeName;
569 return Globals::sm_polyhedralSurfaceTypeName;
573 return Globals::sm_geometryZTypeName;
577 return Globals::sm_pointZTypeName;
581 return Globals::sm_lineStringZTypeName;
585 return Globals::sm_polygonZTypeName;
589 return Globals::sm_multiPointZTypeName;
593 return Globals::sm_multiLineStringZTypeName;
597 return Globals::sm_multiPolygonZTypeName;
601 return Globals::sm_curvePolygonZTypeName;
605 return Globals::sm_polyhedralSurfaceZTypeName;
609 return Globals::sm_geometryMTypeName;
613 return Globals::sm_pointMTypeName;
617 return Globals::sm_lineStringMTypeName;
621 return Globals::sm_polygonMTypeName;
625 return Globals::sm_multiPointMTypeName;
629 return Globals::sm_multiLineStringMTypeName;
633 return Globals::sm_multiPolygonMTypeName;
637 return Globals::sm_curvePolygonMTypeName;
641 return Globals::sm_polyhedralSurfaceMTypeName;
645 return Globals::sm_geometryZMTypeName;
649 return Globals::sm_pointZMTypeName;
653 return Globals::sm_lineStringZMTypeName;
657 return Globals::sm_polygonZMTypeName;
661 return Globals::sm_multiPointZMTypeName;
665 return Globals::sm_multiLineStringZMTypeName;
669 return Globals::sm_multiPolygonZMTypeName;
673 return Globals::sm_curvePolygonZMTypeName;
677 return Globals::sm_polyhedralSurfaceZMTypeName;
681 return Globals::sm_geometryTypeName;
688 if(t == Globals::sm_geometryTypeName)
691 else if(t == Globals::sm_pointTypeName)
695 else if(t == Globals::sm_lineStringTypeName)
699 else if(t == Globals::sm_polygonTypeName)
703 else if(t == Globals::sm_multiPointTypeName)
707 else if(t == Globals::sm_multiLineStringTypeName)
711 else if(t == Globals::sm_multiPolygonTypeName)
715 else if(t == Globals::sm_curvePolygonTypeName)
719 else if(t == Globals::sm_polyhedralSurfaceTypeName)
723 else if(t == Globals::sm_geometryZTypeName)
727 else if(t == Globals::sm_pointZTypeName)
731 else if(t == Globals::sm_lineStringZTypeName)
735 else if(t == Globals::sm_polygonZTypeName)
739 else if(t == Globals::sm_multiPointZTypeName)
743 else if(t == Globals::sm_multiLineStringZTypeName)
747 else if(t == Globals::sm_multiPolygonZTypeName)
751 else if(t == Globals::sm_curvePolygonZTypeName)
755 else if(t == Globals::sm_polyhedralSurfaceZTypeName)
759 else if(t == Globals::sm_geometryMTypeName)
763 else if(t == Globals::sm_pointMTypeName)
767 else if(t == Globals::sm_lineStringMTypeName)
771 else if(t == Globals::sm_polygonMTypeName)
775 else if(t == Globals::sm_multiPointMTypeName)
779 else if(t == Globals::sm_multiLineStringMTypeName)
783 else if(t == Globals::sm_multiPolygonMTypeName)
787 else if(t == Globals::sm_curvePolygonMTypeName)
791 else if(t == Globals::sm_polyhedralSurfaceMTypeName)
795 else if(t == Globals::sm_geometryZMTypeName)
799 else if(t == Globals::sm_pointZMTypeName)
803 else if(t == Globals::sm_lineStringZMTypeName)
807 else if(t == Globals::sm_polygonZMTypeName)
811 else if(t == Globals::sm_multiPointZMTypeName)
815 else if(t == Globals::sm_multiLineStringZMTypeName)
819 else if(t == Globals::sm_multiPolygonZMTypeName)
823 else if(t == Globals::sm_curvePolygonZMTypeName)
827 else if(t == Globals::sm_polyhedralSurfaceZMTypeName)
835 int te::ado::GetSRID(_ConnectionPtr adoConn, std::string tableName, std::string geomPropName)
837 _RecordsetPtr recset;
838 TESTHR(recset.CreateInstance(__uuidof(Recordset)));
840 std::string sel =
"SELECT * FROM geometry_columns where f_table_name = '";
841 sel += tableName +
"' and f_geometry_column = '" + geomPropName +
"'";
843 _variant_t variantSel;
844 variantSel.SetString(sel.c_str());
848 TESTHR(recset->Open(variantSel, _variant_t((IDispatch *)adoConn),
849 adOpenStatic, adLockReadOnly, adCmdText));
856 return (int32_t)recset->GetFields()->GetItem(
"srid")->GetValue();
861 _RecordsetPtr recset;
862 TESTHR(recset.CreateInstance(__uuidof(Recordset)));
864 std::string sel =
"SELECT * FROM geometry_columns where f_table_name = '";
865 sel += tableName +
"' and f_geometry_column = '" + geomPropName +
"'";
867 _variant_t variantSel;
868 variantSel.SetString(sel.c_str());
872 TESTHR(recset->Open(variantSel, _variant_t((IDispatch *)adoConn),
873 adOpenStatic, adLockReadOnly, adCmdText));
880 std::string type = (LPCSTR)(_bstr_t)recset->GetFields()->GetItem(
"type")->GetValue();
887 ADOX::_CatalogPtr pCatalog;
889 TESTHR(pCatalog.CreateInstance(__uuidof(ADOX::Catalog)));
893 pCatalog->PutActiveConnection(variant_t((IDispatch *)adoConn));
895 for(
long i = 0; i < pCatalog->GetTables()->Count; i++)
897 if(std::string(pCatalog->GetTables()->GetItem(i)->GetName()) ==
"geometry_columns")
899 _RecordsetPtr recset;
900 TESTHR(recset.CreateInstance(__uuidof(Recordset)));
902 TESTHR(recset->Open(_bstr_t(
"geometry_columns"),
903 _variant_t((IDispatch*)adoConn,
true), adOpenKeyset, adLockOptimistic, adCmdTable));
905 while(!recset->EndOfFile)
907 if(std::string((_bstr_t)recset->Fields->GetItem(
"f_table_name")->Value) == tableName
908 && std::string((_bstr_t)recset->Fields->GetItem(
"f_geometry_column")->Value) == columnName)
926 if( (type >= 1000 && type < 2000) || (type >= 3000 && type < 4000) )
933 std::string key =
"Control Panel\\International";
934 std::string dateFormat =
"sShortDate";
935 std::string timeFormat =
"sTimeFormat";
936 std::string hourFormat =
"iTime";
937 std::string indicatorAM =
"s1159";
938 std::string indicatorPM =
"s2359";
939 std::string dateSeparator =
"sDate";
940 std::string timeSeparator =
"sTime";
942 std::string rdateFormat;
943 std::string rtimeFormat;
944 std::string rhourFormat;
945 std::string rdateSeparator;
946 std::string rtimeSeparator;
949 DWORD DataSize = 1024;
953 if (RegOpenKeyExA(HKEY_CURRENT_USER, key.c_str(), 0, KEY_READ, &hk) == ERROR_SUCCESS)
955 memset (buf, 0, 1024);
958 if (RegQueryValueExA(hk, dateFormat.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
961 memset (buf, 0, 1024);
964 if (RegQueryValueExA(hk, dateSeparator.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
965 rdateSeparator = buf;
967 memset (buf, 0, 1024);
970 if (RegQueryValueExA(hk, timeFormat.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
973 memset (buf, 0, 1024);
976 if (RegQueryValueExA(hk, hourFormat.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
979 memset (buf, 0, 1024);
982 if (RegQueryValueExA(hk, indicatorAM.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
985 memset (buf, 0, 1024);
988 if (RegQueryValueExA(hk, indicatorPM.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
991 memset (buf, 0, 1024);
994 if (RegQueryValueExA(hk, timeSeparator.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
995 rtimeSeparator = buf;
1000 sepD = rdateSeparator;
1001 sepT = rtimeSeparator;
1005 int pos = rdateFormat.find(rdateSeparator);
1006 std::string firstD = rdateFormat.substr(0,pos);
1007 std::string temp = rdateFormat.substr(pos+1);
1009 pos = temp.find(rdateSeparator);
1010 std::string secondD = temp.substr(0,pos);
1011 std::string thirdD = temp.substr(pos+1);
1014 if(firstD.find(
"a")==0)
1015 replace(firstD.begin(), firstD.end(), 97, 89);
1016 else if(secondD.find(
"a")==0)
1017 replace(secondD.begin(), secondD.end(),97, 89);
1018 else if(thirdD.find(
"a")==0)
1019 replace(thirdD.begin(), thirdD.end(), 97, 89);
1023 pos = rtimeFormat.find(rtimeSeparator);
1024 std::string firstT = rtimeFormat.substr(0,pos);
1025 temp = rtimeFormat.substr(pos+1);
1027 pos = temp.find(rtimeSeparator);
1028 std::string secondT = temp.substr(0,pos);
1029 int posEmpth = temp.find(
" ");
1033 thirdT = temp.substr(pos+1);
1035 thirdT = temp.substr(pos+1, (posEmpth-(pos+1)));
1037 int hFormat = atoi(rhourFormat.c_str());
1045 if((firstT.find(
"M")==0))
1046 replace(firstT.begin(), firstT.end(), 77, 109);
1047 else if(secondT.find(
"M")==0)
1048 replace(secondT.begin(), secondT.end(), 77, 109);
1049 else if(thirdT.find(
"M")==0)
1050 replace(thirdT.begin(), thirdT.end(), 77, 109);
1074 else if(tempM==
"FEB")
1076 else if(tempM==
"MAR")
1078 else if(tempM==
"APR")
1080 else if(tempM==
"MAY")
1082 else if(tempM==
"JUN")
1084 else if(tempM==
"JUL")
1086 else if(tempM==
"AUG")
1088 else if(tempM==
"SEP")
1090 else if(tempM==
"OCT")
1092 else if(tempM==
"NOV")
1094 else if(tempM==
"DEC")
1101 std::string& sepD, std::string& sepT)
1110 if(mask ==
"DDsMMsYYYYsHHsmmsSS")
1112 std::vector<std::string> tokGeneral;
1116 if(tokGeneral.size() == 1)
1118 std::vector<std::string> tokDate;
1120 std::vector<std::string> tokTime;
1124 if(tokDate.size() > 1)
1126 day = boost::lexical_cast<
int>(tokDate[0]);
1127 mon = boost::lexical_cast<
int>(tokDate[1]);
1128 year = boost::lexical_cast<
int>(tokDate[2]);
1131 else if(tokTime.size() > 1)
1133 hour = boost::lexical_cast<
int>(tokTime[0]);
1134 min = boost::lexical_cast<
int>(tokTime[1]);
1135 sec = boost::lexical_cast<
int>(tokTime[2]);
1139 else if(tokGeneral.size() == 2)
1141 std::vector<std::string> tokDate;
1143 std::vector<std::string> tokTime;
1146 day = boost::lexical_cast<
int>(tokDate[0]);
1147 mon = boost::lexical_cast<
int>(tokDate[1]);
1148 year = boost::lexical_cast<
int>(tokDate[2]);
1149 hour = boost::lexical_cast<
int>(tokTime[0]);
1150 min = boost::lexical_cast<
int>(tokTime[1]);
1151 sec = boost::lexical_cast<
int>(tokTime[2]);
1154 else if(mask ==
"MsDsYYYYsHsmmsSSsTT")
1156 std::vector<std::string> tokGeneral;
1160 if(tokGeneral.size() == 1)
1162 std::vector<std::string> tokDate;
1164 mon = boost::lexical_cast<
int>(tokDate[0]);
1165 day = boost::lexical_cast<
int>(tokDate[1]);
1166 year = boost::lexical_cast<
int>(tokDate[2]);
1169 else if(tokGeneral.size() == 2)
1171 std::vector<std::string> tokTime;
1173 hour = boost::lexical_cast<
int>(tokTime[0]);
1174 min = boost::lexical_cast<
int>(tokTime[1]);
1175 sec = boost::lexical_cast<
int>(tokTime[2]);
1178 else if(tokGeneral.size() == 3)
1180 std::vector<std::string> tokDate;
1181 std::vector<std::string> tokTime;
1185 mon = boost::lexical_cast<
int>(tokDate[0]);
1186 day = boost::lexical_cast<
int>(tokDate[1]);
1187 year = boost::lexical_cast<
int>(tokDate[2]);
1188 hour = boost::lexical_cast<
int>(tokTime[0]);
1189 min = boost::lexical_cast<
int>(tokTime[1]);
1190 sec = boost::lexical_cast<
int>(tokTime[2]);
1193 else if(mask ==
"YYYYsMMsDDsHHsmmsSS")
1195 std::vector<std::string> tokGeneral;
1199 if(tokGeneral.size() == 1)
1201 std::vector<std::string> tokDate;
1203 std::vector<std::string> tokTime;
1207 if(tokDate.size() > 1)
1209 year = boost::lexical_cast<
int>(tokDate[0]);
1210 mon = boost::lexical_cast<
int>(tokDate[1]);
1211 day = boost::lexical_cast<
int>(tokDate[2]);
1214 else if(tokTime.size() > 1)
1216 hour = boost::lexical_cast<
int>(tokTime[0]);
1217 min = boost::lexical_cast<
int>(tokTime[1]);
1218 sec = boost::lexical_cast<
int>(tokTime[2]);
1222 else if(tokGeneral.size() == 2)
1224 std::vector<std::string> tokDate;
1226 std::vector<std::string> tokTime;
1229 year = boost::lexical_cast<
int>(tokDate[0]);
1230 mon = boost::lexical_cast<
int>(tokDate[1]);
1231 day = boost::lexical_cast<
int>(tokDate[2]);
1232 hour = boost::lexical_cast<
int>(tokTime[0]);
1233 min = boost::lexical_cast<
int>(tokTime[1]);
1234 sec = boost::lexical_cast<
int>(tokTime[2]);
1242 if((day > 0 || mon > 0 || year > 0) && (sec > 0 || min > 0 || hour > 0))
1248 else if(day > 0 || mon > 0 || year > 0)
1252 else if(sec > 0 || min > 0 || hour > 0)
1257 return std::auto_ptr<te::dt::DateTime>(0);
1259 return std::auto_ptr<te::dt::DateTime>(result);
1264 std::string result =
"";
1268 std::string mAM, mPM, sepD, sepT;
1274 if(mask.find(
"DDsMMsYYYY") != std::string::npos)
1276 result = boost::lexical_cast<std::string>(dtime->
getDay()) + sepD;
1277 result += boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(dtime->
getMonth()))) + sepD;
1278 result += boost::lexical_cast<std::string>(dtime->
getYear());
1280 else if(mask.find(
"MsDsYYYY") != std::string::npos)
1282 result = boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(dtime->
getMonth()))) + sepD;
1283 result += boost::lexical_cast<std::string>(dtime->
getDay()) + sepD;
1284 result += boost::lexical_cast<std::string>(dtime->
getYear());
1286 else if(mask.find(
"YYYYsMMsDD") != std::string::npos)
1288 result = boost::lexical_cast<std::string>(dtime->
getYear()) + sepD;
1289 result += boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(dtime->
getMonth()))) + sepD;
1290 result += boost::lexical_cast<std::string>(dtime->
getDay());
1298 if(mask.find(
"HHsmmsSS") != std::string::npos)
1300 result = boost::lexical_cast<std::string>(tduration->
getHours()) + sepT;
1301 result += boost::lexical_cast<std::string>(tduration->
getMinutes()) + sepT;
1302 result += boost::lexical_cast<std::string>(tduration->
getSeconds());
1304 else if(mask.find(
"HsmmsSSsTT") != std::string::npos)
1306 result = boost::lexical_cast<std::string>(tduration->
getHours()) + sepT;
1307 result += boost::lexical_cast<std::string>(tduration->
getMinutes()) + sepT;
1308 result += boost::lexical_cast<std::string>(tduration->
getSeconds());
1319 if(mask ==
"DDsMMsYYYYsHHsmmsSS")
1321 result = boost::lexical_cast<std::string>(date.
getDay()) + sepD;
1322 result += boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(date.
getMonth()))) + sepD;
1323 result += boost::lexical_cast<std::string>(date.
getYear()) +
" ";
1324 result += boost::lexical_cast<std::string>(time.
getHours()) + sepT;
1325 result += boost::lexical_cast<std::string>(time.
getMinutes()) + sepT;
1326 result += boost::lexical_cast<std::string>(time.
getSeconds());
1328 else if(mask ==
"MsDsYYYYsHsmmsSSsTT")
1330 result = boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(date.
getMonth()))) + sepD;
1331 result += boost::lexical_cast<std::string>(date.
getDay()) + sepD;
1332 result += boost::lexical_cast<std::string>(date.
getYear()) +
" ";
1333 result += boost::lexical_cast<std::string>(time.
getHours()) + sepT;
1334 result += boost::lexical_cast<std::string>(time.
getMinutes()) + sepT;
1335 result += boost::lexical_cast<std::string>(time.
getSeconds());
1337 else if(mask ==
"YYYYsMMsDDsHHsmmsSS")
1339 result = boost::lexical_cast<std::string>(date.
getYear()) + sepD;
1340 result += boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(date.
getMonth()))) + sepD;
1341 result += boost::lexical_cast<std::string>(date.
getDay()) +
" ";
1342 result += boost::lexical_cast<std::string>(time.
getHours()) + sepT;
1343 result += boost::lexical_cast<std::string>(time.
getMinutes()) + sepT;
1344 result += boost::lexical_cast<std::string>(time.
getSeconds());
1354 int hh = boostTime.utc_time().time_of_day().hours();
1355 int mm = boostTime.utc_time().time_of_day().minutes();
1356 int ss = boostTime.utc_time().time_of_day().seconds();
1358 if(mask.find(
"HHsmmsSS") != std::string::npos)
1360 result = boost::lexical_cast<std::string>(hh) + sepT;
1361 result += boost::lexical_cast<std::string>(mm) + sepT;
1362 result += boost::lexical_cast<std::string>(ss);
1364 else if(mask.find(
"HsmmsSSsTT") != std::string::npos)
1366 result = boost::lexical_cast<std::string>(hh) + sepT;
1367 result += boost::lexical_cast<std::string>(mm) + sepT;
1368 result += boost::lexical_cast<std::string>(ss);
StringType
The subtype of string property.
int getSRID() const
It returns the Spatial Reference System ID associated to this geometric object.
int GetMonth(const std::string &month)
It gets the index of a month.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
DataSet class implementation for Microsoft Access driver.
int GetSRID(_ConnectionPtr adoConn, std::string tableName, std::string geomPropName)
Read the geometry_columns table end return a SRID.
An atomic property like an integer or double.
const std::string & GetGeometryName(te::gm::GeomType t)
It returns the geometry OGC names.
void setProperties(const std::vector< te::dt::Property * > &properties)
It sets the properties that form the unique key.
te::gm::GeomType GetType(_ConnectionPtr adoConn, std::string tableName, std::string geomPropName)
Read the geometry_columns table end return a geometry type.
void getWkb(char *wkb, te::common::MachineByteOrder byteOrder) const
It serializes the geometry to a WKB representation into the specified buffer.
int Convert2Terralib(ADOX::DataTypeEnum adoType)
Bind ADOX Type to TerraLib Type.
long getSeconds() const
It returns the seconds of a minute - from 0 to 59.
Spatial reference system transformation function.
void Blob2Variant(const char *blob, int size, _variant_t &var)
Convert a blob to a variant.
boost::gregorian::greg_year getYear() const
It returns the gregorian year.
Configuration flags for the TerraLib ADO Data Access driver.
std::string Convert2UCase(const std::string &value)
It converts a string to upper case.
boost::gregorian::greg_day getDay() const
It returns the gregorian day - from 1 to 31.
std::string GetSystemDateTimeFormat(std::string &indAM, std::string &indPM, std::string &sepD, std::string &sepT)
It gets the system Date and Time format.
std::string MakeConnectionStr(const std::map< std::string, std::string > &dsInfo)
Create a connection string based on a map.
#define TE_TR(message)
It marks a string in order to get translated.
std::string GetFormattedDateTime(te::dt::DateTime *dateTime)
It gets a formatted DateTime string for ADO.
std::size_t getWkbSize() const
It returns the size required by a WKB representation for this geometric object.
It models a property definition.
A class to represent time instant.
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.
std::string GetAdoStringType(const int &terralib)
Bind TerraLib type to an ADO valid fiel type name.
Date getDate() const
It returns the date associated to time instant.
A base class for date data types.
void setProperties(const std::vector< te::dt::Property * > &properties)
It sets the properties that form the primary key.
It models a foreign key constraint for a DataSetType.
const boost::local_time::local_date_time & getTimeInstantTZ() const
It returns the boost time instant with time zone type.
The type for string types: FIXED_STRING, VAR_STRING or STRING.
It describes a unique key (uk) constraint.
te::common::AccessPolicy Convert2Terralib(std::string accessPolicy)
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
void setProperties(const std::vector< te::dt::Property * > &properties)
It sets the properties that take part of the foreign key constraint.
const te::gm::GeomType GetGeometryType(std::string t)
It returns the geometry type concerning the OGC name.
The type for variable-length multidimensional arrays.
Utility functions for ADO.
A class to represent time duration with nano-second/micro-second resolution.
It describes a primary key (pk) constraint.
ADOX::DataTypeEnum Convert2Ado(int terralib)
Bind TerraLib Type to ADO Type.
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.
TimeDuration getTime() const
It returns the time duration associated to time instant.
bool IsZProperty(te::gm::GeomType type)
Verifies whether Z property.
bool IsGeomProperty(_ConnectionPtr adoConn, std::string tableName, std::string columnName)
Verifies whether is in the geometry_columns table.
long getMinutes() const
It returns the minutes of a hour - from 0 to 59.
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 instant with time zone.
boost::gregorian::greg_month getMonth() const
It returns the gregorian month - from 1 to 12.
An static class with global definitions.
void Variant2Blob(const _variant_t var, int size, char *&blob)
Convert a variant to a blob.
long getHours() const
It returns the hours of a day - from 0 to 23.