gradcomdsetshp.html 4.32 KB
Newer Older
<!--Copyright (C) 1988-2005 by the Institute of Global Environment and Society (IGES). See file COPYRIGHT for more information.-->
<html><head><title>GrADS Command: set shp</title></head><body bgcolor="e0f0ff" text="#000000">
<h2><b>set shp</b></h2><p><code>set shp &lt;-<em>type</em>&gt; &lt;-fmt <em>n m</em> &gt; <i>fnameroot</i></code><p>
Sets the filename root  for shapefile output and has additional arguments to control the type of shapefile created and the formatting of numerical values in the dBase file. This command is used in conjunction with <code><a href="gradcomdsetgxout.html">set gxout shp</a></code> and <code><a href="gradcomddisplay.html">display</a></code> to create four complementary files:</p><ul>
  <p><code><i>fnameroot</i>.shp&nbsp;&nbsp;&nbsp; </code>The main binary file in which each record describes a shape with a list of vertices (default is <code>grads.shp</code>)<br>
    <code><i>fnameroot</i>.shx&nbsp;&nbsp;&nbsp; </code>The index file  contains the offsets for each record in the main file  (default is <code>grads.shx</code>)<br>
    <code><i>fnameroot</i>.dbf&nbsp;&nbsp;&nbsp; </code>A dBase table that contains feature attributes for each record in the main file (default is <code>grads.dbf</code>)<br>
  <code><i>fnameroot</i>.prj&nbsp;&nbsp;&nbsp; </code>A text file that describes the default projection: the WGS84 lon-lat spheroid   (default is <code>grads.prj</code>)</p></ul>
  <p>Where <code><em>type</em></code> may be one of the following:</p>
    <p><code>ln&nbsp;| line&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;</code>(default) Shapefile output will contain shapes of the type PolyLineM (measured contour lines)<br>
      <code>pt&nbsp;| point &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code>Shapefile output will contain shapes of the type PointM (measured points)<br>
      <code>poly&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code>Shapefile output will contain polygons of the type PolygonM (measured polygons)</p>
    <p><code>-fmt <em>n m</em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code>Optional controls for the formatting of the numerical values in the dBase file. <br>
      <code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code><em>n</em>&nbsp;</code>is the maximum number of digits to be used when formatting integers and doubles in the data base entry (default is 12)<br>
      <code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>m</i>&nbsp;</code>is the number of precsion decimal places to be used when formatting doubles in the data base entry (default is 6)<br>
      <code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Both <i>m</i>&nbsp;</code>and <i>n</i> must be provided when using the -fmt option
    <p>&nbsp;  </p></ul><h3>Usage Notes</h3><p>
This command is  available in GrADS v2.0.a9 or later. The -poly option is available in version 2.0.0 or later. <p>The  files <code><i>fnameroot</i>.* </code>will be replaced if they exist. <p>When creating a shapefile with contour lines, the <code><a href="gradcomdsetcterp.html">cterp</a></code> setting is ignored -- contours are written out as if <code> <a href="gradcomdsetcterp.html">cterp</a></code> is set to <code>off</code> (i.e. no spline fitting).<p>Use the <code><a href="gradcomdqshpopts.html">q shpopts</a></code> command to get information on the status of the shapefile options; use  the <code><a href="gradcomdclear.html">clear shp</a></code> command to reset shapefile options to their default values.<p>The output in shapefile format is intended for use with GIS  tools, and can also be drawn with GrADS. Please see the documentation page on <a href="shapefiles.html">shapefiles</a> for more information.<h3>Examples </h3><p><code>set gxout shp<br>
  set shp -ln  -fmt 8 3 my_shapefile_name<br>
 d my_var<br><br>
set shp -poly mypolyfile<br>
set shpattr author string your_name<br>
d my_var</code><br></p><p>Note: The GrADS expression <code>my_var</code> must be a 2-dimensional grid that varies in X and Y (longitude and latitude). In this example, GrADS will use the format string <code>%8.3f</code> to write out double precision numbers to the dBase file. <br></p><p>&nbsp;</p></body></html>