Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
2 answers
240 views

Converting HSV raster to RGB in R

Problem: I want to convert a Hue, Saturation, Value (HSV) raster to the RGB color space. I have already successfully converted from RGB to HSV, but I'm having trouble with the reverse. I'm using the ...
NateDogg123's user avatar
0 votes
1 answer
2k views

Converting points to latitude and longitude values in R

I have a .tiff file with some coordinate data associated with temperatures that I need to convert into latitude and longitude, using R. I used the following code to read the original file: testlat<-...
PeidoFatal32's user avatar
0 votes
1 answer
1k views

Reprojecting a raster from long/lat to UTM take 2

This thread Reprojecting raster from lat/lon to UTM in R? was of no help to me. I have the following raster which I first need to create in lat/long in order to crop it to rworldmap. However, I then ...
user205185's user avatar
0 votes
2 answers
4k views

Using R to convert British National Grid to/from WGS84 without creating spatial object

I have several million coordinates (which are either British National Grid or Long/Lat) and need to convert them. I know using R you can do this in a spatial operation (such as in my example below ...
Chris's user avatar
  • 264
2 votes
1 answer
658 views

Converting st_make_grid object to shapefile using R

I've created the following grid: my_grid_geom = st_make_grid(CLC18, cellsize = 0.4) my_grid = st_sf(geom = my_grid_geom) plot(my_grid) I would like to convert this grid now into a shapefile for ...
perrier's user avatar
  • 119
2 votes
1 answer
1k views

Converting a component of a shapefile into a GeoTIFF file in R

I'm trying to obtain a GeoTIFF map of the WWF biomes, using their shapefile download: https://www.worldwildlife.org/publications/terrestrial-ecoregions-of-the-world The purpose of this is to ...
user avatar
-2 votes
1 answer
697 views

Converting .csv (.geo column in sf package) to shapefile in R [closed]

I have extracted values from raster layers and now want to convert it to shapefile. The CSV file contains values of different bands and one column .geo in sf package. Any ideas to convert the CSV file ...
Tuyen's user avatar
  • 211
1 vote
1 answer
402 views

Options to improve conversion raster to polygon?

Is there a way to convert a raster.tif into a single polygon? # Loading raster.tif DEM <- raster ("C: /Users//raster.tif") # We generate boundary of the raster poly_DEM <- DEM> -Inf polygon &...
orecayetano.r's user avatar
0 votes
1 answer
38 views

Point to Polygon with Fixed Spatial Attributes [closed]

I have a point dataset with 3 useful columns. Those are width, height and direction (degrees from 1 to 360). I would like to create rectangles using the width and height, and with the specific ...
Alfonso de Lara's user avatar
0 votes
1 answer
1k views

Mass conversion of .JP2 images to .TIF format in R

I need to convert a list of .jp2 files to .tif. I cannot do it manually since it is a large number of files. So I can't use: gdal_translate(path_vhr_imag_1, "splt1.tif") gdal_translate(...
sermomon's user avatar
  • 1,044
5 votes
3 answers
2k views

What is the proper way to calculate distance in km from degrees

For a genetic analysis of Australian humpback dolphins I am currently trying to assess whether or not genetic differentiation correlates with geographic distance in water. For this I have done the ...
Sam's user avatar
  • 53
1 vote
1 answer
166 views

Keep raster data in original projection and just display it using a new transformation (at the poles) in R vs ArcMap

Desired output: Raster with original characteristics but in transformed projection using R (I.e. See second paragraph here.). NB, I need to do this for 100s of different rasters. You can achieve this ...
Jono's user avatar
  • 41
2 votes
1 answer
2k views

Exporting a polygon shapefile to GeoJSON with the longitude and latitude switched to latitude and longitude

I want to integrate the GeoJSON of a shapefile into React.js to display it as an interactive map with OpenStreetMap used in the background as a tiled image. I have used QGIS to export the shapefile ...
The-PhD-Gamer's user avatar
6 votes
1 answer
6k views

Converting .osm.pbf to .shp

The website http://download.geofabrik.de/north-america.html does not have shapefiles (shp.zip) for sizable states or countries. How do you convert the available osm.pbf to shp.zip? I have tried QGIS ...
pnkjmndhl's user avatar
  • 794
1 vote
3 answers
2k views

Error in Converting XY Coordinates to Lat-Long Using r proj4 Library

I am trying to write a script that will allow my colleagues to easily convert XY coordinates into lat and long. The idea here is to take a spreadsheet with only X and Y available and create a new ...
user7201984's user avatar
1 vote
0 answers
790 views

How to convert .nc4 files to .nc using R? [closed]

I have thousands of files with the .nc4 file extension and I'd like to convert them to .nc format using the programming language R. I am using the ncdf4 package to read my data, but I've got no ...
Hugo's user avatar
  • 111
2 votes
2 answers
3k views

Convert sgrd (SAGA GIS format) to raster or ascii or with R

I need to convert a sgrd file to tif or ascii using R. I converted a big sgrd file (1.4 GB, 376521831 pixels) to ascii using the package RSAGAbut it takes too long (approx. 45 minutes): rsaga.sgrd.to....
yPennylane's user avatar
5 votes
2 answers
12k views

R - NetCDF to Raster

I've recently started working with spatial data in R. I am currently working on a project that uses data in both raster and netcdf formats, and I'd be happy to convert the latter to the former, ...
yassem's user avatar
  • 53
8 votes
2 answers
5k views

Change a raster from longitude display (-180, 180) to (0, 360)

Using R software, I want to modify the attached raster in order to visualize it centered on the Pacific Ocean. Indeed, I need to show the entire Oceania: in my opinion I have to shift from (-180,180) ...
Marco's user avatar
  • 365
0 votes
1 answer
703 views

R: jsonlite/geojsonio: Why are these geoJSON polygons being read in different formats? And how to deal with them for shp exportation?

EDIT: Turns out fromJSON() has a variable called simplifyVector that by default goes TRUE. By setting it to FALSE I was able to turn the string into Json, from Json into geoJson and from geoJson into ...
Arodas's user avatar
  • 1
0 votes
0 answers
1k views

Extracting information from Esri Grid Format (ADF) file using R?

I have an adf file that has a variety of "attribute" or field layers, and I am trying to extract one layer from that adf file, and convert it to a tiff image for further processing in python. Here is ...
user1738753's user avatar
5 votes
2 answers
31k views

Create a shapefile from dataframe in R, keeping attribute table

I am trying to create a shapefile from a .csv file in R. I can successfully create a working shapefile with this code, but when I try to view the attribute table for it in arcMap 10.4, the table only ...
Mon Mo's user avatar
  • 523
2 votes
1 answer
476 views

Converting MODIS LAI data (2001) from HDF to GeoTIFF?

I am trying to convert MODIS Leaf Area Index (LAI) data from .hdf to GeoTiff from 2001. I can successfully convert it using R for the more recent datasets using the following code: library(gdalUtils)...
Jo_G's user avatar
  • 21
2 votes
0 answers
134 views

Converting u and v from WGS84 to NZTM2000 - Do I need to do vector conversion?

I have u and v wind component values in latitude and longitude in WGS84. I want to convert this to NZTM2000. I've converted the lat/lon in ArcView - (and will try in R) - but do I need to also do some ...
Charlene's user avatar
1 vote
1 answer
942 views

How to read file geodatabase with Binary field in R?

Short version: how can I get into R the dataset available at this link? (you need to log in to download, but registration is free) The dataset that is downloadable at that link expands to a ...
petrelharp's user avatar
1 vote
2 answers
2k views

Converting binary TRMM to GeoTIFF using R?

I´m trying to convert a binary image of TRMM satellite to Geotiff format using this R code: setwd("C:/Users/Hugo/Desktop") trmm.data.file<-"C:/Users/Hugo/Desktop/3B42_daily.2013.04.22.7.bin" trmm....
Bindini's user avatar
  • 419
4 votes
1 answer
4k views

R - Programmatically convert raster stack in data frame based on polygon extraction

Sorry for cross-posting. I also posted this question at the R-SIG-GEO discussion list, but since I wanted to get as much feedback as possible I decided to post it here too. I am trying to extract ...
thiagoveloso's user avatar
1 vote
0 answers
3k views

Converting UNIX time to datetime in R [closed]

I am trying to convert a 13 character UNIX timestamp to datetime and I am getting a year that is in the 44000's. I'm not sure what I am doing wrong, hopefully someone can help. library(maptools) GMT ...
Michael 's user avatar
3 votes
1 answer
2k views

Converting data stored in Excel (grid/matrix) to a raster?

I have some grid data that is stored in a xls file. The rows are latitude and the columns are longitude values in decimal degrees (see image). What would be a quick and efficient way to convert these ...
jotamon's user avatar
  • 1,786
2 votes
2 answers
5k views

Converting LANDSAT-8 TIFF to matrix, data frame, or SpatialGridDataFrame formates

I need to correct the reflectance values of LANDSAT-8 data for steep terrain and find it too tedious and clunky in ArcGIS. The data I have is: LANSDAT-8 DEM (ASTER) Slope and aspect (Derived using DEM ...
Raadad's user avatar
  • 121
6 votes
3 answers
24k views

Convert shapefile with lists to data frame in R

I would like to ask some help for converting a shapefile to data frame. I downloaded data related to roads from Natural Earth. I imported the shapefile using shapefiles package like the following. ...
jazzurro's user avatar
  • 505
5 votes
2 answers
7k views

Convert ESRI Shapefile to Raster using R - biggest polygon area to raster cell value?

I want to create a raster from an ESRI shapefile. Multiple polygons may exist in one raster cell. If so, I want to assign the attribute variable which occupies the biggest area of the raster cell. If,...
A.Spa's user avatar
  • 53
3 votes
1 answer
4k views

Creating DEM from vector contours using GRASS and R?

I want to convert vector contours to a DEM. From other posts, I wanted to use the Grass r.surf.contours tool. Initially, I converted the vector contour layer to a rasterized contours using the ...
boberdorf's user avatar
  • 1,357
8 votes
1 answer
12k views

Saving (converting) raster objects in R?

I want to save my raster plot that produced with R to ArcGIS raster (.img, .tif and ASCII) file.
user19516's user avatar
2 votes
1 answer
999 views

Convert lat/long four corners data to raster

I have a data set in the following format.each row represents the coordinates of the four corners of a cell and the last column is the value associated to the cell. lon1 lat1 lon2 lat2 lon3 lat3 lon4 ...
Herman Toothrot's user avatar
14 votes
1 answer
62k 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 45....
Topdombili's user avatar
46 votes
3 answers
56k views

How can I convert data in the form of lat, lon, value into a raster file using R?

I have a data set of values over a km grid in the continental U.S. The columns are "latitude", "longitude", and "observation", e.g.: "lat" "lon" "yield" 25.567 -120.347 3.6 25.832 -120....
Abe's user avatar
  • 1,943