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

Method GetDoubleColumnData

Explore/MapLayer.cpp:342–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340}
341
342bool BackgroundMapLayer::GetDoubleColumnData(wxString field_name,
343 std::vector<double>& data)
344{
345 if (field_name.empty()) return false;
346
347 if (data.empty()) {
348 data.resize(shapes.size());
349 }
350 // this function is for finding numeric data from multi-layer
351 GdaConst::FieldType type = layer_proxy->GetFieldType(field_name);
352 int col_idx = layer_proxy->GetFieldPos(field_name);
353 if (type == GdaConst::double_type ||
354 type == GdaConst::long64_type) {
355 for (int i=0; i<shapes.size(); ++i) {
356 data[i] = layer_proxy->data[i]->GetFieldAsDouble(col_idx);
357 }
358 return true;
359 }
360 return false;
361}
362
363bool BackgroundMapLayer::GetIntegerColumnData(wxString field_name, std::vector<wxInt64>& data)
364{

Callers 3

CountPointsInPolygonMethod · 0.80
CountLinesInPolygonMethod · 0.80
CountPolygonInPolygonMethod · 0.80

Calls 4

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

Tested by

no test coverage detected