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

Method GetThreshMax

Explore/DistancePlotView.cpp:957–980  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

955}
956
957double DistancePlotDlg::GetThreshMax()
958{
959 if (maxdist_choice->GetSelection() == 0) {
960 if (IsArc()) {
961 double r = project->GetMaxDistArc();
962 if (IsMi()) return GenGeomAlgs::EarthRadToMi(r);
963 return GenGeomAlgs::EarthRadToKm(r);
964 }
965 return project->GetMaxDistEuc();
966 } else {
967 // using bbox diagonal
968 double minx, miny, maxx, maxy;
969 project->GetMapExtent(minx, miny, maxx, maxy);
970 double xx = (maxx - minx);
971 double yy = (maxy - miny);
972 double r = sqrt(xx * xx + yy * yy) / 2.0;
973
974 if (IsArc()) {
975 if (IsMi()) return GenGeomAlgs::EarthRadToMi(r);
976 return GenGeomAlgs::EarthRadToKm(r);
977 } else
978 return r;
979 }
980}
981
982
983

Callers

nothing calls this directly

Calls 3

GetMaxDistArcMethod · 0.80
GetMaxDistEucMethod · 0.80
GetMapExtentMethod · 0.80

Tested by

no test coverage detected