Questions tagged [r-maptools]

The R package maptools provides a set of tools for manipulating and reading geographic data, in particular ESRI shapefiles.

The R package maptools is a set of tools for manipulating and reading data, in particular s. The package also provides interface wrappers for packages such as PBSmapping, spatstat, maps, RArcInfo, tmap, , , and others.

Repositories

Vignettes

Other resources

Related tags

157 questions
2
votes
0 answers

How to project spatial points in Alaska over a USA map that has re scaled and transformed Alaska in R

I am trying to plot the USA map with ALASKA and then project a set of points on it. I used the posted functions fixup and fix1 in the following link to relocate Alaska & Hawaii. Relocating Alaska and Hawaii on thematic map of the USA with…
Ali
  • 21
  • 1
2
votes
1 answer

mapping by ggplot2 geom_polygon goes crazy after merging data

I am trying to make a grid containing maps of megaregions in the us. I create a SpatialPolygonDataframe from a shape file. then convert it into a data.frame to use ggplot2. as soon as I add the data into the frame, the polygon plots. the file…
BobbyF
  • 431
  • 1
  • 7
  • 19
2
votes
1 answer

r sp/maps/maptools libraries: Map of annual solar irradiation in R

I am trying to plot annual solar irradiation data with different color on a world map. I am using R programming for the purpose. The data I am using is from http://eosweb.larc.nasa.gov/sse/global/text/global_radiation First, I am converting this…
Jawairia
  • 295
  • 4
  • 14
2
votes
3 answers

Boundary polygon of lat lon collection

I have a table containing all the latitudes and longitudes of some locations in a city called queryResult and I do the following: 1 - Get the Raster map of the city[Blackpool for instance] cityMapRaster = get_map(location = 'Blackpool', zoom = 12,…
MHOOS
  • 5,146
  • 11
  • 39
  • 74
2
votes
1 answer

Using R to spatial join a data frame of lat/long points to a polygon shapefil

I'm hoping to write an R program that reads in a data frame of lat/long points and a shapefile of 13 polygons, and then identifies which polygon each lat/long point is located within. Is there an R package that enables me to do this type of spatial…
user3786999
  • 1,037
  • 3
  • 13
  • 24
2
votes
1 answer

spatialpolygonsdataframe polygons jumbled after merge to join data

I'm trying to plot some Turkish data using R. The problem I'm having is when I merge my data with the shape file (in spatialpolygonsdataframe format) the data no longer matches the correct pologons. What am I doing wrong, Below is some…
simon77
  • 73
  • 1
  • 1
  • 9
2
votes
1 answer

Draw line from latitude Longitude points

I am trying to use maptools to draw a series of lines from a set of extracted data. The lat and long data is in a long dataset 72000 points with another column containing a label for each individual line. This label is repeated for each point. #…
SteveG
  • 99
  • 1
  • 11
2
votes
0 answers

Error in plotting data on USA map

I have calculated a variable "final_factor", which I am sure is correct. When I try to plot this data on a map to show the different values, I know California has one of the highest values but it shows it as one of the lowest. I think this has…
Cj C.
  • 31
  • 4
2
votes
1 answer

Holes in polygons disappear after performing checkPolygonsHoles from maptools

Note: At Edzer Pebesma's suggestion, this question has been crossposted to R-sig-geo, here, where it has received some good responses. I encountered the following unexpected result using checkPolygonsHoles: # attach the worldmap as…
Grigory
  • 21
  • 3
2
votes
1 answer

R Converting contour lines to elevation plot

I would like to be able to create an elevation plot from contour lines in R. I am very new to using shape files At the moment I have downloaded data from here which provides .shp files for all of the UK. It also provides the contour lines,…
h.l.m
  • 13,015
  • 22
  • 82
  • 169
2
votes
1 answer

How to color selected countries in wrld_simpl?

I have a plot with a part of wrld_simpl library(maptools) data(wrld_simpl) cntr <- c('Denmark', 'Germany', 'Norway', 'Ireland', 'United Kingdom', 'France', 'Italy', 'Sweden', 'Finland', 'Spain', 'Portugal', 'Latvia', 'Estonia', 'Slovenia',…
jjankowiak
  • 3,010
  • 6
  • 28
  • 45
2
votes
1 answer

Downloading png from Shiny (R) pt. 2

This relates to a question I have asked previously at: Downloading png from Shiny (R) I have now created multiple shiny plots and downloaded them, but for a plot using the maptools package, I just get an empty png back. Is this a bug in Shiny or is…
sba
  • 237
  • 1
  • 2
  • 8
2
votes
1 answer

How to get data from a GIS server in R?

I have been using ArcMap to access GIS data on a spatial data server. I want to figure out how to do the same within R. I know how to read shapefiles into R. I have successfully used maptools and rgdal to open and map locally stored shapefiles…
climatron
  • 23
  • 3
2
votes
1 answer

Plot shape file in google dynamic map

I need to display my shape files (.shp) in google map using R packages. I am using maptools package to read the shape files. using function ==> readShapePoly() and then I will use plot() to display.Now here it is plotting the shapefile content in a…
User12345
  • 455
  • 2
  • 10
  • 21
2
votes
1 answer

Can writeSpatialShape save shapefile with projection (CRS)?

Can writeSpatialShape { maptools } be somehow forced to write the shapefile with CRS? writeSpatialShape(socc_buf, "f:/hdf/socc_buff_R.shp") # no CRS in the shapefile There does not seem to be an option for this. PS: I know it can be done using…
Tomas
  • 57,621
  • 49
  • 238
  • 373