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
1
vote
1 answer

How to customize number of bins using maptools library in R

I am trying to create map chart with a number of restaurants in USA by counties. However due to a large range of value of bins all counties look very same in color. How can I customize the number of bins so I can add more colors to chart. I have…
dgl
  • 73
  • 1
  • 2
  • 9
1
vote
1 answer

Heatmap in R including Alaska and Hawaii

I would like to create a heat-map including both Alaska and Hawaii in R. This is a reference, but it does not include Hawaii or Alaska: Create a heatmap of USA with state abbreviations and characteristic frequency in R
megv
  • 1,421
  • 5
  • 24
  • 36
1
vote
1 answer

How to add a column with location-based data to a SpatialPolygonsDataFrame in R?

I have spatial data in R which is loaded as a SpatialPolygonsDataFrame: library(sp) library(tmap) d <- readRDS("data.rds") qtm(d) For the example, I used data for Germany from http://www.gadm.org/download. Below, you see the map plotted by qtm(d).…
Xiphias
  • 4,468
  • 4
  • 28
  • 51
1
vote
0 answers

Automatic label plotting using pointLabel() from maptools library in R

I am trying to solve automatic label placement problem for an engineering drawing using the Simulated Annealing algorithm. I came across the pointLabel() function in the maptools library in R. However, what I found was that while the function is…
Dhiraj
  • 1,650
  • 1
  • 18
  • 44
1
vote
1 answer

Population-weighted polygon distortion (cartograms)

I'm trying to create a map in R that conveys both the shape of underlying geometry (i.e., the physical boundaries) and the relative importance of the object in terms of an associated value. For concreteness, I'd like to focus on reproducing (a…
MichaelChirico
  • 33,841
  • 14
  • 113
  • 198
1
vote
1 answer

How to create map in R from spatial polygon given as list data type

I have a list (imported from Stata dta file) containing entries defining spacial polygons for a map, to give an idea: > typeof(aux3) [1] "list" > mode(aux3) [1] "list" > head(aux3) _ID _X _Y 1 1 NA NA 2 1 -22.23933…
0range
  • 2,088
  • 1
  • 24
  • 32
1
vote
1 answer

network visualization of curved/ non-straight routes with R

I'm currently trying to plot curved trading routes along the sea on a spatial map with R. Results should look something like this: http://spatialanalysis.co.uk/2012/03/mapped-british-shipping-1750-1800/ or this Can somebody recommend me a package…
1
vote
1 answer

Change percentage range qtm-generated map

I am checking qtm helpfiles, but it doesn't say how to change legend percentage. library(ggmap) library(rgdal) library(rgeos) library(maptools) library(dplyr) library(tidyr) library(tmap) doe <- readOGR(dsn = ".", layer = "doesep") qtm(doe, fill =…
Rhonda
  • 1,661
  • 5
  • 31
  • 65
1
vote
1 answer

Extracting point data from a large shape file in R

I'm having trouble extracting point data from a large shape file (916.2 Mb, 4618197 elements - from here: https://earthdata.nasa.gov/data/near-real-time-data/firms/active-fire-data) in R. I'm using readShapeSpatial in maptools to read in the shape…
kim1801
  • 129
  • 3
  • 10
1
vote
0 answers

R intersection of Shapefiles

I have a shape file of the road network of the UK. I also have the lat-longs of a GPS tracking device connected to a vehicle. I can convert the GPS lat-longs to a SpatialLine for each trip. There are however some erroneous data points in the GPS…
h.l.m
  • 13,015
  • 22
  • 82
  • 169
1
vote
1 answer

Raster not cropping to shapefile

I'm attempting to merge some states from a shapefile, and produce a raster that I can use downstream. I have gotten the states merged, however when I am creating an empty raster to rasterize with the crop function seems to fail. I'm pretty new to…
Reed
  • 308
  • 2
  • 14
1
vote
1 answer

Add lat/long or URM coordinates to shapefiles in R

I am new to GIS in R, and I'm attempting to add either lat/long or UTM coordinates to a shapefile. I downloaded the boundaries of the city of Chicago (City_Boundaries.shp)from here:…
user2047457
  • 381
  • 4
  • 13
1
vote
1 answer

Subset polygons of a single spatialPolygonsDataFrame row

I want to split a single spatialPolygonsDataFrame row that consists of multiple polygon geometries, and I'm not sure about the most sensible way to achieve this. For example if we want to remove Alaska from usa below here, we could filter out…
geotheory
  • 22,624
  • 29
  • 119
  • 196
1
vote
1 answer

Changing/adding spatial boundaries/polygon shapefile R

I'm dealing with an Afghanistan shapefile which contains all of the provinces. I ultimately want to plot some data by regional command, which each contain several provinces (this is what I'm talking about:…
chilland
  • 69
  • 1
  • 7
1
vote
1 answer

Errors working through plotting shapefiles in the ggplot wiki

I'm trying to learn how to plot shapefiles with ggplot2 and I found a wiki at: https://github.com/hadley/ggplot2/wiki/plotting-polygon-shapefiles I downloaded and extracted the zip file provided into new directory on my desktop (…
cylondude
  • 1,816
  • 1
  • 22
  • 55