[ncl-talk] Shapefile Problem with 6.2.1

Rick Brownrigg brownrig at ucar.edu
Tue Nov 11 16:10:05 MST 2014


Hi,

Is there a typo in this line:

   plres at gsSegments  = f->segments ;(:,0)

I don't think the semicolon should be there.  f->segments should be an N x
2 array.

HTH...
Rick


On Tue, Nov 11, 2014 at 4:00 PM, Scott Capps <scott at allvertum.com> wrote:

> Greetings,
>
> I have just upgraded to version 6.2.1 (ncl_ncarg-6.2.1.Linux_
> Debian7.6_x86_64_nodap_gcc472.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.
>
>      ; THIS IS THE NEW METHOD WHICH PRODUCES STRANGE OUTPUT:
>      plres             = True           ; resources for polylines
>      plres at gsLineColor = "gray25"
>      plres at gsLineThicknessF     = 3
>      f = addfile(ncl_dir+"shapefiles/intrastate_shapefiles/intrstat.shp",
> "r") ; Open shapefile
>      plres at gsSegments  = f->segments ;(:,0)
>      poly0   = gsn_add_polyline(wks, plot, f->x, f->y, plres)
>
>      ;
>      ; THIS OLD METHOD WORKS BUT IS VERY SLOW:
>      ; f = addfile(ncl_dir+"shapefiles/intrastate_shapefiles/intrstat.shp",
> "r") ; Open shapefile
>      ; segments = f->segments
>      ; geometry = f->geometry
>      ; segsDims = dimsizes(segments)
>      ; geomDims = dimsizes(geometry)
>      ; geom_segIndex = f at geom_segIndex
>      ; geom_numSegs  = f at geom_numSegs
>      ; segs_xyzIndex = f at segs_xyzIndex
>      ; segs_numPnts  = f at segs_numPnts
>      ; numFeatures   = geomDims(0)
>      ; lines = new(segsDims(0),graphic)   ; array to hold polylines
>
>      ; plres             = True           ; resources for polylines
>      ; plres at gsLineColor = "gray25"
>      ; plres at gsLineThicknessF     = 3
>
>      ; lon    = f->x
>      ; lat    = f->y
>      ; segNum = 0       ; Counter for adding polylines
>      ; do i=0, numFeatures-1
>      ;   startSegment = geometry(i, geom_segIndex)
>      ;   numSegments  = geometry(i, geom_numSegs)
>      ;   do seg=startSegment, startSegment+numSegments-1
>      ;     startPT = segments(seg, segs_xyzIndex)
>      ;     endPT   = startPT + segments(seg, segs_numPnts) - 1
>      ;     lines(segNum) = gsn_add_polyline(wks, plot,
> lon(startPT:endPT),  \
>      ;     lat(startPT:endPT), plres)
>      ;     segNum = segNum + 1
>      ;   end do
>      ; end do
>      ;
>
> The full NCL script is attached.  I can provide sample data upon request (
> invariant_d01.nc, wrftest.nc and the shapefile).
>
> Thank you,
>
> Scott
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141111/c7233224/attachment.html 


More information about the ncl-talk mailing list