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
2 answers

Plotting country borders with maptools - R

Following the excelent post from Joe Wheatley (http://joewheatley.net/ncep-global-forecast-system/) I managed to produce a temperature global map. But, instead of only plotting coastline I've tried to use maptools package to plot country…
pacomet
  • 5,011
  • 12
  • 59
  • 111
1
vote
0 answers

R maptools or rgdal package--how to fill the outside of a polygon?

I am trying to plot a shapefile of polygons on top of another shapefile that already has colored polygons using R, and I am working with maptools and rgdal. I want to clip the bottom shapefile (which has multiple polygons) to the area delimited by…
user1260251
  • 83
  • 1
  • 1
  • 8
1
vote
0 answers

Error in loadNamespace while building R-package

I've got a collection of functions I use that I combine in a local R-package. This works since years. Some of the functions did rely on the packages rgdal, sp, and maptools that are close to their end of life. I managed to edit the function that…
smoff
  • 592
  • 5
  • 21
1
vote
2 answers

Did I build Java 10 wrong or is it something else? Running MapTool on Pi4 (nearly! something wrong with InteropFactoryN?)

I'm looking for a bit of Java help here. I am trying to run MapTool on a Raspberry Pi 4. No mean feat -- I've installed ubuntu server, so I could get a 64 bit operating system. Then I had to build OpenJDK-9 so I could build OpenJDK-10 (a weekend I…
1
vote
1 answer

Drawing thicker state borders and thiner county borders for US map using GADM shapefile

I have an earlier post here on drawing US maps using shape file from GADM while at the same time removing color mapping onto the Great Lakes region. The issue was solved following suggestion by @Majid. Now, I further want thicker state boders and…
Patrick
  • 1,057
  • 9
  • 23
1
vote
1 answer

Appending Spatial Points Attributes to Spatial Lines Data Frame by Line ID

question for GIS fans out there. I have two sp objects. A spatial lines data frame (Taken as a clipped version of the OS Roads Vector) and a spatial points data frame (Data taken from the Police UK Data website). I used the snapPointsToLines…
1
vote
2 answers

How to merge a shapefile with a .csv and create a graph

I am trying to merge a shapefile and .csv file to make a map of election results. I can make a graph when I load the shapefile, but as soon as I merge it with the .csv, it says "Error in plot.window(...) : need finite 'xlim' values". I have been…
Caroline
  • 41
  • 3
1
vote
1 answer

Leaving the path open from geom_path

I am plotting data on a coastline map using geom_path and I can't remove the line linking the first and last data point. The data set for this is quite large but can be found here. The problem was reported and fixed on this thread, although it…
Drosof
  • 191
  • 4
  • 16
1
vote
1 answer

Sum pixel values of a raster for each wrld_simpl ISO3 countries

I wish to extract for each ISO3 (column name in the spatial polygon dataframe wrld_simpl), the sum of the pixel values of a raster r. I was thinking of using the function rasterize, followed by zonal, but when rasterising wrld_simpl, I lose the…
Cecile
  • 527
  • 5
  • 22
1
vote
1 answer

lapply to unionSpatialPolygons in a list

I have a big list of SpatialPolygonsDataFrame objects I created using lapply and gdal_polygonizeR (code here: https://johnbaumgartner.wordpress.com/2012/07/26/getting-rasters-into-shape-from-r/) on a list of RasterLayer objects. I now want to union…
Dorothy
  • 523
  • 1
  • 5
  • 17
1
vote
1 answer

mask oceans - wrld_simpl

I have been trying to colour the ocean in white or transparent in the code below, but have been unsuccessful so far. I have seen other posts on Stack but couldn't apply them to my example (e.g. How can I color the ocean blue in a map of the US?). I…
Cecile
  • 527
  • 5
  • 22
1
vote
0 answers

How to get around a corrupt .shx file error when reading a shapefile in R?

I am trying to read a poly-line shapefile in R 3.2.2 using maptools (I can't install rgdal because of company firewalls) but I come up with the following error: Error in read.shape(filen = fn, verbose = verbose, repair = repair) : File size…
ogg
  • 23
  • 5
1
vote
0 answers

Finding coastal and international boarders from shape file in R

I want to automatically create two variables from a shape file: 1. a dummy indicator for if a region has a international border and 2. a dummy indicator for if a region has a coastal border. For example for Guinea variable 1 would be the regions…
guyabel
  • 8,014
  • 6
  • 57
  • 86
1
vote
1 answer

Plotting map points in R

I have successfully loaded a shapefile of NYC PUMA areas into R with maptools and I want to plot 55 points on top of it that I have in another file as follows: X Y pumace10 events_2008 events_2009 -73.9092456917 40.8916125162 3701 2 …
the_t_test_1
  • 1,193
  • 1
  • 12
  • 28
1
vote
1 answer

Issue fortifying shapefile

I cannot fortify my areacode shapefile found here. I ran install.packages("gpclib", type = "source") as instructed in another Stackoverflow question and get the following: trying URL 'https://cran.rstudio.com/src/contrib/gpclib_1.5-5.tar.gz' Content…
Khiem Ha
  • 15
  • 5