<div dir="ltr"><div><div><div><div>Hi,<br><br></div>Is there a typo in this line:<br><br> plres@gsSegments = f->segments ;(:,0)<br><br></div>I don't think the semicolon should be there. f->segments should be an N x 2 array.<br><br></div>HTH...<br></div>Rick<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 11, 2014 at 4:00 PM, Scott Capps <span dir="ltr"><<a href="mailto:scott@allvertum.com" target="_blank">scott@allvertum.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Greetings,<br>
<br>
I have just upgraded to version 6.2.1 (ncl_ncarg-6.2.1.Linux_<u></u>Debian7.6_x86_64_nodap_gcc472.<u></u>tar.gz) and am happy with the many enhancements. I am especially interested in the more efficient shapefile plotting abilities. However, I am getting strange output when trying the new shapefile methods. Attached is a ps file generated using the new method (Which has an issue). I can provide the shapefile (Major U.S. highways) as well.<br>
<br>
; THIS IS THE NEW METHOD WHICH PRODUCES STRANGE OUTPUT:<br>
plres = True ; resources for polylines<br>
plres@gsLineColor = "gray25"<br>
plres@gsLineThicknessF = 3<br>
f = addfile(ncl_dir+"shapefiles/<u></u>intrastate_shapefiles/<u></u>intrstat.shp", "r") ; Open shapefile<br>
plres@gsSegments = f->segments ;(:,0)<br>
poly0 = gsn_add_polyline(wks, plot, f->x, f->y, plres)<br>
<br>
;<br>
; THIS OLD METHOD WORKS BUT IS VERY SLOW:<br>
; f = addfile(ncl_dir+"shapefiles/<u></u>intrastate_shapefiles/<u></u>intrstat.shp", "r") ; Open shapefile<br>
; segments = f->segments<br>
; geometry = f->geometry<br>
; segsDims = dimsizes(segments)<br>
; geomDims = dimsizes(geometry)<br>
; geom_segIndex = f@geom_segIndex<br>
; geom_numSegs = f@geom_numSegs<br>
; segs_xyzIndex = f@segs_xyzIndex<br>
; segs_numPnts = f@segs_numPnts<br>
; numFeatures = geomDims(0)<br>
; lines = new(segsDims(0),graphic) ; array to hold polylines<br>
<br>
; plres = True ; resources for polylines<br>
; plres@gsLineColor = "gray25"<br>
; plres@gsLineThicknessF = 3<br>
<br>
; lon = f->x<br>
; lat = f->y<br>
; segNum = 0 ; Counter for adding polylines<br>
; do i=0, numFeatures-1<br>
; startSegment = geometry(i, geom_segIndex)<br>
; numSegments = geometry(i, geom_numSegs)<br>
; do seg=startSegment, startSegment+numSegments-1<br>
; startPT = segments(seg, segs_xyzIndex)<br>
; endPT = startPT + segments(seg, segs_numPnts) - 1<br>
; lines(segNum) = gsn_add_polyline(wks, plot, lon(startPT:endPT), \<br>
; lat(startPT:endPT), plres)<br>
; segNum = segNum + 1<br>
; end do<br>
; end do<br>
;<br>
<br>
The full NCL script is attached. I can provide sample data upon request (<a href="http://invariant_d01.nc" target="_blank">invariant_d01.nc</a>, <a href="http://wrftest.nc" target="_blank">wrftest.nc</a> and the shapefile).<br>
<br>
Thank you,<br>
<br>
Scott<br>
<br>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>