Statistical computing language and software environment.

learn more… | top users | synonyms

1
vote
0answers
49 views

How to remove polygons in shapefile based on attributes in R [duplicate]

I have a shapefile where some attribute data is blank. I can delete those rows attribute table using na.omit. However, the polygons remain when I map the shapefile. I'm using R to make these changes. ...
1
vote
1answer
390 views

How to replace values in rasters in directory 1 based on condition on other rasters in another directory?

Having 10 raster files in one directory and another 10 rasters in another directory and both have the same dimensions. directory 1: files1 <- list.files("C:\\2010", "*.envi", full.names = ...
2
votes
1answer
448 views

R - Crop a pixel image produced by spatstat with a boundary shape

i am using the very good spatial statistic package spatstat to produce probability maps of spatial point patterns. Here is a simple working result from the examples to try out. require(spatstat) ...
7
votes
1answer
909 views

Removing rows in shapefile in R

I've imported a shapefile into R, and joined it to a table. My shapefile contains all the census ids, while my table only contains selected census ids. I'm now trying delete all the rows didn't get a ...
2
votes
1answer
215 views

Remove intersect of one polygon from another in R

I am trying to remove the intersect from Poly2 onto Poly1. Below are the coords of the 2 polygons. > coords1 [,1] [,2] [1,] 992.0161 7462.531 [2,] 950.1962 7413.532 [3,] 902.3632 ...
5
votes
1answer
147 views

Having trouble finding out what coordinate system a map is using, and how to convert it

I'm using Small Area shapefiles in Ireland from the Central Statistics Office (CSO) website. The link to these is here http://census.cso.ie/censusasp/saps/boundaries/ED_SA%20Disclaimer1.htm (Look for ...
4
votes
2answers
202 views

How to do a looping to Interpolate a huge Rainfall Time-series in GRASS GIS or R

In GRASS GIS I have access to a table in PostgreSQL Database with this structure: Table Name: rainfall_time_series Columns: id | year | month | day | value_mm | x | y | gauge_code Setting g.region ...
4
votes
2answers
252 views

Draw two separate lines from A to B and B to A

I have an Origin-Destination table like this Origin Destination Value A B 10 B A 100 A C 120 ... For all the locations A, B, C... I have another table indicating their location (Lat and Lon) Is ...
4
votes
1answer
1k views

Calculate distance between X/Y coordinates by individual in R

In R, I'd like to calculate the straight-line distance between each capture of an animal in my dataset - no need to take into account the curvature of the earth. I have a dataset that looks like ...
8
votes
2answers
937 views

Choropleth in R: custom breaks and plotting

I have a question with regard to plotting a choropleth map. What is recommended with regard to plotting a map with custom breaks? And make it look a bit attractive. In my script I have used the ...
3
votes
1answer
244 views

Find which grid cells contain a point

I have a dataframe with x,y coordinates. I've sampled 10 x,y coordinates from my dataframe: y <-c(24.637032,21.569813,21.687,19.677183,24.72438,21.433136,24.637032,22.21065,21.443762,25.273882) x ...
2
votes
1answer
232 views

Tearing in ggmap (R) after using spTransform and random point generation using splancs

I am using R and the package ggmap to try and generate some random points within the city limits of Chapel Hill, NC. I have downloaded the shapefile for the town of Chapel Hill from the Orange County ...
6
votes
1answer
106 views

What does shading indicate in home range plot?

I've simulated a home range in R using the clusthr function from the adehabitatHR package. The home range is made from 50 x,y coordinates. The output is attached. I'm trying to get clear on what ...
3
votes
1answer
624 views

Interpolating Maps - Statistical Learning Techniques vs Spatial Statistics Techniques

I have recently begun experimenting with the inteprolation of variales over a whole country. I have good sized training set where I have several dependant variables (continuous and categorical) ...
10
votes
5answers
4k 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 ...
3
votes
1answer
166 views

Difference between gdal versions in reading raster on two machines?

I am using raster data from Afripop.org and using the R package raster (raster_2.0-41) to do all my computation. Everything has been working out just fine until I tried sending some jobs to a remote ...
6
votes
1answer
155 views

weighted mean across rasters in R

I have 2 rasters. One raster (bio1) contains temperature information across a continent. The other (sp) contains, for each cell, a probability of occurrence for a species. I would like to calculate ...
4
votes
2answers
1k views

How do I read a File Geodatabase using R?

File geodatabase (fgdb) includes numerous file geodatabase tables. As far as I know they exist as dbf files, but are within a Database.gdb. In ArcCatalog, the file pathway resembles ...
6
votes
3answers
583 views

Classifying point coordinates to countries or continents?

I have about 50 000 points (latitude and longitude), and I would like to find out in which country each of the points is located. It does not need to be super precise, though. (Or actually I only ...
4
votes
1answer
563 views

Self organizing maps and spatially Constrained Clustering in R

There are a few algorithms to perform spatial clustering in R but most of them focus on point pattern analysis (for example here). I would like to perform spatial constrained clustering for polygon ...
4
votes
2answers
666 views

How to extract values from a raster according to Lat and long of the values?

having 12 files with 12 hdrs for one year: these files are raster (projected WGS84,lat long):https://echange-fichiers.inra.fr/get?k=rLSyoavrnifGyH5XrlO samples = 1440 lines ...
0
votes
2answers
83 views

Reversing a “combine” function on a raster

I have a raster that I think was "combined" using an arcmap function. I am wondering if there is a way to extract just one raster layer from the combined dataset in order to use it separately, either ...
4
votes
1answer
204 views

Use csv file as raster file and stitch them together

I'm having an issue trying to stitch together 100 32bit Tiff files (coming from thermal imagery video and extracted as 32bit Tiff). I used Hugin to mosaic the pictures extracted from the video which ...
2
votes
1answer
338 views

Inverse distance weighted interpolation for categorical and/or binary datasets

I want to perform an Inverse distance weighted (IDW) interpolation to a series of points. However my data set can be categorical or binary and just like the IDW I want to interpolate the new values ...
26
votes
5answers
6k views

How to make beautiful maps in R?

There are quite some nice possibilities to analyse spatial data in R and in the context of my current project I would like to use R more frequently to do that. Until now I plot my maps with ggplot2 ...
2
votes
1answer
148 views

MODIS Level 1B batch process

I am a new MODIS Level 1B user. I have been using the MODIS Swath tool to process my images. However, I have over 1000 images to process. I was wondering if there a script available in IDL or R (very ...
5
votes
2answers
386 views

Spatial Analysis with Factors/Classifications

When doing analysis on spatial data with associated information that is numeric, it is possible to use techniques such as Kriging or Interpolation or Cluster Analysis to find out interesting ...
7
votes
2answers
386 views

How to create a solar intensity map for a garden plot?

I'm interested in creating a raster surface that depicts the average solar intensity per unit area for a small garden plot. I imagine the inputs into the model would be the following: Plot ...
1
vote
0answers
402 views

How to clip the contour map with the polygon using R software?

Hi I am wondering how can I create the contour lines from the discrete x, y and z dataset and then add the shapefile to cut the contour lines by polygon. I want to clip the contour map by the shape ...
4
votes
1answer
968 views

How to re-project ease( Equal Area Scalable Earth) grid with a ~25 km cylindrical projection to WGS84 0.25 degree? [duplicate]

I have nc (NetCDF) files for global soil moisture. From the metadata, the projection is cylindrical and the resolution is 25 km (it is based on authalic sphere based on International 1924 ...
9
votes
2answers
1k views

Aggregating points to grid using R

I have a question with regard to spatial aggregation in R. What I am trying to do is aggregate a point dataset to a grid. I am unsure however how to do this as I have little experience with this sort ...
1
vote
1answer
584 views

Mosaic large dataset with R

I need to merge together 20 32 bit tiff. For that I tried ArcGis but it keeps crashing (the individual tiff are about 1GB). I need a finale Tiff in order to run some analysis and I figured that having ...
1
vote
1answer
113 views

Set certain amount of pixels to 1 inside of a polygon (GRASS)

I have a rather coarse vector map with polygons and want to calculate a (sufficiently) finer raster map defined by spatial extension and resolution. Every polygon of the vector map has a value ...
2
votes
0answers
41 views

Spatial indexing of a point pattern in R [duplicate]

I have a point pattern and a tessellation (grid) in R. Is there a way to spatially index each of my points? In other words, my tessellation grid has n quadrats, I would like to know for each of my ...
3
votes
0answers
532 views

How to Export a Shapefile as KML Using R

All, I have exported an ESRI shapefile (polygon) to KML using R, but the resulting layer shows only the outer extent of the polygon. How can I fill in the area with a color? Any help is greatly ...
1
vote
1answer
134 views

Interpolated map using pca axes

I have done between group pca in R. I want to make an interpolated map using the eigen values of the first three pc axes. I want to produce a map using each of the three pc axes and finally combine ...
4
votes
1answer
1k views

Clip Spatial object to bounding box in R

Given a Spatial object in R, how do I clip all of its elements to lie within a bounding box? There are two things I'd like to do (ideally I'd know how to do both, but either is an acceptable solution ...
4
votes
0answers
49 views

ArcGis Raster Resampling Question [duplicate]

Possible Duplicate: How do you decide what interpolation method to use for resampling raster data? I want to interpolate a certiain target variable over a large territory. I trained a ...
23
votes
6answers
6k views

Tutorials to handle spatial data in R

Does anyone know some good tutorials to handle spatial data in R? I know that there are some packages like rgdal and maptools but I haven't actually found usefull tutorials to get in touch with the ...
1
vote
1answer
563 views

Produce raster map using universal kriging as interpolation method

I want to do kriging with external drift(universal kriging) in R. The covariate I use is in WGS84 refrence system. Because of nature of kriging which calculates distance in planar surface I have to do ...
4
votes
1answer
138 views

How to stack rasters for ecological analysis?

The attached image shows two different forest openings. Each opening has the following layers associated with it: Point shapefile 1 = A red X which represent a large "legacy" tree in the gap Point ...
2
votes
1answer
1k views

Converting geographic coordinate system in R

I have points in geographic coordinate system and I wanted to convert them to swiss grid (CH1903+). Sample data: id lon lat 2 7.173500 45.86880 3 7.172540 45.86887 4 7.171636 ...
6
votes
1answer
296 views

Route analysis in R based on the OSM transport network: possible?

I'm analysing the likely paths taken by commuters on their way to work, based on Census flow data, job density distributions and the transport network. At the moment I'm using pgRouting and the ...
4
votes
3answers
1k views

Reproduce raster with the same extent, and the same number of columns and rows

I have two raster A and B. A and B have the same grid size but different extent. How can I make A has the same number of columns and rows, as well as the spatial extent of B?
5
votes
2answers
897 views

How to implement bivariate Ripley's K function in ArcGIS 10?

The attached image shows a forest gap with red pine represented as circles and white pine represented as crosses. I am interested in determining if there is a positive or negative association between ...
6
votes
1answer
997 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)) ...
1
vote
1answer
395 views

Intersection between two SpatialPolygonsDataFrame using gIntersection function in R

I want to select a subset of my map (a SpatialPolygonsDataFrame) to create a new vector map = part of the initial map included inside a given polygon (eventually, inside several polygons). I have a ...
2
votes
1answer
650 views

Convert a SpatialPolygonsDataFrame to raster using rasterize function

I'm trying to convert my map (a SpatialPolygonsDataFrame) into a raster, using rasterize function, here is a bug that I don't understand... > class(parcel) # this is my map [1] ...
4
votes
1answer
189 views

How to create cohesive Spatial Pixels from Spatial Points Dataset

I have a Spatial Point DF spo (covering an irregular shaped area of interest). The data are not on a regular grid due to crs transformation. My goal is a raster with predefined resolution and extent ...
3
votes
2answers
409 views

How to transform coordinates to location in x-y grid in R?

I have a polygon with a 40m diameter and several points that lay inside it. Now I want to reformat the point locations (projected in DHDN/GK-3, but could vary) to x-y coordinates ranging from zero to ...