vignettes/gat_troubleshooting.Rmd
gat_troubleshooting.Rmd
These errors and warnings are related to installation of the Geographic Aggregation Tool (GAT).
On Windows, run
install.packages("https://cran.r-project.org/bin/windows/contrib/4.0/XML_3.99-0.5.zip", type = "binary", repos = NULL)
to install the XML package. 3.99-0.5 is the latest XML version as of
August 2020.
Usually, the issue is that vignettes fail to install. To fix this, try one of these solutions.
devtools::install_github(“ajstamm/gatpkg”, dependencies = TRUE, build_vignettes = TRUE)
This message appears in the R console:
Error in maptools::unionSpatialPolygons(myshps$original, aggvars$Idlist) :
isTRUE(gpclibPermitStatus()) is not TRUE
This error appears due to a conflict between the packages rgeos and rgdal. Reinstall rgdal after each update of rgeos to fix it.
Both rgeos and rgdal have been removed as of v2.0.0, so this should no longer be an issue.
These errors and warnings are related to the user input portion of GAT.
The areas are not excluded, but an incorrect number of areas is displayed. If you rerun GAT and read in the settings from this run using the “settings=” option, the correct value will be shown in the confirmation dialog.
This should be fixed as of v1.61.0.
These errors and warnings may occur while GAT is processing your shapefile.
GAT occasionally has trouble getting permission to write to network drives. Try saving to your local computer, then transferring the files.
This message appears in the R console:
Error in writeOGR(newmapwdata, userpathout, userfileout, driver = “ESRI Shapefile”, :
GDAL Error 4: Failed to open shapefile C:/aggtest/output/testin.shp.
It may be corrupt or read-only file accessed in update mode.
Be sure to enter a valid file name in the save dialog. Remove all files with extensions only (such as “.shp”, “.dbf”, “.prj”) from the directory you are trying to save to.
The progress bars were designed to help you determine whether GAT has stalled. Using population weighted centroids, merging shapefiles with thousands of polygons, and saving KML files can also cause GAT to run slowly, so allow a few minutes for each of these steps. For any steps besides saving files and population weighting, if a progress bar is not updating at least once a minute, it is possible GAT has stalled and you will need to restart R.
Try reducing the number of geographical boundary nodes (by thinning or simplifying polygons: see Thinning geographic boundaries in the GAT technical notes).
This message appears in the R console:
In classInt::classIntervals(newdata, n = breaks, style = “fixed”, :
n greater than number of different finite valuesreset to number of different finite values
This warning appears when the number of polygons or individual values matches or is less than the number of categories in the choropleth maps. The maps will still be drawn accurately.
One or both of these messages appears in the R console:
st_centroid assumes attributes are constant over geometries of x
st_centroid does not give correct centroids for longitude/latitude data
These warnings may appear when you first install gatpkg or if you use the population weighting option in GAT. They are not errors and the centroids will still write correctly, assuming you are using appropriate coordinate systems.
This should be addressed as of v2.0.0.
These errors and warnings are related to files produced by GAT.
This appears to be an issue with the DBF driver used by the foreign package. The driver identifies at least one variable name that it interprets as too long (over 10 characters), but truncates several variable names, not just the offender. The data otherwise still write correctly. This should be fixed as of v1.61.0.
When importing a shapefile, be sure that the same projection is selected in the GIS program as in the original shapefile. The shapefile’s projection information is included in the log file generated by GAT.
Make sure to select that you want a KML file. Check the log file generated by GAT to confirm that you requested one. Wait for the “NYS Geographic Aggregation Tool is finished” message to display before closing the windows/pop-ups generated by GAT.
When I click on a region in Google Earth, the data do not appear in the description callout. The data may not appear in Google Earth 4.x, so use Google Earth 5.0 or greater. Try clicking on the area’s link in the left sidebar to see the data.
This issue occurs if there are too few polygons in the map. If the total number of polygons is less than 2 plus the number of categories (default is 7), the code that assigns the categories will force the scale to be redefined. To fix this issue, use a smaller minimum value, use a map with more polygons, or redefine the number of categories.
This should be fixed as of v2.0.0.
A message like this appears in the R console:
In CPL_write_ogr(obj, dsn, layer, driver, as.character(dataset_options), … : GDAL Message 1: Value 199678888 of field ALAND of feature 40 not successfully written.
This warning occurs when there are numeric fields with very large values, such as square meters of land or water areas. In testing, the output values matched the input values. You can verify this yourself by checking the original DBF file against the crosswalk. To avoid this warning, set large number fields to character or remove them from your DBF before running GAT.
This appears to occur randomly.
If you do not see your log file, check that you have extensions showing in your file manager, as “.log” may be hidden otherwise. If you still do not see the file, you can try two things.
settingsfile =
followed by the full file path to your
“*settings.Rdata” file produced by GAT.If your log wrote incorrectly, rerun writeGATlog() as described above.