Statistical computing language and software environment.

learn more… | top users | synonyms

1
vote
1answer
29 views

Finding and loading global population density raster data into R?

I am using the Bioclim dataset for a maxent project right now, but I want to add demographic predictors along with climatic ones. I have the 19 layer raster data from Bioclim and I'm hoping to use the ...
4
votes
1answer
65 views

Great circles path not curved (in R)? Conventions and convertions problems?

I am given the great circle equations of two paths. The first one is Longitude = 168 degree. and the second one is: tan(Lattitude)=.11 cos(Longitude) + .64 sin(Longitude) However, I am ...
1
vote
0answers
50 views

Troubling using MODIS package in R (mac). Error with gdal

I'm new to using MODIS data, and have been trying to set up a a way to use the HDF files produced by MODIS on R. I had trouble with gdal (could only download the package through system dialog), and ...
0
votes
1answer
37 views

Crop Raster from using Polygon shapefile in R

I am trying to crop a raster by a polygon in R to the state of Sergipe-Brazil. My raster is a raster brick criated by 7 .tif files which are EVI (vegetation index) time series. Since the EVI archives ...
3
votes
1answer
66 views

Create polygons of the extents of a Raster in R

I want to create two polygons. One is of the rectangular extents of my raster. I know I can obtain the extent of the raster using r <- raster("band5.tif") e <- extent(r) but don't know how ...
1
vote
2answers
756 views

NA values in dbf when exporting shapefile from R with writeOGR?

I´m writing an esri shapefile from R (2.14.1) on windows, using writeOGR in the rgdal package, in the resulting dbf file, NA values in the spatialpointdataframe (in numeric columns) are not translated ...
0
votes
0answers
22 views

Find Maximum value per month in rasterstack/brick and corresponding timestamp R

When dealing with raster images, I found the raster and rts packages in R to be very flexible for analysing my raster data unlike ArcGIS. In my learning efforts, I have had to do some ...
2
votes
0answers
39 views

Differences in MaxEnt between 'Biomod2' and 'Dismo' package

I am trying to run an ensemble species distribution, however the the results I am getting for MAXENT.Phillips model are not reasonable projections compared to the Random Forest and Boosted Regression ...
2
votes
1answer
33 views

Error writeOGR using R

I am learning how to use writeOGR to write a GPX file. When I run the line of code I get an error message: Creation of output file failed. Example set of data dput(head(location_information)) ...
0
votes
0answers
19 views

Filtering points on a map based on user selection in R

I am trying to put about 5000 points on a map. I achieved this using leaflet and shiny but I am trying to group the data by departments. I want to be able to select only one department in the dataset ...
3
votes
1answer
50 views

extract() function from r raster package returns different cells if “weights” parameter is TRUE or FALSE

I am trying to extract cell values from a RasterLayer based on a SpatialPolygons object. I create the raster with library(raster) rasterValues <- matrix(rnorm(20),4,5) r <- ...
0
votes
1answer
37 views

Find Lat and Long points on land only

I'm new to R and GIS so please forgive me if this is a simple request. I was looking for a way to find out if a Lat/Long point is on land or ocean. I found this previous post from a couple of years ...
0
votes
0answers
24 views

Changing/ updating dimension values of ncdf file in r

I posted this question to SO but in hindsight, gis.se is a much more suitable place: I have several ncdf files that do not have the correct spatial dimension values so I want to update these values. ...
0
votes
0answers
29 views

How to clip MrSID Files in R and export to GeoTiff?

I would like to use R to: Read in an MrSID raster (.sid format) Clip the extent using a shapefile Save the new clipped raster as a geotiff I am fine with steps #2 and 3, but I can't find any ...
1
vote
1answer
242 views

Error in downloading MODIS image using R script

