Statistical computing language and software environment.

learn more… | top users | synonyms

2
votes
1answer
17 views

Unsupervised classification with kmeans in R

I have a time series of satellite images (5 bands) and want to classify them by kmeans in R. My script is working fine (loop through my images, convert the images to data.frame, cluster them, and ...
2
votes
2answers
257 views

Conversion of Latitude/Longitude to different map projection

I have two m*n matrices coming from a WRF-ARW simulation: one exclusively with longitude values and one with only latitude values. For both matrices I know the originatin projection (lambert conic ...
1
vote
1answer
23 views

Aggregate table with dates and average geographic coordinates

When SOG is 0 Stops gets 1. When the next SOG is 0 then Stops gets 2 and like this consecutively. Now I want to group all the rows where SOG != 0. The trick is that I should have the following ...
4
votes
1answer
121 views
+50

Cell declustering using open-source software

I want to perform cell declustering in a small point data set. I have 9 observation points and I want to find the size of the region of influence for an observation, and afterwards use that as ...
0
votes
2answers
136 views

projection conversion from mercator to google maps format

Is this spTransform(Finland3, CRS("+proj=longlat +ellps=WGS84 +no_defs+ellps=WGS84 +towgs84=0,0,0 ")) the right way to project a shapefile with this projection coord. ref. : +proj=merc +lon_0=0 ...
0
votes
0answers
32 views

Assign CRS to shapefile in R

I imported my shapefile dat to R with readOGR, coordinates are given in easting and northing, I'd like to change it to latlon and tried: dat_latlon <- spTransform(dat, CRS("+proj=longlat ...
1
vote
1answer
30 views

R geographically weighted regression GWModel

I am exploring the use of GWmodel to run some GWR regressions. I set it up and tried to run some sample regressions using the gwr.basic function, but ran into the following error, Error in t(X * W.i) ...
1
vote
1answer
276 views

How to perform a true GIS clip of polygons layer using a polygon layer in R?

I would like to do a true GIS Clip in R of soils polygons using a series of single boundary polygons, but I cannot find an R function to properly do it. It should work just like the CLIP function in ...
1
vote
2answers
46 views

Extract values from raster into points: data loss using extract function from raster package

I am trying to extract values of raster cells on points using extract from raster package in R (similar to 'Extract Values to Points' in ArcGIS-10.2). After doing so in order to check integrity, I ...
4
votes
0answers
62 views

Working with MODIS in R

I am new to using MODIS data and was hoping to get some help starting out. I have been able to download the hdf file but viewing it in R has been a problem for me. What I have found so far, and ...
0
votes
1answer
17 views

Spplot labels in R how to change

Can anyone tell me how to change the labels in a legend created by spplot in R? It is a typical vertical ribbon legend automatically generated by spplot. Based on color, it is labelled 1-7 but I ...
5
votes
1answer
853 views

Interpolating Maps - Statistical Learning Techniques vs Spatial Statistics Techniques

I have recently begun experimenting with the interpolation of variales over a whole country. I have good sized training set where I have several dependant variables (continuous and categorical) ...
0
votes
0answers
60 views

How to prevent cross-world lines in ggplot world map?

I'm having issues displaying 'great circles' paths and polygons in ggmap, an extension of ggplot2. Please enter the following code to replicate my issues: ...
0
votes
1answer
136 views

CSV Format change [closed]

Breakline Input File, Breakline Output file I get a breakline file from a CAD guy in below mentioned format. So I am calling this as a “Input” file. I am calling this as a “Output” file. I would ...
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
13 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
37 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
31 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
113 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
43 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 ...
3
votes
2answers
27 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
55 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
220 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
90 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. ...
6
votes
1answer
419 views

How do I call external files in Python Geoprocessing Service?

I have created a Python script which calls an R script and then reads the output back into Python. I can run this tool in ArcGIS Desktop (10.2.1) and it works fine. When I publish as a geoprocessing ...
2
votes
1answer
83 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
146 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
213 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
58 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
241 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
51 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
40 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
30 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
40 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
15 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
45 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 : > ...
1
vote
1answer
321 views

r.surf.contour in QGIS 2.0

I have a problem with r.surf.contour. I create a DTM with v.to.rast.attribute and then use the r.surf.contour and it works fine in QGIS 1.9 but with QGIS 2.0 doesn't work. I have a contour shapefile ...
3
votes
0answers
48 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
61 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
0answers
52 views

rbind of list of selected point txt files [migrated]

I have lot of Point files in a folder. I would like to rbind (Vertically One after another in a single txt file) as per the list of selected point file from all the point files present in the folder. ...
-1
votes
2answers
73 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
65 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
40 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
1k 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
156 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
64 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
66 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
78 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 ...