0
votes
2answers
45 views

Import shapefiles on my postgis table using R

Using R, I would like to import shapefiles that are in a directory on a geometric table i have on postgresql / postgis. What is the instruction that allows me to do it? EDIT: here is my code to ...
1
vote
0answers
73 views

What's the difference in these two shp files?

I'm trying to plot points on these maps in R, with points from "Coordinates" in the same folder. The WL.shp plots fine with the data, but the NG.shp (which should only be larger and of the same area ...
2
votes
1answer
114 views

Wrong projection high quality shapefile for the coastline of Helsinki region (Finland)

I did some spatial interpolations in R and I need a support for those. Looking for shapefiles online the best I could find was and it looks really horrible, the same area in ggplot looks like . I ...
0
votes
0answers
13 views

plot shp files like pnm? (Statistical Data Analysis Explained example) [duplicate]

Weird subject? well I'm confused so in advance: sorry for this wavy question: I'm trying to do what the authors of Statistical Data Analysis Explained (ISBN: 978-0-470-98581-6) have done in figure ...
1
vote
2answers
74 views

2 shape files plots together in a GIS, but not in R

I tried plotting these two files and a set of points (dropbox folder) in QGIS and MapInfo. They align pretty good (not perfect though). But in R, only the data from www.naturalearthdata.com can plot ...
0
votes
0answers
37 views

MapInfo “shape” file vs. naturalearthdata.com shape file

When i load this map shape file (exported from MapInfo as a shape file) shp.WashingtonLand<-readOGR("C:\\...\\Maps","WLmap2_polyline") R replies: OGR data source with driver: ESRI Shapefile ...
0
votes
0answers
20 views

Overlay Shapefile and Raster layer in R [duplicate]

I have a raster layer with climate data from the north of Mexico, part of Canada and the US mainland. I am trying to restrict the climate data to only the zone of the US mainland. To do this I thought ...
0
votes
0answers
14 views

Plotting two shapefiles using R? [duplicate]

I'm not familiar with using R for GIS. I was wondering if you can help me figure out how to plot different shapefiles at the same time. I'm using the "map" function to generate a map in order to get ...
2
votes
0answers
72 views

Ecoregions shapefiles: subsetting, extracting and summarizing data from raster

I am attempting to subset and project an ecoregions shapefile from : EPA ECOREGIONS my data set is found here: SHAPEFILES and RASTER When I run this code, two major problems occur: 1) I cannot get the ...
0
votes
1answer
50 views

Want to get an SHP file for my coutry Algeria

H everyone , i'm running a clustering test on my country with R, but the problem the clustering doen't look good because of the map i have, i hant to get a bigger map of my country 'ALGERIA' in an SHP ...
2
votes
1answer
41 views

changing attributes or names of shapefiles

I am trying to join a subset of two similar shapefiles, one with states from the US and the second with provinces from Canada. The datasets are available here: shapefiles from Geocommons I noticed ...
2
votes
0answers
69 views

R - how to create a pre-determined number of identical square polygons to use for a choropleth map?

I am trying to plot crime data density (again!) over a city map, say of NY. As a well known problem there are plenty of examples on this ...
0
votes
1answer
84 views

How can I connect my point pattern shapefile with my polygon window in R?

I would like to do some spatial statistics in R. I have a point layer called '1983' that represents the distribution of one species, and a polygon layer called 'SA-R' that represents the study area. ...
2
votes
2answers
319 views

Problem with merging and dissolving a shapefile in R

I am migrating from ArcMAP to opensource GIS. I've succesfully installed R and many packages in a Ubuntu 12.04 machine. I am used to linux and programming in C, but not to R and its syntax. I am ...
0
votes
0answers
35 views

How to get specific coordinate system to get arcGIS point shapefile in r?

I have a Point shapefile from arcGIS 10. I want to get it in r and also want to get it a specific predefined coordinate systen for my data. I can read the shapefile in R but summary in r Shows ...
3
votes
2answers
539 views

Extract Raster from Raster using Polygon shapefile in R

I am new to R and using the raster package. I have a problem extracting polygons from an existing raster file. If I use extract(raster, poly_shape) function on the raster it always creates a list ...
4
votes
0answers
28 views

Projecting polygon when calculating its area? [duplicate]

