MCPcopy Create free account
hub / github.com/GeoDaCenter/geoda / GetKeyColumnData

Method GetKeyColumnData

Explore/MapLayer.cpp:384–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384bool BackgroundMapLayer::GetKeyColumnData(wxString field_name, std::vector<wxString>& data)
385{
386 if (data.empty()) {
387 data.resize(shapes.size());
388 }
389 // this function is for finding IDs of multi-layer
390 if (field_name.IsEmpty() || field_name == "(Use Sequences)") {
391 for (int i=0; i<shapes.size(); i++) {
392 data[i] << i;
393 }
394 return true;
395 }
396 GdaConst::FieldType type = layer_proxy->GetFieldType(field_name);
397 int col_idx = layer_proxy->GetFieldPos(field_name);
398 if (type == GdaConst::long64_type) {
399 for (int i=0; i<shapes.size(); ++i) {
400 data[i] << layer_proxy->data[i]->GetFieldAsInteger64(col_idx);
401 }
402 return true;
403 } else if (type == GdaConst::double_type) {
404 for (int i=0; i<shapes.size(); ++i) {
405 data[i] << layer_proxy->data[i]->GetFieldAsDouble(col_idx);
406 }
407 } else if (type == GdaConst::string_type) {
408 for (int i=0; i<shapes.size(); ++i) {
409 data[i] << layer_proxy->data[i]->GetFieldAsString(col_idx);
410 }
411 }
412 return false;
413}
414
415std::vector<wxString> BackgroundMapLayer::GetIntegerFieldNames()
416{

Callers 1

DrawHighlightMethod · 0.45

Calls 5

GetFieldTypeMethod · 0.80
GetFieldPosMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
IsEmptyMethod · 0.45

Tested by

no test coverage detected