qc_fix_latlong_errors: Fixing sign errors in coordinates

Description Usage Arguments Details Value Sign errors Special countries See Also


qc_fix_latlong_errors makes possible to fix known errors in latitude and longitude coordinates, as exchanged signs.


qc_fix_latlong_errors(data, maps_folder = getwd(), sign_errors = TRUE,
  special_countries = FALSE, parent_logger = "test")



Data frame with data coming from qc_check_coordinates (with latitude, longitude, country and is_inside_country variables).


Folder route where the maps are stored, by default the working directory. It must be a character object and it must end without /.


Logical indicating if sign errors must be checked and fixed. If TRUE (default), qc_coord_sign_test is internally called.


Logical indicating if the special approach to countries having positive and negative coordinates must be used. See Special countries section for details.


This function calls to other internal functions in order to fix different kinds of coordinates errors. At the moment, only exchanged signs in coordinates errors are considered to be fixed.

After the fixes are applied, qc_check_coordinates is called to update is_inside_country variable.


Same data frame provided, with coordinates tested and fixed

Sign errors

If sign_errors = TRUE is specified, qc_coord_sign_test is called to establish possible sign error and, if any, they are fixed. This fix can be done with or without special countries (see next section)

Special countries

There are special countries where border coordinates for longitude, latitude or both have negative and positive values. In this case, the normal approach of qc_coord_sign_test is not appropriate, and several tests involving the internal use of qc_check_coordinates must be made. If special_countries = TRUE is specified, then tests are made trying to dilucidate if only a change in the sign of one, latitude or longitude, is needed or, in the contrary, changing both of them is needed. There is one case that can not be covered by this approach: when changing sign of one of the coordinates AND changing both coordinates seem to fix the issue, as the correct option can not be assured.

See Also

Other Quality Check Functions: qc_check_coordinates, qc_coord_sign_test, qc_download_maps

sapfluxnet/sapfluxnetQC1 documentation built on May 29, 2019, 1:50 p.m.