[ncl-talk] Error converting shapefile to netcdf (format issues)

Mary Haley haley at ucar.edu
Tue Oct 10 22:10:30 MDT 2017


Hi Lyndz,

The issue is that this file has variables of type int64 which are not
recognized by the current version of NCL.We fixed this problem in July and
it will be in the next release of NCL. What this version does is convert
the int64 types to double.  This may still be an issue, but you do at least
seem to get the correct values.

I did an ncl_convert2nc on your attached shapefile (thanks for providing
this), and then did:

ncl_filedump jtwc_P45-P51_par_1979-1993.nc -v Hour,Year

The output seems to indicate good values:
   file global attributes:
      segs_numPnts : 1
      segs_xyzIndex : 0
      geom_numSegs : 1
      geom_segIndex : 0
      geometry_type : polyline
      layer_name : jtwc_P45-P51_par_1979-1993
      creation_date : Tue Oct 10 21:59:19 MDT 2017
      NCL_Version : 6.5.0 -08Oct2017_1141
      system : Darwin MacBook-Pro.local 16.7.0 Darwin Kernel Version
16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64
x86_64
      Conventions : None
      title : NCL: convert-OGR-to-netCDF
   dimensions:
      geometry = 2
      segments = 2
      num_features = 56
      num_segments = 56
      num_points = 1242
      ncl_strlen_0 = 4
   variables:
      integer geometry ( num_features, geometry )
      integer segments ( num_segments, segments )
      double x ( num_points )
      double y ( num_points )
      double SN ( num_features )
      double CY ( num_features )
      double Year ( num_features )
      double Month ( num_features )
      double Day ( num_features )
      double Hour ( num_features )
      double Lat ( num_features )
      double Lon ( num_features )
      double VMax ( num_features )
      character Cat ( num_features, ncl_strlen_0 )

Variable No. 0
     Hour:

   12.00       18.00       18.00       6.000       12.00       6.000
   6.000       6.000       0.000       0.000       6.000       6.000
   6.000       12.00       0.000       18.00       0.000       12.00
   6.000       18.00       18.00       18.00       0.000       6.000
   6.000       0.000       12.00       18.00       0.000       0.000
   6.000       12.00       18.00       0.000       18.00       12.00
   6.000       6.000       18.00       0.000       12.00       18.00
   0.000       18.00       6.000       18.00       0.000       18.00
   18.00       18.00       18.00       18.00       12.00       0.000
   18.00       18.00

Variable No. 1
     Year:

   1983.       1983.       1983.       1985.       1987.       1984.
   1987.       1983.       1984.       1985.       1987.       1991.
   1979.       1982.       1986.       1991.       1992.       1979.
   1982.       1984.       1985.       1986.       1990.       1992.
   1984.       1986.       1982.       1984.       1986.       1993.
   1987.       1980.       1981.       1982.       1990.       1992.
   1990.       1992.       1993.       1985.       1980.       1982.
   1990.       1981.       1993.       1982.       1991.       1993.
   1982.       1990.       1991.       1993.       1989.       1993.
   1993.       1989.

If you would like to try this version of NCL, let us know.  You can email
me offline about this. Meanwhile, I have filed a ticket (NCL-2671)
regarding the fact that the int64 values are converted to double, in case
it's something we can fix easily.

-Mary


On Tue, Oct 10, 2017 at 8:48 PM, Lyndon Mark Olaguera <
olagueralyndonmark429 at gmail.com> wrote:

> Dear NCL experts,
>
> I am trying to convert a shapefile to netcdf file using the ncl_convert2nc
> function. I am using NCLv6.4.0.
>
> I attached the shapefiles in this email.
>
> Here is the error.
>
> *See http://www.ncl.ucar.edu/ <http://www.ncl.ucar.edu/> for more details.*
> *fatal:FileAddVar: an error occurred while adding variable <SN> to file
> <jtwc_P45-P51_par_1979-1993>, check to make sure data type is supported by
> the output format*
> *fatal:["Execute.c":8640]:Execute: Error occurred at or near line 531 in
> file /tmp/tmp29593-59dd85b8.ncl*
>
> Is there a specific format that this function requires in converting a
> shapefile (e.g. dates and variables only?
>
>
> Sincerely,
>
> Lyndz
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20171010/6cb27932/attachment.html>


More information about the ncl-talk mailing list