<div dir="ltr"><div>Hey Jason,</div><div>I may not have correctly interpreted your initial issue, and therefore gave you advice that wasn't going to solve your particular problem.</div><div><br></div><div>Let's forget about writing to a new shapefile.</div><div><br></div><div>Instead, what if you looped through each of the entries in the dbf entries, parsed out the data to obtain the specific type of product (SVR, SMW, RFW), and then plotted each individual shapefile with you assigned colors/line attributes? The pseudo code would look something like</div><div><br></div><div>'q dbf [shapefile]' --> write results to an external ASCII file</div><div>*read from external ASCII file using GrADS scripting language</div><div><br></div><div>stat = 0</div><div>while (stat = 0)<br></div><div> read([extrnal ASCII file]) [note: "read" is an actual GrADS scripting language command to read from a text file...you do not need to open the text file first]</div><div> stat = sublin(result,1)</div><div> rec = sublin(result,2)</div><div> if (stat = 0)</div><div>  * parse "rec" value to obtain the type of product in the DBF line</div><div>  type = subwrd(rec,[whatever])<br></div><div>  if (type = "RFW')</div><div>   * set shapefile plotting options for this product type<br></div><div>  endif</div><div>
<div>  if (type = "SVR)</div><div>   * set shapefile plotting options for this product type<br></div><div>  endif</div>


<div>  if (type = "SMW')</div><div>   * set shapefile plotting options for this product type<br></div><div>  endif</div></div><div>
<div>  'd shp [rec number], which should be the first bit at the beginning of each line of the DBF</div><div> else [if there is an error, stat will be some other value, and you can tell what it is based on the documentation for this function call]</div><div>  * skip this entry, exit loop, or whatever else</div><div>endwhile</div><div><br></div><div>Jeff Duda<br></div>

</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 25, 2022 at 10:49 PM Jason M. Warren <<a href="mailto:jason@solargrafix.com">jason@solargrafix.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I still can not figure this out.  Here is what I have come up with:<br>
<br>
'set shp -line C:\OpenGrADS-2.2\data\haz\current_all'<br>
'set gxout shp'<br>
'set shp -ln -fmt 8 4 linem'<br>
'set shpattr AUTHOR string SPC'<br>
'set shpattr TYPE string grid lines'<br>
'set shpattr DESC string red flag warning'<br>
'd var209113_500m'<br>
<br>
I can not figure out how to define the shapefile element, which in this <br>
instance would be RFW.  I also can not figure out how to output to a new <br>
shapefile.  Any assistance would be greatly appreciated.<br>
<br>
<br>
Thank you,<br>
<br>
Jason Warren<br>
<br>
<br>
<br>
On 3/7/2022 18:35, <a href="mailto:gradsusr-request@gradsusr.org" target="_blank">gradsusr-request@gradsusr.org</a> wrote:<br>
> Send gradsusr mailing list submissions to<br>
>       <a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
><br>
> To subscribe or unsubscribe via the World Wide Web, visit<br>
>       <a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
> or, via email, send a message with subject or body 'help' to<br>
>       <a href="mailto:gradsusr-request@gradsusr.org" target="_blank">gradsusr-request@gradsusr.org</a><br>
><br>
> You can reach the person managing the list at<br>
>       <a href="mailto:gradsusr-owner@gradsusr.org" target="_blank">gradsusr-owner@gradsusr.org</a><br>
><br>
> When replying, please edit your Subject line so it is more specific<br>
> than "Re: Contents of gradsusr digest..."<br>
><br>
><br>
> Today's Topics:<br>
><br>
>     1. Re: Plotting shapefile elements (Jeff Duda)<br>
>     2. Re: [EXTERNAL] Re:  Plotting shapefile elements<br>
>        (Adams, Jennifer M. (GSFC-610.2)[ADNET SYSTEMS INC])<br>
><br>
><br>
> ----------------------------------------------------------------------<br>
><br>
> Message: 1<br>
> Date: Mon, 7 Mar 2022 10:23:28 -0700<br>
> From: Jeff Duda <<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@gmail.com</a>><br>
> To: GrADS Users Forum <<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>><br>
> Subject: Re: [gradsusr] Plotting shapefile elements<br>
> Message-ID:<br>
>       <CAAig09Duramt92AdAEXfKiBPtHHVyqO97ium=<a href="mailto:J9HULcd_K3aSw@mail.gmail.com" target="_blank">J9HULcd_K3aSw@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
><br>
> Consult the GrADS user's page on shapefiles first:<br>
> <a href="http://cola.gmu.edu/grads/gadoc/shapefiles.html" rel="noreferrer" target="_blank">http://cola.gmu.edu/grads/gadoc/shapefiles.html</a><br>
><br>
> I recommend writing each set of product types to a separate shapefile using<br>
> 'gxout shp' and 'shpattr' to control which elements are draw to which file.<br>
> Then plot all elements of each shapefile separately using traditional means.<br>
><br>
> Jeff Duda<br>
><br>
> On Mon, Mar 7, 2022 at 4:16 AM Jason M. Warren <<a href="mailto:jason@solargrafix.com" target="_blank">jason@solargrafix.com</a>><br>
> wrote:<br>
><br>
>> Hello,<br>
>><br>
>> I am trying to plot a shapefile which contains multiple elements.  I<br>
>> queried the shp and dbf files as follows:<br>
>><br>
>><br>
>> ga-> q shp current_warnings<br>
>> Shapefile Type=Polygon #Shapes=4 XBounds=-88.9:-86.86 YBounds=29.38:37.16<br>
>> 0:  Polygon  parts=1  vertices=5  XBounds=-88.05:-86.86<br>
>> YBounds=29.38:30.01  ZBounds=0:0  MBounds=0:0<br>
>> 1:  Polygon  parts=1  vertices=19  XBounds=-88.49:-87.05<br>
>> YBounds=36.5:37.16  ZBounds=0:0  MBounds=0:0<br>
>> 2:  Polygon  parts=1  vertices=8  XBounds=-88.9:-88.36<br>
>> YBounds=31.43:31.63  ZBounds=0:0  MBounds=0:0<br>
>> 3:  Polygon  parts=1  vertices=11  XBounds=-88.35:-88.01<br>
>> YBounds=32.05:32.25  ZBounds=0:0  MBounds=0:0<br>
>><br>
>><br>
>> ga-> q dbf current_warnings<br>
>> RECORD#,PHENOM,SIG,WARNID,WFO,EVENT,ISSUANCE,EXPIRATION,URL,MSG_TYPE,PROD_TYPE<br>
>><br>
>><br>
>> 0,MA,W,O.NEW.KMOB.MA.W.0008.0109022<br>
>>           2070225.670784,KMOB,0008,2022-01-09 19:02:25,2022-01-09<br>
>> 21:00:00,<br>
>> <a href="http://forecast.weather.gov/product.php?site=MOB&issuedby=MOB&product=SMW,SMW,Marine" rel="noreferrer" target="_blank">http://forecast.weather.gov/product.php?site=MOB&issuedby=MOB&product=SMW,SMW,Marine</a><br>
>> Warning<br>
>> 1,FF,W,O.CON.KPAH.FF.W.0005.0109022<br>
>>           2055627.670773,KPAH,0005,2022-01-09 17:56:27,2022-01-09<br>
>> 21:15:00,<br>
>> <a href="http://forecast.weather.gov/product.php?site=PAH&issuedby=PAH&product=FFS,FFS,Flash" rel="noreferrer" target="_blank">http://forecast.weather.gov/product.php?site=PAH&issuedby=PAH&product=FFS,FFS,Flash</a><br>
>> Flood Warning<br>
>> 2,SV,W,O.NEW.KMOB.SV.W.0003.0109022<br>
>>           2072922.670791,KMOB,0003,2022-01-09 19:29:22,2022-01-09<br>
>> 20:15:00,<br>
>> <a href="http://forecast.weather.gov/product.php?site=MOB&issuedby=MOB&product=SVR,SVR,Severe" rel="noreferrer" target="_blank">http://forecast.weather.gov/product.php?site=MOB&issuedby=MOB&product=SVR,SVR,Severe</a><br>
>> Thunderstorm Warning<br>
>> 3,SV,W,O.CON.KMOB.SV.W.0001.0109022<br>
>>           2072321.670789,KMOB,0001,2022-01-09 19:23:21,2022-01-09<br>
>> 19:45:00,<br>
>> <a href="http://forecast.weather.gov/product.php?site=MOB&issuedby=MOB&product=SVS,SVS,Severe" rel="noreferrer" target="_blank">http://forecast.weather.gov/product.php?site=MOB&issuedby=MOB&product=SVS,SVS,Severe</a><br>
>> Thunderstorm Warning<br>
>><br>
>><br>
>> However, I can not figure out how to plot this with different colors for<br>
>> each element (SVR, SMW, etc...).  I have tried the following code which<br>
>> plots everything in the shapefile...<br>
>><br>
>><br>
>> 'set rgb 1  255 0 0 255'<br>
>> 'set shpopts -1'<br>
>> 'set line 1 1 1'<br>
>> 'draw shp current_warnings'<br>
>><br>
>><br>
>> But I need to know how to draw each kind of element separately (SVR,<br>
>> SMW, etc...).<br>
>><br>
>> Thanks,<br>
>><br>
>> Jason Warren<br>
>><br>
>> _______________________________________________<br>
>> gradsusr mailing list<br>
>> <a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
>> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
>><br>
><br>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font size="2"><span>Jeff Duda, Research Scientist</span></font></div><div dir="ltr"><font size="2"><span></span></font>University of Colorado Boulder</div><div dir="ltr"><font size="2"><span></span></font>Cooperative Institute for Research in Environmental Sciences</div><div dir="ltr">NOAA/OAR/ESRL/Global Systems Laboratory<br><font size="2"><span>

<span>Boulder, CO<br></span></span></font>



</div></div></div></div></div></div></div></div></div></div>