Statistical computing language and software environment.

learn more… | top users | synonyms

7
votes
5answers
3k views

Calculate distance in km to nearest points (given in lat/long) using ArcGIS DEsktop and/or R?

I have two point datasets in ArcGIS, both of which are given in WGS84 lat/lon co-ordinates and the points are spread across the whole world. I would like to find the nearest point in Dataset A to each ...
1
vote
1answer
24 views

How to reproduce contour-style labeling with rasterVis::contourplot?

I am currently working with a digital elevation model (DEM) of Mt. Kilimanjaro, Tanzania. The referring raster grid can be downloaded from DIVA-GIS (Country: Tanzania; Subject: Elevation). After ...
2
votes
1answer
56 views

Export band names with NetCDF file in R

I am using R to work with multiband raster files and am running into a problem. I have named the bands, but when I export in netcdf format, the band names are being stripped. Anyone know how to ...
2
votes
1answer
35 views

average certain raster cells in R

If I have two rasters, let's say x1 and x2, that are the same dimensions, how can I take the average of the two but only where both have data to have a third raster x3 that is a composite of the first ...
3
votes
2answers
135 views

Map accuracy assessment by moving window in R

I would like to make an accuracy assessment using a confusion matrix between classified Landsat image and reference dataset. Maps have the same resolution and extent. I would like to evaluate the ...
2
votes
2answers
51 views

Is there a county-level maps dataset that includes independent cities in virginia?

and thank you in advance for your help. The following code shows the dataset I am working with: library(maps) CountyMapData <- map_data("county") head(CountyMapData) long lat group ...
4
votes
2answers
2k views

How to make RASTER from irregular point data without interpolation

I was trying to make a raster image from an irregularly spaced point database. The data looks like- > head(s100_ras) x y z 1 267573.9 2633781 213.29545 2 262224.4 2633781 ...
4
votes
2answers
33 views

How can I snap one set of points to another in R

I would like to snap one set of points (SpatialPoints* objects) to another in R using Euclidean distance. I'm hoping for a function like maptools::snapPointsToLines. The attributes of the points ...
0
votes
1answer
79 views

R custom color theme in levelplot

R range(diffRain) [1] -2.59 7.59 How can I code a color ramp following ways? red color ramp less than 0.0 blue color ramp greater than 0.0 This is a part of my code. myTheme <- ...
6
votes
3answers
251 views

1km circles around lat-long-points in many places in world

I have hundreds of lat-long-points spread around the world, and must create circle-polygons around each of them, with radius exactly 1000 meters. I understand the points must first be projected from ...
1
vote
2answers
109 views

Inserting a zoomed-in plot with a full scale plot in the sp package in R

I am using the sp package in R to plot sampled points along a river. However, I would like to zoom in to a sampled area of the entire river, and plot this zoomed area on the full length of the river. ...
2
votes
1answer
90 views

How can i use Kriging inside a Postgis database?

i use a postgis database with temperature data. I want to use a spatial interpolation method but not the supported IDW Method. I need to use the kriging Method. Problem is that its no a part of the ...
2
votes
2answers
150 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 ...
1
vote
1answer
220 views

Creating grid polygons from coordinates using R or Python

I have locational data with north-south and east-west coordinates, with a resolution of 100 meters squares. Each data point's location is somewhere within the 100 meters square which centre is given ...
1
vote
1answer
73 views

Creating new shapefile after merge operation using unionSpatialPolygons

I only recently started playing with shapefiles and R packages for manipulating them. I am looking at creating a new shapefile based on merged polyons by following this example, however, I cannot seem ...
4
votes
1answer
253 views

Clip polygon and retain data

