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
0
votes
0 answers

Creating a polygonal spatial data frame from a feature geometry attribute

I have a data frame that I pulled from a MySQL database that has a feature geometry attribute. For example, here's one record's value for the geom attribute: 'POLYGON((-113.583914 33.786816,-113.58412 33.787018,-113.58412 33.786816,-113.583914…
damian
  • 21
  • 6
0
votes
0 answers

Error in readShapeSpatial: File type cannot be read

I am trying to load a Shapefile using readShapeSpatial() but I get the error "Error in readShapeSpatial(shp) : File type cannot be read" . Any ideas on what is going wrong here? Here is my code with the shapefile I'm using, which comes from the…
rafa.pereira
  • 13,251
  • 6
  • 71
  • 109
0
votes
0 answers

Associating custom data to shapefiles in r

This is probably an obvious question. I have an Australia Shapefile (can be found here http://www.abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/1259.0.30.001July%202011?OpenDocument) and some custom data which contains latitudes and longitudes for a…
Stephen Saidani
  • 101
  • 1
  • 2
  • 8
0
votes
1 answer

R Spatial mapping: Creating intevals using the class interval function

I am new to R and I am currently trying to create a choropleth map. My issue is that my breaks do not make sense. What I would like to do is to create breaks that equal: under 59% 60-69% 70-79% 80-89% over 90% However what I get instead is: under…
dcc_777
  • 1
  • 1
0
votes
0 answers

navigating SpatialPolygonsDataFrame

This is probably a simple question but, I would like to view each output area on a map, having downloaded the boarders from here. Choosing the 2011 OA and getting the Full resolution, extent of the realm. I have upzipped it...and read in the shp…
h.l.m
  • 13,015
  • 22
  • 82
  • 169
0
votes
1 answer

Find maximum point with in each polygon for a set of polygons R

I'm sure this question has been answered elsewhere, but I have not been able to come up with it by searching. I have points representing cities within a country along with population for each city. I also have a polygon file of counties. I want to…
Pete
  • 321
  • 4
  • 16
0
votes
1 answer

How can I know the areas (in km2) of shapefiles distributed across the world (in R)?

I have a bunch of shapefiles contained in an object of the class: [1] "SpatialPolygonsDataFrame" attr(,"package") [1] "sp" I would like to obtain the areas of these shapefiles in km2. Since these shapefiles are distributed across the globe, I have…
user18441
  • 643
  • 1
  • 7
  • 15
0
votes
1 answer

Convert state plane coordinates (Alaska 4) to latitude and longitude

I'm stuck with what I think it a problem of not knowing how to find the right projection input for my state plane (Alaska State Plane Zone 4 NAD83 Feet) to use with function sp::CRS. I'm following the directions for converting from a state plane…
cylondude
  • 1,816
  • 1
  • 22
  • 55
0
votes
1 answer

Error while producing choropleth map with maptoools

Hello, I am new to GIS with R and have been trying to create a choropleth map. I successfully created a choropleth map with ggplot2 and the fortify function, but it is not that easy to add more layers on the top of a map with ggplot2. Instead I am…
asado23
  • 366
  • 1
  • 7
  • 20
0
votes
1 answer

Plot a world map with a specified grid with R

I am trying to use wrld_simpl from maptools package in order to plot a piece of world map with a longitude/latitude grid. For example, I have a netCDF file with longitude and latitude, I create a matrix with all the points I can have on the…
Douie
  • 201
  • 4
  • 11
0
votes
1 answer

How to import projection in readShapePoly() function? - R

I am importing a polygon shapefile from Arcmap that has already a projection set and comes with all its files (sbn,sbx,prj,etc). However after I use the readShapePoly function, when I do a summary it looks like the projection information is blank.…
Herman Toothrot
  • 1,463
  • 3
  • 23
  • 53
0
votes
1 answer

R: plotting a radial distance from a point on world map shapefile

Similarly to my previous question here, say I am plotting countries on a world map using maptools, if I were to plot a country, is there a way of finding the central point of this country and plotting a radial distance from this point? I am using…
userk
  • 901
  • 5
  • 11
  • 19
0
votes
2 answers

How to convert negative svg path data to positive values?

I just created a Mercator projection of world map using mapping tool called indiemapper, and exported that map as SVG using that tool, right now Exported SVG’s path data is in negative points like this,
Karthi Keyan
  • 4,243
  • 5
  • 24
  • 47
0
votes
1 answer

How to export data from a shell and then how to plot it in other computer? R

Eyy guys, I am processing some datum using R in a Mac, first of all let me show you my code. require(spatstat) require(maptools) setwd("/Whereever") # in that folder I have the files sis1993.txt and colombia.shp... mydata <-…
Castiblanco
  • 1,200
  • 4
  • 13
  • 32
0
votes
0 answers

Plotting maps on R readShapePoly()

im trying to import a shapefile to R using the function readShapePoly() on package maptools, but it output this error: Error en .asSpatialPolygonsShapes(Map$Shapes, IDs, proj4string = proj4string, : Not polygon shapes What can i do?, why it…
CRP
  • 405
  • 2
  • 11
1 2 3
10
11