Tips for Arc users: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
(6.1 man page links -> cmd template)
Line 5: Line 5:




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 [http://grass.itc.it/grass61/manuals/html61_user/v.in.ogr.html v.in.ogr] (for ESRI shapefiles, MapInfo files, SDTS, TIGER, etc.) and [http://grass.itc.it/grass61/manuals/html61_user/v.in.e00.html v.in.e00] for e00 format.
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 {{cmd|v.in.ogr}} (for ESRI shapefiles, MapInfo files, SDTS, TIGER, etc.) and {{cmd|v.in.e00}} for e00 format.




=== Vector import/export commands ===
=== Vector import/export commands ===


* [http://grass.ibiblio.org/grass61/manuals/html61_user/v.in.ogr.html v.in.ogr] - Convert [http://www.gdal.org/ogr OGR] supported vector formats to GRASS vector format.
* {{cmd|v.in.ogr}} - Convert [http://www.gdal.org/ogr OGR] supported vector formats to GRASS vector format.


* [http://grass.ibiblio.org/grass61/manuals/html61_user/v.out.ogr.html v.out.ogr] - Convert from the GRASS vector format to one of the supported OGR vector formats.
* {{cmd|v.out.ogr}} - Convert from the GRASS vector format to one of the supported OGR vector formats.


* [http://grass.ibiblio.org/grass61/manuals/html61_user/v.in.e00.html v.in.e00] - Import a E00 coverage into a GRASS vector map.
* {{cmd|v.in.e00}} - Import a E00 coverage into a GRASS vector map.




Line 25: Line 25:
  v.in.ogr dsn=Ship_Tracklines.shp output=Tracklines
  v.in.ogr dsn=Ship_Tracklines.shp output=Tracklines


This is the syntax for v.in.ogr 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.
This is the syntax for {{cmd|v.in.ogr}} 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 of Shapefiles from GRASS ====
Line 49: Line 49:
=== Raster import/export commands ===
=== Raster import/export commands ===


* [http://grass.ibiblio.org/grass61/manuals/html61_user/r.in.arc.html r.in.arc] - Convert an ESRI ARC/INFO ascii raster file (GRID) into a GRASS (binary) raster map layer.
* {{cmd|r.in.arc}} - Convert an ESRI ARC/INFO ascii raster file (GRID) into a GRASS (binary) raster map layer.


* [http://grass.ibiblio.org/grass61/manuals/html61_user/r.out.arc.html r.out.arc] - Converts a GRASS raster map layer into an ESRI ARCGRID file.
* {{cmd|r.out.arc}} - Converts a GRASS raster map layer into an ESRI ARCGRID file.


* [http://grass.ibiblio.org/grass61/manuals/html61_user/r.in.gdal.html r.in.gdal] - Import [http://www.gdal.org GDAL] supported raster file into a binary raster map layer.
* {{cmd|r.in.gdal}} - Import [http://www.gdal.org GDAL] supported raster file into a binary raster map layer.
** Import a binary ArcInfo raster grid into GRASS:
** Import a binary ArcInfo raster grid into GRASS:
  r.in.gdal input=/path/to/map/hdr.adf output=map
  r.in.gdal input=/path/to/map/hdr.adf output=map


* [http://grass.ibiblio.org/grass61/manuals/html61_user/r.out.gdal.html r.out.gdal] - Exports GRASS raster data into various formats.
* {{cmd|r.out.gdal}} - Exports GRASS raster data into various formats.
** Export a raster as a GeoTIFF for use with ArcView 3.1:
** Export a raster as a GeoTIFF for use with ArcView 3.1:
  r.out.gdal input=map output=map.tif type=Byte createopt="INTERLEAVE=PIXEL,COMPRESS=PACKBITS"
  r.out.gdal input=map output=map.tif type=Byte createopt="INTERLEAVE=PIXEL,COMPRESS=PACKBITS"

Revision as of 23:31, 10 September 2008

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 v.in.ogr (for ESRI shapefiles, MapInfo files, SDTS, TIGER, etc.) and v.in.e00 for e00 format.


Vector import/export commands

  • v.in.ogr - 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.
  • v.in.e00 - Import a E00 coverage into a GRASS vector map.


Import of Shapefiles into Grass

specify the directory

v.in.ogr dsn=/home/data/navigation_files output=Tracklines layer=Ship_Tracklines
or just the .shp file name directly
v.in.ogr dsn=Ship_Tracklines.shp output=Tracklines

This is the syntax for v.in.ogr 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

Shapefiles can only hold one type of data (point, line, polygon) per shapefile. You can't export a GRASS vector map with both points and areas to a single shapefile. You'll have to do it in two passes to two different files with v.out.ogr and different "type=" parameters.

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

  • r.in.arc - 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.
  • r.in.gdal - Import GDAL supported raster file into a binary raster map layer.
    • Import a binary ArcInfo raster grid into GRASS:
r.in.gdal input=/path/to/map/hdr.adf output=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 input=map output=map.tif type=Byte createopt="INTERLEAVE=PIXEL,COMPRESS=PACKBITS"

See also

GRASS migration hints