I am trying to download "MOD13A3" MODIS image using R script (http://r-gis.net/?q=ModisDownload) but each time it's ending in error. How to make it work ? ...
6
votes
4answers
480 views

Estimating river Channel Width using Python/ArcGIS/MATLAB/R?

I am trying to estimate the river channel width from digitized polygon or poly-lines shapefiles. To do so, I converted poly-line shape files to points.shp at regular intervals (at 1 cm). Later, I ...
8
votes
2answers
2k views

use proj4 to specify Robinson projection with R ggmap and ggplot2 packages?

I want to project this map in robinson projection: library(ggmap) world <- map_data("world") ggplot() + geom_path(data = world, aes(long, lat, group = group)) ...
0
votes
1answer
39 views

Downloading MODIS data of cloud cover less than 10%

I use ModisDownload from rts package for downloading MODIS data. But is it possible to specify cloud cover and view angle before downloading? e.g. if I want to download MODIS data for cloud cover less ...
2
votes
1answer
39 views

How do you extract the mean fire frequency (raster) for each point within a given buffer size using R?

I am trying to extract fire data (mean and max fire frequency) for each point within a given buffer size (250m) around multiple points. Currently, my point data is in Lat and Long. For the raster ...
0
votes
1answer
184 views

Spatial Join in R

I'm fairly new to using R for spatial work so bear with me. I have found questions similar to this but nothing that answers this question specifically enough for me to implement it. I have point data ...
0
votes
0answers
48 views

Convert raster stack to RGB GeoTIFF for use as a background image in maps (in R)

I've been trying to use R to download google maps images as rasters, then convert them into GeoTIFF files which can be imported as a geo-referenced background layer in GIS programs. I've been ...
14
votes
3answers
775 views

Ecological geospatial conundrum

I am looking for a different, more elegant solution to a spatial statistics problem. Raw data consists of an x-y coordinate for each individual tree (i.e. converted to a point .shp file). Although ...
2
votes
0answers
29 views

How to clip a .osm.pbf file to a shapefile in R

I have (1) an OpenStreetMap file of a large area in .osm.pbf format that I would like to clip with (2) a shape file .shp of a smaller area using R. The output output I would like to get is a ...
1
vote
1answer
37 views

How can I plot points with proportional circles, but also by colour from another attribute? [duplicate]

I have point data of population density that I have plotted to show density with proportional circle symbols. This is straightforward with many ways of achieving this in different software and ...
3
votes
1answer
108 views

Identifying value of closest non-NA pixel

I have a raster representing a large landscape, where pixel values indicate particular land classes. I have been using the "distance" function in Package 'raster' in R to calculate the distance from ...
16
votes
5answers
9k views

How best to fix a non-noded intersection problem in PostGIS?

I'm using a PL/R function and PostGIS to generate voronoi polygons around a set of points. The function that I am using is defined here. When I use this function on a particular dataset I get the ...
1
vote
2answers
46 views

Copy resolution extent CRS metadata from one raster file to another using raster R

I have two geotiff raster files, one has all the metadata information and in the other the information was lost. I know that all the metadata information was exactly the same so I want to copy it from ...
0
votes
2answers
62 views

Remove lines from inside a polygon (shapefile) in r

I have this code which prints the Galápagos Islands. But inside the islands, there are lines that I want to get rid off. How is this possible in R? library(rgdal) library(ggplot2) URL <- ...
1
vote
2answers
352 views

R package spatstat: How to use point process model covariate as factor when pixel image values are numeric

I am trying to model a point process with an image covariate using the ppm() function in the spatstat package in R. I convert my raster to an im object for use with spatstat, and I run into a problem ...
0
votes
1answer
53 views

Change the values of NA cells in a raster by using a geographic subset of the raster as a condition

I would like to replace the NA cells that are within a specified extent (here rectangular area defined by drawExtent in the code bellow) of a raster object. My idea was to use the functions ...
0
votes
2answers
47 views

Create shapefile connecting points “as the crow flies” in R

I have a set of locations (with latitude and longitude). I know how to get the distance between these points, but I want to create a line that connects them with the shortest path ("as the crow ...
0
votes
0answers
27 views

Link between arcgis and R

I am modelling vector abundance using R-INLA package. Next I need to made a map of vector distribution and I use ArcGIS, raster calculator tool. Is there any form to link R and ArcGIS for this ...
2
votes
1answer
32 views

GIS Least Cost Spanning Tree in R

Is there an R package/function that computes a least cost spanning tree given a shapefile or vector containing the latitude/longitude of each point and a raster file that contains the cost of ...
1
vote
0answers
34 views

non-finite value supplied by optim when I use estiStAni or fit.StVariogram

I have computed an empirical spatio-temporal variogram and I want to fit it into a model I built using vgmST. However, whenever I call fit.StVariogram I get the error "non-finite value supplied by ...
20
votes
6answers
13k views

How to cluster spatial data in R?

I am very new to R. I have bunch of data points with latitude and longitude. I want to use R to cluster them based on their distance. I have already taken a look at this page and tried clustTool ...
4
votes
0answers
73 views

Which statistical methods to compare the spatial distribution of two different variables in two raster maps?

I am working with two global raster maps using the R Software (original file: netCDF for map 1 and GeoTIFF for map 2), with a resolution of 5 min of arc. Map 1 contains data on the share of the land ...
13
votes
6answers
5k views

Get Raster Values from a Polygon Overlay in Opensource GIS Solutions

I have two layers. A polygon-shape-layer with many tiles and a raster-layer containing CORINE 2006 land cover with many categories in a colourmap. I want to obtain for each polygon in the shapelayer a ...
0
votes
0answers
13 views

glcm texture in R (mean_Envi)

I am running a Image texture measures from grey-level co-occurrence matrices (GLCM) using the glcm package in R and I would like to know what is the difference between mean' and 'mean_ENVI' / ...
1
vote
2answers
50 views

Transformation from EPSG 31983 to EPSG 4326 change only one axis (R + ggmap)

I'm trying to convert my shape file with spTransform(), but it's not successful. I don't know why it's changing only one axis. I want to change the axis into decimal degree. # Libraries ...
2
votes
1answer
35 views

ArcMAP / R: Convert raster pixels to Long and Lat

I have downloaded a raster, which has the following information. Item Data Date 2015-01-03 00:00:00 Product cold partial sst Satellite NOAA-18 Direction Unknown Dimension 1596 x 1617 BPP ...
4
votes
3answers
137 views

Read a table from an ESRI file geodatabase (.gdb) using R

I am trying to read a table directly from an ESRI file geodatabase into R. An example data file can be downloaded here. The database contains a point feature class (Zone9_2014_01_Broadcast) and two ...
0
votes
0answers
63 views

Changing the cell size and projection of a raster to correspond with the ones of another raster

I have two rasters with different resolution and projection. > r1 class : RasterLayer dimensions : 2510, 5233, 13134830 (nrow, ncol, ncell) resolution : 56, 56 (x, y) extent : ...
2
votes
2answers
35 views

Assigning column names dynamically

I have an interesting problem: I need to batchprocess a few files. I do that in a for-loop, where some operations are performed. Later on I want to write the outcome into an existing shapefile which ...
0
votes
1answer
769 views

R solution for 'TopologyException: Input geom 1 is invalid' self-intersection error?

The 'TopologyException: Input geom 1 is invalid' self-intersection error which arises from invalid polygon geometries has been widely discussed. However, I haven't found a convenient solution on the ...
1
vote
0answers
22 views

Computing intersection of distance circles around fixed points [duplicate]

(to simplify calculations, I assume a spherical earth. All distances are assumed measured "as the crow flies") Suppose we have the lon/lat coordinates for two points (p_1,p_2) less than Nkm apart. ...
3
votes
1answer
79 views

How to do operation after using over() for a shapefile in R?

I am copying the answer of Counts the number of points in a polygon in R library("raster") x <- getData('GADM', country='ITA', level=1) class(x) # [1] "SpatialPolygonsDataFrame" # attr(,"package") ...
2
votes
0answers
47 views

Determine if mapped points are related geographically

Hoping you can help. I'm a clinician trying to determine if some mapped points are related. I basically have a data set of certain long/latitudes. Each lat/long is associated with a positive Sputum ...
3
votes
2answers
782 views

Cannot properly import MODIS MOD07_L2 .hdf files into R using rgdal

I've been trying to accurately import and process some .hdf files from the MODIS Atmospheric Profile product (MOD07_L2) in R for several days now. Still, there's something going wrong during data ...
4
votes
0answers
37 views

Is it possible to use a raster::click event within an interactive leaflet map?

Data Download: https://www.dropbox.com/s/f849ra8l6umo9d8/crops.tif?dl=0 I have various raster images of the world that I would ultimately like to plot within an interactive leaflet map; an example is ...
19
votes
3answers
5k views

How to perform Random Forest land classification?

This is a follow-up to a previous post: Machine Learning Algorithms for Land Classification. It seems that the Random Forest (RF) classification method is gaining much momentum in the remote ...