View source: R/build_mapping_data.R
build_mapping_data | R Documentation |
'build_mapping_data()' creates the modified shapefiles used by the 'mapindia' package.
'ea_crs()' returns the World Geodetic System 1984 projection method (CRS) used by this package and 'mapindia'.
'compute_centroids()' computes the modified centroids for each state or district polygon using a center-of-mass technique on the largest polygon in the region.
build_mapping_data(type = c("states", "districts"), input_file, output_file)
ea_crs()
compute_centroids(polygons, iterations = 3, initial_width_step = 10)
Using these functions externally is not recommended since they make certain undocumented assumptions that may not work with all inputs.
It is strongly recommend that the 'mapindia' package is used directly.
Gert (2017). “How to calculate polygon centroids in R (for non-contiguous shapes).” <https://gis.stackexchange.com/a/265475>.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.