I have a broad range of polygons (in vector format and in SpatialPolygonsDataFrame class), some going east-west, others going south-north, while even others span polar regions or very large ranges as ...
2
votes
1answer
96 views

Compute the area of a given polygon (in vector format) lying between specified lines of latitude

I have species distributions (in vector format) and I would like to calculate how much of the area for a given species distribution is within certain lines of latitude, such as temperate and tropic ...
4
votes
2answers
128 views

Converting shapefile to raster: Character attributes

I've got a shapefile that I would like to convert into a raster, but the trick is that the attribute I want a raster version of is character data. I'm familiar with geoprocessing using GDAL (in the ...
1
vote
1answer
247 views

Convert from eastings and northings to latitude and longitude without ArcGIS

I am not a GIS user, but I was given some shapefiles to work with. I do not have ArcGIS or any other GIS tool, but I do have Matlab with the mapping toolbox and R. From what I can tell, the data is ...
3
votes
2answers
227 views

How can I create a choropleth from the 2010 census ZCTA shapefile using R and ggplot2?

I have created state and county choropleths in R using ggplot2. The method I have used for this came from Winston Chang's "R Graphics Cookbook". For those choropleths the map was already represented ...
2
votes
1answer
73 views

shape file for linked micromap not working

I am trying to replicate the example provided in the micromap R package of a linked map with the poverty rate for the 50 US states. I am trying to achieve the same results with a Shapefile from ...
3
votes
1answer
249 views

remove land area from marine region polygons

In my pursuit to merge multiple polygons for the purpose of calculating the surface area of marine species distributions, using shapefiles from Marineregions, I am now trying to remove potential land ...
5
votes
4answers
443 views

Calculating percent cover from shapefiles

I normally do not work with shapefiles, so I am a bit lost here. I have two shapefiles each with multiple objects. The first is a set of 32 polygons (each one is a plot). The second shapefile has ...
2
votes
1answer
119 views

Axis of rendered shape files not showing numbers that are latitude and longitude

I am using rgdal to render some shape file. The first is a set of building zones from NYC Open Data. The second is the NYC coast line from OSM. The Zone files seems to generally render an X axis ...
1
vote
2answers
257 views

unionize intersections of merged polygons

[Updated quesion] I am using the following code to merged polygons from shapefiles for the purpose of calculating the surface area; library(maptools) library(rgdal) library(rgeos) #enter slots, ...
3
votes
2answers
253 views

Convert polyline shapefile to points 1m apart and add xy coords in R

I have a table with xy coordinates in R and the following packages loaded: spatstat, raster, rgdal, sp and zoo. I do know how to use this to make a point shapefile, a line shapefile that goes through ...
1
vote
2answers
791 views

Calculate distance in kilometers between two points

I have a few questions regarding the calculation of the distance between 2 postal codes. Take a look at the following code. ### # load the different packages we need ### require("rgdal") ...
0
votes
1answer
72 views

How can I export a point shapefile from ArcGIS to R

I am having several problems in exporting my point shapefile from ArcGIS 10 to R. I tried to save the shapefile as a CSV, but R reads all in one row; somebody in another question answered to use ...
1
vote
1answer
311 views

Can't plot polygons with R and ggplot2

I am new to shapefiles so I maybe ask some stupid questions, sorry. I want to plot a map of my region, with colour filled polygons using R. I have downloaded municipal (lines) and province (polygons) ...
8
votes
2answers
318 views

Simple way to detect/select border polygons of a shapefile

I am looking for a simple way to detect/select border polygons of a shapefile. Border polygons are here polygons that are not completely surrounded by other polygons i.e. polygons located at the ...
0
votes
0answers
25 views

calculating mean and standard deviation for raster values using whole pixels within a polygon [duplicate]

i have a raster image and a corresponding shape file. i would like to calculate the statistics of the values within polygons which have a common attribute but only using pixels which are fully ...
0
votes
0answers
125 views

why readOGR() is not reading projection information from .spj - r

0 down vote favorite I successfully import a polygon shapefile with readOGR, however the information in the .prj file is not being imported. test class : SpatialPolygonsDataFrame nfeatures : 19407 ...
3
votes
3answers
190 views

programmatically add field to shapefiles and insert shapefile name in every row of field

situation We have a folder containing 1 sub-folder for every participant in a study. The subfolders are named with the participants' ID, e.g., 1000, 1001, 1002, 1003. Every participant folder ...
4
votes
1answer
219 views

How to join data from NHGIS to make choropleth maps in R/ggplot2?

I have downloaded shapefiles of county/state boundaries and census data keyed to those shapefiles from the NHGIS. Both the shapefiles and the census data have a GISJOIN column to be used for merging ...
4
votes
2answers
461 views

Reduce the resolution of a shapefile in R (or QGIS if necessary)

I'm using shapefiles of history U.S. state boundaries from NHGIS to make maps in R. These shapefiles are much higher resolution than I need when making maps at the scale of the country: over 2 million ...
4
votes
1answer
1k views

R - Plotting shapefile with geographical (raster) data

Over the last few days I have been trying to plot a shapefile over data loaded into a data.frame within R. It should be a view of radar precipitation with an overlay of the country borders from a ...
0
votes
0answers
183 views

Drawing a map of a country with specific boundaries/zones using postcodes latitude and longitude

I'm quite new in geocoding - it has been fun! My project is to draw Australia with specific boundaries/zones using R program. I was able to successfully upload a shapefile of Australia in R program, ...
0
votes
1answer
50 views

Error in performing transect in ambur R?

I'm trying to filter a transect, window size is 5 and filter individual baselines is set to 0. I select the transect shapefile, then the inner baseline shapefile and it gives me this error. Error in ...
0
votes
0answers
161 views

R program and shape files

I have an R program that sketched a country. This is done by reading a shape file that contains the coordinate of a country (latitude and longitude). How do I export the data from shape file into ...
1
vote
0answers
35 views

How to load or query data directly to R from a PostGIS database using RPostgreSQL and rgdal [duplicate]

Is it possible to load/query a shapefile to R, which is stored in a postgres/postgis database? I've built up a connection to my postgres database via DBI, RPostgreSQL and I want to make some ...
0
votes
0answers
81 views

Why does a shapfile shift after transformation?

I have a shapefile created in the raster package (ER_14.3_2000_poly). > #read in a raster file > ER_14.3_2000<-raster('E:/Ecoregions Models/Outputs/ER_14.3/ER_14.3_ConsensusMap3.asc') > ...
3
votes
1answer
765 views

Setting extent and geographic projection in R

I have a raster and a shapefile that I am attempting to view and process in R. The shape file "ER_11.1" has the following specs: > ER_11.1 class : SpatialPolygonsDataFrame nfeatures : 22 ...
1
vote
2answers
2k views

Choosing the correct value for proj4string for shape file reading in R “MapTools”

I am having a shape file of polygons and another CSV file which contains a list of points as (Lat, Lng) pairs.. I want to check for each (lat, lng) pair from the CSV file which polygon does it fall ...
2
votes
2answers
631 views

Checking if Lng and Lat fall inside polygons from ESRI Shape file

I have two input files. First: CSV file with a list of points each defined with Lng, Lat, Name Second: ESRI Shape file defining a number of polygons I would like to determine for each point I have ...
-2
votes
3answers
685 views

How to add a field to a shapefile using R

This question is trying to make sense of a post that already exists that looks good, but is failing in practice. The second ranked answer uses the foreign package to read a shapefile attribute table ...
5
votes
1answer
2k views

R : convert a spatial polygon objet to spatial polygon data frame

My goal is to modify an existing shapefile by merging certain polygons. After importing the shapefile and using the UnionSpatialPolygons command, I get the polygon outline that I want. However, this ...
2
votes
2answers
690 views

Built a query for polygon Shapefile in R

I use the package maptools to read in Shapefiles in R. I would like to know if there is a function that can built up a query/subset to select only some Polygons based on a specific attribute in the ...
2
votes
5answers
934 views

Counting road intersections and blocks

I have a shp file that consists of the road system of Mexico City. I would like to count the number of road intersections (crossings) and blocks (which I would define as a segment starting from one ...
3
votes
2answers
332 views

How to cut a SHP based on another SHP using R

I have a Shapefile of points with certain information. I have another Shapefile with polygons corresponding to the states of the country I am working with (in this case Mexico). Since I only want to ...