I have these two polygons: library(sp); library(rgeos); library(maptools) coords1 <- matrix(c(-1.841960, -1.823464, -1.838623, -1.841960, 55.663696, 55.659178, 55.650841, ...
3
votes
0answers
52 views

How to calculate 90% confidence interval in a raster stack

I have a stack of grid files (23) in ASC format from a MODIS sensor and I need to calculate a 90% confidence interval, mean, min, etc, for each one in R, how can I do that? specially the interval. ...
1
vote
2answers
50 views

Count values greater than 0 in SpatialPolygonsDataframe R

I have a SpatialPolygonsDataframe with > 100 layers and I would like to get a single layer showing the total count of where the values of all the layers are greater than 0. I have tried converting to ...
2
votes
1answer
36 views

Randomly distributed cases according to census data

I'd like to randomly place a point within a geographic boundary with the caveat that I would like to use census data so that points are randomly placed according to population density (i.e. more ...
-1
votes
1answer
49 views

conversion of .img to binary file using R

I have a series of raster images which have to be converted to binary files. I request you to suggest a R code for conversion of all files at a time
3
votes
0answers
20 views

How to set m parameter of clusterR function in R?

I want to manage a clustered computation on raster and thus use the "clusterR" function in R (package 'raster'). However, there's a tuning m parameter to set, but the only explanation about this ...
0
votes
1answer
53 views

clipping two SpatialPolygons : Error in RGEOSBinTopoFunc

I want to clip two SpatialPolygons on R without success, I followed the article in the disscution How to perform a true GIS clip of polygons layer using a polygon layer in R? Polygone 01 : > ...
3
votes
0answers
49 views

Algorithm to find the boundary grid points [duplicate]

Let us consider a set S consisting of a collection of grid locations (i,j),i,j=1,\ldots,n, in 2-dimensional gridded plane. Here the point (i,j) corresponds to a rectangular grid in the X-Y plane. ...
2
votes
2answers
82 views

Convert line shapefile to raster, value=total length of lines within cell

I have a line shapefile representing a road network. I wish to rasterize this data, with the resulting values in the raster showing the total length of the lines that fall within the raster cell. The ...
-1
votes
2answers
76 views

Non Matching Rows between 2 txt files [closed]

I need to compare 2 CSV files so that I can get the missing rows from each CSV. All column attributes in each row should match while comparison. So I have 2 txt files and I would like to compare one ...
1
vote
1answer
96 views

Plotting NetCDF file using lat and lon contained in variables

I am trying to plot this NetCDF file (and similar) as a 2d contour map. The file contains a single layer of one variable, "pr". The file has 413x229 X-Y pixel coordinates, and, stored inside the ...
2
votes
1answer
41 views

What can I use for Territory Management in Canada?

For our Canadian organization, I would like to map out the Postal Codes for each sales rep on a map. I've so far used R to pretty good success, but it completely lacks the interactivity I need to ...
7
votes
4answers
2k views

Overlay a spatial polygon with a grid and check in which grid element specific coordinates are located

How can one use R to split a shape file in 200 meter squares/sub-polygons, plot this grid (incl. ID numbers for each square) over the original map below, and evaluate in which square specific ...
1
vote
1answer
174 views

NAs not allowed error message in attempt to plot raster object in R

I have imported a clipped raster (performed in ArcGIS 10.1) from the National Landcover Dataset into R, but when I try to plot I get the following error message. Error in .readCellsGDAL(x, ...
0
votes
1answer
65 views

Multiple Subsetting

Input File, XY min,max file I have a XYZ .csv file for a large portion of an area. I have another txt file which contains Box numbers, Xmin, Ymin, Xmax, Ymax. I would like to export a CSV file for ...
0
votes
2answers
99 views

How to plot the US maps with selected locations (longitude and latitude of the locations are known)?

I've been struggling with the following R plotting of the US map and wonder if any of you have suggestions on how the plot should be done. Here is what I have tried: US <- map("state",fill=TRUE, ...
11
votes
4answers
1k views

How can I generate irregular grid containing minimum n points?

Given a large (~ 1 million) sample of unevenly distributed points - is it possible to generate irregular grid (in size, but could also be irregular in shape if that is possible?) that will contain ...
0
votes
4answers
80 views

Subsetting a x,y,z into a text file from a large xyz text file

I have a large txt file with x,y,z format. The file size is almost 8 GB. So I don’t want to process in ArcMAP. What I wanted to do is, I have a end coordinates for polygon shapefile and i have ...
0
votes
1answer
45 views

how to convert list of stack images to timseries files in R

Iam using bfast package for time series analysis. But it requires the files to be read as timeseries Problem: How to convert list of stacked images from 2000 t0 2013 into a time series and given as ...
2
votes
0answers
31 views

how to display the legend when the map contains external icons in R

I haven't found anything about the legend when the map contains icons external R (in png), is't possible to use the legend function or another function in R.
9
votes
2answers
126 views

Cleaning blocks pattern from urban LIDAR (blocks uplifted from streets)

We have a 1-meter LIDAR DEM from a city. A small subset can be downloaded from this link: This screenshot shows raw DEM with gray palette (darker belts are streets, and greyish and whitish ...
1
vote
1answer
37 views

R package for geographic regions

Someone told me about a R package with the definition of objects some regions and nations boundaries. I'm trying to find the border of Veneto, an italian region. What's the name of the package? Do you ...
6
votes
2answers
176 views

How do I convert a tweet into a point in QGIS?

I've been doing some research on using R to datamine twitter, but I haven't really found an answer or a decent tutorial for my question. I'm interested in pulling tweets from twitter with a certain ...
2
votes
1answer
134 views

Count overlapping polygons in single shape file with R

I have a shapefile of species ranges for ~ 346 species. Some species have multiple polygon ranges so there are 1,078 polygons and many polygons are multi-part. It looks something like this: I ...
2
votes
1answer
138 views

ggmap: create circle symbol where radius represents distance (miles or km)

I am trying to add a circle around a given latitude and longitude point where the circle size (radius) reflects distance in miles or km. I managed to come up with this example using ggmap, where I ...
0
votes
2answers
786 views

How can I generate a fishnet grid and a matrix of percentage of overlapping in R?

I'm trying use R for create a fishnet grid like in arcGIS with many cells of same size. In the arcGIS 9.3 we have the option of create a polygon with many small square polygons (eg. 1 x 1 degree of ...
3
votes
1answer
54 views

Extract areas of multi-part polygons (SpatialPolygonsDataframe) R

I have a SpatialPolygonsDataframe with multiple polygons, some of these have multiple parts (blue shapes below). In GIS-land it would be easy to get the areas of the individual parts of a multi-part ...
1
vote
0answers
30 views

Get pixel values ascii 50 files

I´m working with photos from a cam. The cam is arranged to take ndvi values instead of RGB for each pixel. I have several folders with 50 pictures in each folder as '*.asc' files the pictures. I am ...
2
votes
1answer
61 views

Extract all unique values from a RGB raster

I have a .png file in RGB format showing the intensity of ship traffic: For my analysis I need to convert it to a one-band raster with values between 0 and 1 where 0 means lowest density and 1 ...
2
votes
0answers
78 views

Plotting Bare Soil Line on landsat data in RStudio?

I am using RStudio with landsat package for computing and plotting the Bare Soil Line (BSL) on landsat tif image running on my HP Pavilion i7 laptop. The codes for running the BSL() function is as ...
1
vote
1answer
32 views

Another Way to Join a New Column to a DBF if OpenOffice is Giving a “Longer Than the Number of Digits Allowed” Error?

When I need to add a data column to a DBF, I always download the shapefile, open the DBF with OpenOffice for Mac, us a VLOOKUP( ) to add my data to a new column, re-save the file as a DBF, then open ...
11
votes
1answer
3k views

Instantiating spatial polygon without using a shape file in R

So, the usual way we read a shapefile in R is via the maptools package, like this: sfdata <- readShapeSpatial("/path/to/my/shapefile.shp", proj4string=CRS("+proj=longlat")) However, I have a use ...
1
vote
1answer
53 views

How can we retrieve the values ​​of the intervals in the legend in R

I have an elevation model plotted in R Code: library(raster) data(volcano) r <- raster(volcano) plot(r, col = topo.colors(20)) Plot: how can we retrieve the values ​​of the intervals in the ...
0
votes
1answer
35 views

smoothing a set point in R

I try to smooth R with a set point as follows: myshp <- shapefile("C:/Users/zina/workspace/Proj_Meteo/interpolate/DZA_adm/DZA_adm0.shp") ...
1
vote
0answers
41 views

Assigning widths to string fields using writeOGR() from rgdal?

I am currently working with MapInfo files in the .tab format. I am using R (3.1.0 for Windows) to read and write files in this format, however, I am encountering an issue with writeOGR() from the ...