Tips for Arc users

From GRASS-Wiki
Revision as of 21:59, 20 November 2007 by Cmbarton (talk | contribs) (Raster import/export commands)

Jump to: navigation, search

Working with your ArcGIS data

Importing ArcGIS Data

Grass provides convertors for importing ESRI shapefiles, e00 files, and many other GIS formats as well. The key Grass programs for importing vector formats are (for ESRI shapefiles, MapInfo files, SDTS, TIGER, etc.) and for e00 format.

Vector import/export commands

  • - Convert OGR supported vector formats to GRASS vector format.
  • v.out.ogr - Convert from the GRASS vector format to one of the supported OGR vector formats.
  • - Import a E00 coverage into a GRASS vector map.

Import of Shapefiles into Grass

specify the directory dsn=/home/data/navigation_files output=Tracklines layer=Ship_Tracklines
or just the .shp file name directly dsn=Ship_Tracklines.shp output=Tracklines

This is the syntax for in its most basic form. The dsn parameter corresponds to the directory path of the vector you are trying to import. You can enter a full or relative path. The output paramter, aptly enough, is the name of your output Grass vector. The layer parameter is the name of the input vector, be it shapefile, MapInfo file, or what have you.

Export of Shapefiles from GRASS

Export lines from GRASS vector map to Shapefile format (generates /tmp/testogr.shp and related files):

v.out.ogr input=multi type=line dsn=/tmp olayer=testogr 

Export areas from GRASS vector map to Shapefile format (generates /tmp/testogr.shp and related files):

v.out.ogr input=multi type=area dsn=/tmp olayer=testogr 

Export 3D lines from GRASS vector map to Shapefile format:

v.out.ogr input=lines_3d type=line dsn=/tmp olayer=testogr lco="SHPT=ARCZ"

Raster import/export commands

  • - Convert an ESRI ARC/INFO ascii raster file (GRID) into a GRASS (binary) raster map layer.
  • r.out.arc - Converts a GRASS raster map layer into an ESRI ARCGRID file.
  • - Import GDAL supported raster file into a binary raster map layer.
    • Import a binary ArcInfo raster grid into GRASS: in=/path/to/map/hdr.adf out=map
  • r.out.gdal - Exports GRASS raster data into various formats.
    • Export a raster as a GeoTIFF for use with ArcView 3.1:
r.out.gdal in=map out=map.tif type=Byte createopt="INTERLEAVE=PIXEL,COMPRESS=PACKBITS"

See also

GRASS migration hints