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

Method CheckSpatialProjection

Project.cpp:501–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

499}
500
501bool Project::CheckSpatialProjection(bool& check_again, bool is_arc)
502{
503 // Check if latitude and longitude are used in spatial reference
504 bool cont_proceed = false;
505 if (sourceSR == NULL) {
506 wxString msg = _("Warning: unknown projection information, distance may be incorrect.\n\nProceed anyway?");
507 CheckSpatialRefDialog dlg(NULL, msg);
508 check_again = dlg.IsCheckAgain();
509 if (dlg.ShowModal() == wxID_OK) {
510 cont_proceed = true;
511 check_again = dlg.IsCheckAgain();
512 }
513 } else {
514 bool is_euclidean = !is_arc;
515 if (is_euclidean && project_unit.CmpNoCase("degree") == 0) {
516 wxString msg = _("Warning: coordinates are not projected, distance will be incorrect.\n\nProceed anyway?");
517 CheckSpatialRefDialog dlg(NULL, msg);
518 if (dlg.ShowModal() == wxID_OK) {
519 cont_proceed = true;
520 check_again = dlg.IsCheckAgain();
521 }
522 } else {
523
524 if (is_arc && project_unit.CmpNoCase("degree") != 0) {
525 //if the data are projected and one tries to
526 // create an arc distance, same warning.
527 wxString msg = _("Warning: coordinates are projected, arc distance will be incorrect.\n\nProceed anyway?");
528 CheckSpatialRefDialog dlg(NULL, msg);
529 if (dlg.ShowModal() == wxID_OK) {
530 cont_proceed = true;
531 check_again = dlg.IsCheckAgain();
532 }
533 } else {
534 // GOOD!
535 cont_proceed = true;
536 check_again = false; // no need to check again
537 }
538 }
539 }
540 // return if user wants to continue proceeding
541 return cont_proceed;
542}
543
544void Project::SaveOGRDataSource()
545{

Callers 11

CheckAllInputsMethod · 0.80
OnOKMethod · 0.80
CheckAllInputsMethod · 0.80
OnAutoWeightCentroidsMethod · 0.80
CheckAllInputsMethod · 0.80
CheckAllInputsMethod · 0.80
CheckAllInputsMethod · 0.80
CreateWeightsMethod · 0.80
OnOKMethod · 0.80
CheckAllInputsMethod · 0.80
SetBandwidthMethod · 0.80

Calls 1

IsCheckAgainMethod · 0.80

Tested by 1

CheckAllInputsMethod · 0.64