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 );
61 SAFEARRAYBOUND rgsabound[1];
62 rgsabound[0].lLbound = 0;
63 rgsabound[0].cElements = size;
65 psa = SafeArrayCreate(VT_I1, 1, rgsabound);
67 if(SafeArrayAccessData(psa,(
void **)&pByte) == NOERROR)
68 memcpy(pByte, blob, size);
69 SafeArrayUnaccessData(psa);
71 var.vt = VT_ARRAY | VT_UI1;
77 std::map<std::string, std::string>::const_iterator it = dsInfo.find(
"PROVIDER");
78 std::map<std::string, std::string>::const_iterator it_end = dsInfo.end();
82 connInfo +=
"Provider=" + it->second;
84 it = dsInfo.find(
"DB_NAME");
87 connInfo +=
";Data Source=" + it->second;
89 it = dsInfo.find(
"USER_NAME");
92 connInfo +=
";User Id=" + it->second;
94 it = dsInfo.find(
"PASSWORD");
97 connInfo +=
";Jet OLEDB:Database Password=" + it->second +
";";
107 if(var.vt == (VT_ARRAY | VT_UI1))
109 SafeArrayAccessData(var.parray,(
void **)&cdata);
110 blob =
new char[size];
111 memcpy(blob, cdata, size);
112 SafeArrayUnaccessData(var.parray);
127 return ADOX::adWChar;
131 return ADOX::adInteger;
135 return ADOX::adInteger;
139 return ADOX::adInteger;
148 return ADOX::adDouble;
152 return ADOX::adLongVarWChar;
156 return ADOX::adBoolean;
160 return ADOX::adLongVarBinary;
165 return ADOX::adLongVarBinary;
180 case ADOX::adInteger:
192 case ADOX::adBoolean:
196 case ADOX::adLongVarBinary:
200 case ADOX::adLongVarWChar:
212 char* wkb =
new char[size];
216 unsigned int newWkbSize = size+4;
218 char* newWkb =
new char[newWkbSize];
220 memcpy(newWkb, wkb, size);
222 unsigned int srid = geo->
getSRID();
224 memcpy(newWkb+size, &srid, 4);
233 case ADOX::adBoolean:
242 case ADOX::adVarBinary:
243 case ADOX::adLongVarBinary:
247 case ADOX::adVarWChar:
249 case ADOX::adVarChar:
250 case ADOX::adLongVarChar:
251 case ADOX::adLongVarWChar:
266 case ADOX::adDecimal:
270 case ADOX::adInteger:
274 case ADOX::adTinyInt:
275 case ADOX::adSmallInt:
279 case ADOX::adUnsignedBigInt:
283 case ADOX::adUnsignedInt:
287 case ADOX::adUnsignedSmallInt:
288 case ADOX::adUnsignedTinyInt:
295 case ADOX::adDBTimeStamp:
331 case ::adLongVarBinary:
338 case ::adLongVarChar:
339 case ::adLongVarWChar:
367 case ::adUnsignedBigInt:
371 case ::adUnsignedInt:
375 case ::adUnsignedSmallInt:
376 case ::adUnsignedTinyInt:
383 case ::adDBTimeStamp:
409 _bstr_t cName = column->GetName();
411 ADOX::DataTypeEnum cType = column->GetType();
413 long cSize = column->GetDefinedSize();
424 case ::adLongVarChar:
425 case ::adLongVarWChar:
431 case ADOX::adTinyInt:
432 case ADOX::adSmallInt:
436 case ADOX::adInteger:
445 case ADOX::adDecimal:
449 case ::adUnsignedBigInt:
453 case ::adUnsignedInt:
457 case ::adUnsignedSmallInt:
458 case ::adUnsignedTinyInt:
462 case ADOX::adLongVarBinary:
475 case ADOX::adDBTimeStamp:
488 std::vector<te::dt::Property*> properties;
490 for(
long i = 0; i < columns->GetCount(); i++)
499 if(key->GetType() == ADOX::adKeyPrimary)
506 else if(key->GetType() == ADOX::adKeyForeign)
513 else if(key->GetType() == ADOX::adKeyUnique)
530 return Globals::sm_geometryTypeName;
534 return Globals::sm_pointTypeName;
538 return Globals::sm_lineStringTypeName;
542 return Globals::sm_polygonTypeName;
546 return Globals::sm_multiPointTypeName;
550 return Globals::sm_multiLineStringTypeName;
554 return Globals::sm_multiPolygonTypeName;
558 return Globals::sm_curvePolygonTypeName;
562 return Globals::sm_polyhedralSurfaceTypeName;
566 return Globals::sm_geometryZTypeName;
570 return Globals::sm_pointZTypeName;
574 return Globals::sm_lineStringZTypeName;
578 return Globals::sm_polygonZTypeName;
582 return Globals::sm_multiPointZTypeName;
586 return Globals::sm_multiLineStringZTypeName;
590 return Globals::sm_multiPolygonZTypeName;
594 return Globals::sm_curvePolygonZTypeName;
598 return Globals::sm_polyhedralSurfaceZTypeName;
602 return Globals::sm_geometryMTypeName;
606 return Globals::sm_pointMTypeName;
610 return Globals::sm_lineStringMTypeName;
614 return Globals::sm_polygonMTypeName;
618 return Globals::sm_multiPointMTypeName;
622 return Globals::sm_multiLineStringMTypeName;
626 return Globals::sm_multiPolygonMTypeName;
630 return Globals::sm_curvePolygonMTypeName;
634 return Globals::sm_polyhedralSurfaceMTypeName;
638 return Globals::sm_geometryZMTypeName;
642 return Globals::sm_pointZMTypeName;
646 return Globals::sm_lineStringZMTypeName;
650 return Globals::sm_polygonZMTypeName;
654 return Globals::sm_multiPointZMTypeName;
658 return Globals::sm_multiLineStringZMTypeName;
662 return Globals::sm_multiPolygonZMTypeName;
666 return Globals::sm_curvePolygonZMTypeName;
670 return Globals::sm_polyhedralSurfaceZMTypeName;
674 return Globals::sm_geometryTypeName;
681 if(t == Globals::sm_geometryTypeName)
684 else if(t == Globals::sm_pointTypeName)
688 else if(t == Globals::sm_lineStringTypeName)
692 else if(t == Globals::sm_polygonTypeName)
696 else if(t == Globals::sm_multiPointTypeName)
700 else if(t == Globals::sm_multiLineStringTypeName)
704 else if(t == Globals::sm_multiPolygonTypeName)
708 else if(t == Globals::sm_curvePolygonTypeName)
712 else if(t == Globals::sm_polyhedralSurfaceTypeName)
716 else if(t == Globals::sm_geometryZTypeName)
720 else if(t == Globals::sm_pointZTypeName)
724 else if(t == Globals::sm_lineStringZTypeName)
728 else if(t == Globals::sm_polygonZTypeName)
732 else if(t == Globals::sm_multiPointZTypeName)
736 else if(t == Globals::sm_multiLineStringZTypeName)
740 else if(t == Globals::sm_multiPolygonZTypeName)
744 else if(t == Globals::sm_curvePolygonZTypeName)
748 else if(t == Globals::sm_polyhedralSurfaceZTypeName)
752 else if(t == Globals::sm_geometryMTypeName)
756 else if(t == Globals::sm_pointMTypeName)
760 else if(t == Globals::sm_lineStringMTypeName)
764 else if(t == Globals::sm_polygonMTypeName)
768 else if(t == Globals::sm_multiPointMTypeName)
772 else if(t == Globals::sm_multiLineStringMTypeName)
776 else if(t == Globals::sm_multiPolygonMTypeName)
780 else if(t == Globals::sm_curvePolygonMTypeName)
784 else if(t == Globals::sm_polyhedralSurfaceMTypeName)
788 else if(t == Globals::sm_geometryZMTypeName)
792 else if(t == Globals::sm_pointZMTypeName)
796 else if(t == Globals::sm_lineStringZMTypeName)
800 else if(t == Globals::sm_polygonZMTypeName)
804 else if(t == Globals::sm_multiPointZMTypeName)
808 else if(t == Globals::sm_multiLineStringZMTypeName)
812 else if(t == Globals::sm_multiPolygonZMTypeName)
816 else if(t == Globals::sm_curvePolygonZMTypeName)
820 else if(t == Globals::sm_polyhedralSurfaceZMTypeName)
828 int te::ado::GetSRID(_ConnectionPtr adoConn, std::string tableName, std::string geomPropName)
830 _RecordsetPtr recset;
831 TESTHR(recset.CreateInstance(__uuidof(Recordset)));
833 std::string sel =
"SELECT * FROM geometry_columns where f_table_name = '";
834 sel += tableName +
"' and f_geometry_column = '" + geomPropName +
"'";
836 _variant_t variantSel;
837 variantSel.SetString(sel.c_str());
841 TESTHR(recset->Open(variantSel, _variant_t((IDispatch *)adoConn),
842 adOpenStatic, adLockReadOnly, adCmdText));
849 return (int32_t)recset->GetFields()->GetItem(
"srid")->GetValue();
854 _RecordsetPtr recset;
855 TESTHR(recset.CreateInstance(__uuidof(Recordset)));
857 std::string sel =
"SELECT * FROM geometry_columns where f_table_name = '";
858 sel += tableName +
"' and f_geometry_column = '" + geomPropName +
"'";
860 _variant_t variantSel;
861 variantSel.SetString(sel.c_str());
865 TESTHR(recset->Open(variantSel, _variant_t((IDispatch *)adoConn),
866 adOpenStatic, adLockReadOnly, adCmdText));
873 std::string type = (LPCSTR)(_bstr_t)recset->GetFields()->GetItem(
"type")->GetValue();
880 ADOX::_CatalogPtr pCatalog;
882 TESTHR(pCatalog.CreateInstance(__uuidof(ADOX::Catalog)));
886 pCatalog->PutActiveConnection(variant_t((IDispatch *)adoConn));
888 for(
long i = 0; i < pCatalog->GetTables()->Count; i++)
890 if(std::string(pCatalog->GetTables()->GetItem(i)->GetName()) ==
"geometry_columns")
892 _RecordsetPtr recset;
893 TESTHR(recset.CreateInstance(__uuidof(Recordset)));
895 TESTHR(recset->Open(_bstr_t(
"geometry_columns"),
896 _variant_t((IDispatch*)adoConn,
true), adOpenKeyset, adLockOptimistic, adCmdTable));
898 while(!recset->EndOfFile)
900 if(std::string((_bstr_t)recset->Fields->GetItem(
"f_table_name")->Value) == tableName
901 && std::string((_bstr_t)recset->Fields->GetItem(
"f_geometry_column")->Value) == columnName)
919 if( (type >= 1000 && type < 2000) || (type >= 3000 && type < 4000) )
926 std::string key =
"Control Panel\\International";
927 std::string dateFormat =
"sShortDate";
928 std::string timeFormat =
"sTimeFormat";
929 std::string hourFormat =
"iTime";
930 std::string indicatorAM =
"s1159";
931 std::string indicatorPM =
"s2359";
932 std::string dateSeparator =
"sDate";
933 std::string timeSeparator =
"sTime";
935 std::string rdateFormat;
936 std::string rtimeFormat;
937 std::string rhourFormat;
938 std::string rdateSeparator;
939 std::string rtimeSeparator;
942 DWORD DataSize = 1024;
946 if (RegOpenKeyExA(HKEY_CURRENT_USER, key.c_str(), 0, KEY_READ, &hk) == ERROR_SUCCESS)
948 memset (buf, 0, 1024);
951 if (RegQueryValueExA(hk, dateFormat.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
954 memset (buf, 0, 1024);
957 if (RegQueryValueExA(hk, dateSeparator.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
958 rdateSeparator = buf;
960 memset (buf, 0, 1024);
963 if (RegQueryValueExA(hk, timeFormat.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
966 memset (buf, 0, 1024);
969 if (RegQueryValueExA(hk, hourFormat.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
972 memset (buf, 0, 1024);
975 if (RegQueryValueExA(hk, indicatorAM.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
978 memset (buf, 0, 1024);
981 if (RegQueryValueExA(hk, indicatorPM.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
984 memset (buf, 0, 1024);
987 if (RegQueryValueExA(hk, timeSeparator.c_str(), NULL, &Type, (LPBYTE)buf, &DataSize) == ERROR_SUCCESS)
988 rtimeSeparator = buf;
993 sepD = rdateSeparator;
994 sepT = rtimeSeparator;
998 int pos = (int)rdateFormat.find(rdateSeparator);
999 std::string firstD = rdateFormat.substr(0,pos);
1000 std::string temp = rdateFormat.substr(pos+1);
1002 pos = (int)temp.find(rdateSeparator);
1003 std::string secondD = temp.substr(0,pos);
1004 std::string thirdD = temp.substr(pos+1);
1007 if(firstD.find(
"a")==0)
1008 replace(firstD.begin(), firstD.end(), 97, 89);
1009 else if(secondD.find(
"a")==0)
1010 replace(secondD.begin(), secondD.end(),97, 89);
1011 else if(thirdD.find(
"a")==0)
1012 replace(thirdD.begin(), thirdD.end(), 97, 89);
1016 pos = (int)rtimeFormat.find(rtimeSeparator);
1017 std::string firstT = rtimeFormat.substr(0,pos);
1018 temp = rtimeFormat.substr(pos+1);
1020 pos = (int)temp.find(rtimeSeparator);
1021 std::string secondT = temp.substr(0,pos);
1022 int posEmpth = (int)temp.find(
" ");
1026 thirdT = temp.substr(pos+1);
1028 thirdT = temp.substr(pos+1, (posEmpth-(pos+1)));
1030 int hFormat = atoi(rhourFormat.c_str());
1038 if((firstT.find(
"M")==0))
1039 replace(firstT.begin(), firstT.end(), 77, 109);
1040 else if(secondT.find(
"M")==0)
1041 replace(secondT.begin(), secondT.end(), 77, 109);
1042 else if(thirdT.find(
"M")==0)
1043 replace(thirdT.begin(), thirdT.end(), 77, 109);
1067 else if(tempM==
"FEB")
1069 else if(tempM==
"MAR")
1071 else if(tempM==
"APR")
1073 else if(tempM==
"MAY")
1075 else if(tempM==
"JUN")
1077 else if(tempM==
"JUL")
1079 else if(tempM==
"AUG")
1081 else if(tempM==
"SEP")
1083 else if(tempM==
"OCT")
1085 else if(tempM==
"NOV")
1087 else if(tempM==
"DEC")
1094 std::string& sepD, std::string& sepT)
1103 if(mask ==
"DDsMMsYYYYsHHsmmsSS")
1105 std::vector<std::string> tokGeneral;
1109 if(tokGeneral.size() == 1)
1111 std::vector<std::string> tokDate;
1113 std::vector<std::string> tokTime;
1117 if(tokDate.size() > 1)
1119 day = boost::lexical_cast<
int>(tokDate[0]);
1120 mon = boost::lexical_cast<
int>(tokDate[1]);
1121 year = boost::lexical_cast<
int>(tokDate[2]);
1124 else if(tokTime.size() > 1)
1126 hour = boost::lexical_cast<
int>(tokTime[0]);
1127 min = boost::lexical_cast<
int>(tokTime[1]);
1128 sec = boost::lexical_cast<
int>(tokTime[2]);
1132 else if(tokGeneral.size() == 2)
1134 std::vector<std::string> tokDate;
1136 std::vector<std::string> tokTime;
1139 day = boost::lexical_cast<
int>(tokDate[0]);
1140 mon = boost::lexical_cast<
int>(tokDate[1]);
1141 year = boost::lexical_cast<
int>(tokDate[2]);
1142 hour = boost::lexical_cast<
int>(tokTime[0]);
1143 min = boost::lexical_cast<
int>(tokTime[1]);
1144 sec = boost::lexical_cast<
int>(tokTime[2]);
1147 else if(mask ==
"MsDsYYYYsHsmmsSSsTT")
1149 std::vector<std::string> tokGeneral;
1153 if(tokGeneral.size() == 1)
1155 std::vector<std::string> tokDate;
1157 mon = boost::lexical_cast<
int>(tokDate[0]);
1158 day = boost::lexical_cast<
int>(tokDate[1]);
1159 year = boost::lexical_cast<
int>(tokDate[2]);
1162 else if(tokGeneral.size() == 2)
1164 std::vector<std::string> tokTime;
1166 hour = boost::lexical_cast<
int>(tokTime[0]);
1167 min = boost::lexical_cast<
int>(tokTime[1]);
1168 sec = boost::lexical_cast<
int>(tokTime[2]);
1171 else if(tokGeneral.size() == 3)
1173 std::vector<std::string> tokDate;
1174 std::vector<std::string> tokTime;
1178 mon = boost::lexical_cast<
int>(tokDate[0]);
1179 day = boost::lexical_cast<
int>(tokDate[1]);
1180 year = boost::lexical_cast<
int>(tokDate[2]);
1181 hour = boost::lexical_cast<
int>(tokTime[0]);
1182 min = boost::lexical_cast<
int>(tokTime[1]);
1183 sec = boost::lexical_cast<
int>(tokTime[2]);
1186 else if(mask ==
"YYYYsMMsDDsHHsmmsSS")
1188 std::vector<std::string> tokGeneral;
1192 if(tokGeneral.size() == 1)
1194 std::vector<std::string> tokDate;
1196 std::vector<std::string> tokTime;
1200 if(tokDate.size() > 1)
1202 year = boost::lexical_cast<
int>(tokDate[0]);
1203 mon = boost::lexical_cast<
int>(tokDate[1]);
1204 day = boost::lexical_cast<
int>(tokDate[2]);
1207 else if(tokTime.size() > 1)
1209 hour = boost::lexical_cast<
int>(tokTime[0]);
1210 min = boost::lexical_cast<
int>(tokTime[1]);
1211 sec = boost::lexical_cast<
int>(tokTime[2]);
1215 else if(tokGeneral.size() == 2)
1217 std::vector<std::string> tokDate;
1219 std::vector<std::string> tokTime;
1222 year = boost::lexical_cast<
int>(tokDate[0]);
1223 mon = boost::lexical_cast<
int>(tokDate[1]);
1224 day = boost::lexical_cast<
int>(tokDate[2]);
1225 hour = boost::lexical_cast<
int>(tokTime[0]);
1226 min = boost::lexical_cast<
int>(tokTime[1]);
1227 sec = boost::lexical_cast<
int>(tokTime[2]);
1235 if((day > 0 || mon > 0 || year > 0) && (sec > 0 || min > 0 || hour > 0))
1237 te::dt::Date d((
unsigned short)year, (
unsigned short)mon, (
unsigned short)day);
1241 else if(day > 0 || mon > 0 || year > 0)
1243 result =
new te::dt::Date((
unsigned short)year, (
unsigned short)mon, (
unsigned short)day);
1245 else if(sec > 0 || min > 0 || hour > 0)
1250 return std::auto_ptr<te::dt::DateTime>(0);
1252 return std::auto_ptr<te::dt::DateTime>(result);
1257 std::string result =
"";
1261 std::string mAM, mPM, sepD, sepT;
1267 if(mask.find(
"DDsMMsYYYY") != std::string::npos)
1269 result = boost::lexical_cast<std::string>(dtime->
getDay()) + sepD;
1270 result += boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(dtime->
getMonth()))) + sepD;
1271 result += boost::lexical_cast<std::string>(dtime->
getYear());
1273 else if(mask.find(
"MsDsYYYY") != std::string::npos)
1275 result = boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(dtime->
getMonth()))) + sepD;
1276 result += boost::lexical_cast<std::string>(dtime->
getDay()) + sepD;
1277 result += boost::lexical_cast<std::string>(dtime->
getYear());
1279 else if(mask.find(
"YYYYsMMsDD") != std::string::npos)
1281 result = boost::lexical_cast<std::string>(dtime->
getYear()) + sepD;
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());
1291 if(mask.find(
"HHsmmsSS") != std::string::npos)
1293 result = boost::lexical_cast<std::string>(tduration->
getHours()) + sepT;
1294 result += boost::lexical_cast<std::string>(tduration->
getMinutes()) + sepT;
1295 result += boost::lexical_cast<std::string>(tduration->
getSeconds());
1297 else if(mask.find(
"HsmmsSSsTT") != std::string::npos)
1299 result = boost::lexical_cast<std::string>(tduration->
getHours()) + sepT;
1300 result += boost::lexical_cast<std::string>(tduration->
getMinutes()) + sepT;
1301 result += boost::lexical_cast<std::string>(tduration->
getSeconds());
1312 if(mask ==
"DDsMMsYYYYsHHsmmsSS")
1314 result = boost::lexical_cast<std::string>(date.
getDay()) + sepD;
1315 result += boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(date.
getMonth()))) + sepD;
1316 result += boost::lexical_cast<std::string>(date.
getYear()) +
" ";
1317 result += boost::lexical_cast<std::string>(time.
getHours()) + sepT;
1318 result += boost::lexical_cast<std::string>(time.
getMinutes()) + sepT;
1319 result += boost::lexical_cast<std::string>(time.
getSeconds());
1321 else if(mask ==
"MsDsYYYYsHsmmsSSsTT")
1323 result = boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(date.
getMonth()))) + sepD;
1324 result += boost::lexical_cast<std::string>(date.
getDay()) + sepD;
1325 result += boost::lexical_cast<std::string>(date.
getYear()) +
" ";
1326 result += boost::lexical_cast<std::string>(time.
getHours()) + sepT;
1327 result += boost::lexical_cast<std::string>(time.
getMinutes()) + sepT;
1328 result += boost::lexical_cast<std::string>(time.
getSeconds());
1330 else if(mask ==
"YYYYsMMsDDsHHsmmsSS")
1332 result = boost::lexical_cast<std::string>(date.
getYear()) + sepD;
1333 result += boost::lexical_cast<std::string>(
GetMonth(boost::lexical_cast<std::string>(date.
getMonth()))) + sepD;
1334 result += boost::lexical_cast<std::string>(date.
getDay()) +
" ";
1335 result += boost::lexical_cast<std::string>(time.
getHours()) + sepT;
1336 result += boost::lexical_cast<std::string>(time.
getMinutes()) + sepT;
1337 result += boost::lexical_cast<std::string>(time.
getSeconds());
1347 int hh = boostTime.utc_time().time_of_day().hours();
1348 int mm = boostTime.utc_time().time_of_day().minutes();
1349 int ss = boostTime.utc_time().time_of_day().seconds();
1351 if(mask.find(
"HHsmmsSS") != std::string::npos)
1353 result = boost::lexical_cast<std::string>(hh) + sepT;
1354 result += boost::lexical_cast<std::string>(mm) + sepT;
1355 result += boost::lexical_cast<std::string>(ss);
1357 else if(mask.find(
"HsmmsSSsTT") != std::string::npos)
1359 result = boost::lexical_cast<std::string>(hh) + sepT;
1360 result += boost::lexical_cast<std::string>(mm) + sepT;
1361 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.