[ncl-talk] Visualizing shapefiles with multiple polygons

Adam Sisco aws0006 at uah.edu
Wed May 29 11:14:49 MDT 2019


Hello NCL users,

I have a question regarding the visualization of shapefiles using NCL. For
the sake of this help request, I have constructed a sample shapefile with a
simplified geometry to illustrate the issue I am having. The shapefile
contains a polygon within the opening of larger polygon, but I'm not sure
NCL's gsn_add_shapefile_polygons function is capturing the
polygon-within-polygon nature of this shapefile. So that my issue can be
reproduced, I have attached:

   1. The sample shapefile I am attempting to plot
   2. The desired visualization of the shapefile
   3. The visualization that results from the gsn_add_shapefile_polygons
   function
   4. The NCL script used to plot the shapefile

I suspect that a more nuanced approach may be needed to produce the proper
visualization. If this is within the capabilities of NCL, I would
appreciate any assistance you can offer. I am using NCL 6.4.0 on a Windows
machine.

********************
begin
  wks  = gsn_open_wks("x11","shapefile_testing")

  res = True
  res at gsnDraw = False
  res at gsnFrame = False
  res at gsnMaximize = True

  res at mpMinLonF = -110
  res at mpMaxLonF = -75
  res at mpMinLatF = 25
  res at mpMaxLatF = 55

  plot = gsn_csm_map(wks,res)

  polyRes = True
  polyRes at gsEdgesOn = True

  poly = gsn_add_shapefile_polygons(wks,plot,"***PATH TO
SHAPEFILE***/test_shapefile.shp",polyRes)

  draw(plot)
  frame(wks)
end
********************

Regards,

*Adam Sisco*
Research Associate
NASA MSFC IMPACT
University of Alabama in Huntsville
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190529/3bf54095/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_shapefile.ncl
Type: application/octet-stream
Size: 457 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190529/3bf54095/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_shapefile.zip
Type: application/x-zip-compressed
Size: 2115 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190529/3bf54095/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: correct_visualization.PNG
Type: image/png
Size: 7264 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190529/3bf54095/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shapefile_testing.png
Type: image/png
Size: 31008 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190529/3bf54095/attachment-0001.png>


More information about the ncl-talk mailing list