background preloader

GIS

Facebook Twitter

CERES Tool Message. The Praise of Insects: Simplifying polygon shapefiles in R. Recently I downloaded the Crosby Code shapefile from Landcare Research's LRIS server for use in some publications I'm preparing.

The Praise of Insects: Simplifying polygon shapefiles in R

This shapefile is incredibly detailed, far more so than what I require. This detail means that it takes a while for the map to be plotted each time. As detail is less important for me than speed of plotting, I decided to try and simplify the map. The first thing we needed is to load the packages required and the shapefile itself: Plotting polygon shapefiles · hadley/ggplot2 Wiki. Plotting polygon shapefiles Goal Use ggplot2 to plot polygons contained in a shapefile.

plotting polygon shapefiles · hadley/ggplot2 Wiki

Packages require("rgdal") # requires sp, will use proj.4 if installed require("maptools") require("ggplot2") require("plyr") GIS and Remote Sensing Unit at FEM-CRI - MODIS Sinusoidal GIS SHAPE files. MODIS sinusoidal grid (SIN) Most MODIS Land products use the Sinusoidal grid tiling system.

GIS and Remote Sensing Unit at FEM-CRI - MODIS Sinusoidal GIS SHAPE files

Tiles are 10 degrees by 10 degrees at the equator. The tile coordinate system starts at (0,0) (horizontal tile number, vertical tile number) in the upper left corner and proceeds right (horizontal) and downward (vertical). The tile in the bottom right corner is (35,17). As a service, we provide above maps as SHAPE file to easily identify MODIS tile numbers for a certain region (tile numbers are stored in the attribute table): OGR – Merging Multiple SHP files. So I have 25 shapefiles with data for 25 counties, and I want to merge them all into one shapefile.

OGR – Merging Multiple SHP files

Using OGR, you can merge 2 files like this: ogr2ogr merge.shp file1.shp ogr2ogr -update -append merged.shp file2.shp -nln merge You create a new shapefile merged and copy the contents of file1 into the new shapefile. Then you append the contents of file2 to the newly created shapefile and name it merged. What do you do if you don’t want to do this 25 times ? Gdal_polygonize.py. Produces a polygon feature layer from a raster gdal_polygonize.py [-8] [-nomask] [-mask filename] raster_file [-b band] [-q] [-f ogr_format] out_file [layer] [fieldname] This utility creates vector polygons for all connected regions of pixels in the raster sharing a common pixel value.

gdal_polygonize.py

Each polygon is created with an attribute indicating the pixel value of that polygon. A raster mask may also be provided to determine which pixels are eligible for processing. The utility will create the output vector datasource if it does not already exist, defaulting to GML format. The utility is based on the GDALPolygonize() function which has additional details on the algorithm. (GDAL >= 1.10) Use 8 connectedness.

#120 (gdal_polygonize missing) – OSGeo4W. #120 (gdal_polygonize missing) – OSGeo4W. 4W_fr – OSGeo4W. Accueil] Japanese Polish Cette page est la version française de la page principale du projet OSGeo4W.

4W_fr – OSGeo4W

Elle peut ne pas être à jour !! Vérifiez toujours les informations qui vous paraissent erronées dans la version anglaise et modifier celle-ci pour la tenir à jour. Vous vous trouvez sur le site web du projet OSGeo4W. Seule les personnes authentifiée (loggué) peuvent soumettre et éditer des tickets, et modifier le wiki. À propos des licenses Démarrage rapide pour les utilisateurs d'OSGeo4W[edit] ¶ Note : la 2eme étape doit être lancé à partir d'un ordinateur ayant un accès à Internet puisque l'installateur télécharge les paquets individuels en fonction des besoins. Télécharger l' Installateur OSGEo4W. Après l'installation : les applications Desktop sont situé dans Démarrer -> Tous les programmes -> OSGeo4Wles applications en ligne de commande seront disponible dans la fenêtre de commande OSGeo4W Shell. les applications web seront disponible sur.

Getting rasters into shape from R. Today I needed to convert a raster to a polygon shapefile for further processing and plotting in R.

Getting rasters into shape from R

I like to keep my code together so I can easily keep track of what I’ve done, so it made sense to do the conversion in R as well. The fantastic raster package has a function that can do this (rasterToPolygons), but it seems to take a very, very long time and chew up all system resources (at least on my not particularly souped up X200 laptop). We can cut down the time taken for conversion by calling a GDAL utility, gdal_polygonize.py, directly from R using system2().

GDAL needs to be installed on your system, but you’ll probably want it installed anyway if you’re planning to talk to spatial data (in fact, you might find you actually already have it installed, as it is required for a bunch of other GIS software packages). Together with it’s cousin OGR, GDAL allows reading and writing of a wide range of raster and vector geospatial data formats. Sys.which("gdal_polygonize.py") …time passes… Lewis_tutorAM.pdf. Shapefile to Raster conversion in r. Shapefile - Converting a polygon into a raster using R. Current community your communities Sign up or log in to customize your list. more stack exchange communities Stack Exchange sign up log in tour help Geographic Information Systems Ask Question Take the 2-minute tour × Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals.

shapefile - Converting a polygon into a raster using R

Resample Raster Images. Download data and R Code for this example When constructing multi-layer raster geospatial data bases from several data sources (e.g., satellite images, digital terrain models), analysts must often modify one or more of the layers so that each data set layer has the same spatial resolution.

Resample Raster Images

The technique used to change the spatial resolution of a raster image is known as image resampling Two R packages enable image resampling: Within the sp package, the Spatial Pixel / Spatial Grid classes to translate an image raster with one spatial resolution into a new grid with a different resolution. The raster package s rasterStack and rasterBrick classes, which can contain multiple raster images, enable several images to be resampled with a single command. Here are two examples. Resample Raster Images. R-sig-geo - converting grid objects to spatial polygon objects and export as shapefile. On Wed, 9 Dec 2009, [hidden email] wrote:

R-sig-geo - converting grid objects to spatial polygon objects and export as shapefile

How to Convert a Raster to a Shapefile. GetGlobCover.R - worldgrids - Processing steps for preparing maps for WorldGrids.org. Software - spatial-analyst.net. His article provides some basic instructions on how to install and do first steps in software the R + Open Source Desktop GIS (OSGeo) + Google Earth bundle that can be used to run analysis of various spatio-temporal data (this article was specifically written for the MS Windows OS users).

This bundle allows full GIS+statistics integration and can support practically about 80% of processing/visualization capabilities available in commercial packages such as ArcInfo/Map or Idrisi (read more about the popularity of R). Although R contains an increasing number of packages for processing GIS raster layers e.g. biOps, rimage; raster (see also the list of r-gis projects under development), the real power is in combining R with Open Source GIS such as SAGA GIS and GRASS GIS. Software such as SAGA GIS allow you to input, edit and visually explore geographical data, before and after the actual statistical analysis. The R + Open Source desktop GIS + Google Earth bundle scheme. Gis - Creating Shapefiles in R. GeoNetwork - The portal to spatial data and information.

Global datasets - spatial-analyst.net. Geographical data - Neftalí Sillero.