Re: shapefile plotting problem

From: Rick Brownrigg <brownrig_at_nyahnyahspammersnyahnyah>
Date: Mon Apr 18 2011 - 15:20:05 MDT

Hi Ugo,

The changes you had to make to fnames makes sense. When you had:

> fnames = "/shapefile/switzerland/" + (/"waterways","CHE_adm0","CHE_adm1"/) + ".shp"

The leading slash in "/shapefile/switzerland/" makes that an absolute pathname from the root directory of system, which almost certainly would not exist. Specifying

> fnames = "shapefile/switzerland/" + (/"waterways","CHE_adm0","CHE_adm1"/) + ".shp"

makes it a relative path from your current directory.

As for the error at line 106, its not clear this has anything to do with the reading of the shapefiles. Would you mind posting your script (or otherwise send it directly to me)?

Thanks
Rick

On Apr 18, 2011, at 2:20 PM, ugo merlini wrote:

> Hi,
>
> I'm new to NCL I'm tryng to execute shapefile6.ncl example
>
> I downloaded all shpaefiles required and i put to myhome/shapefiles/swtizerland/ directory.
>
> I also modified the script to take care of this change
>
> from
>
> fnames = (/"switzerland/waterways","CHE_adm/CHE_adm1"/) + ".shp"
>
> to
>
> fnames = "/shapefile/switzerland/" + (/"waterways","CHE_adm0","CHE_adm1"/) + ".shp"
>
> I also think that there is an error the / between CHE_adm (which in real CHE_adm0) and CHE_adm1
>
>
> I was not able to read waterway shapefile
>
> Reading '/shapefile/switzerland/waterways.shp'
> fatal:_NclCreateFile: Requested file does not exist as (/shapefile/switzerland/waterways.shp) or as (/shapefile/switzerland/waterways), can't add file
> fatal:Either file (f) isn't defined or variable (segments) is not a variable in the file
> fatal:Execute: Error occurred at or near line 93
>
> CHE_adm0" and "CHE_adm1 are read correcly (I hope)
>
> but changing to
>
> fnames = "shapefile/switzerland/" + (/"waterways","CHE_adm0","CHE_adm1"/) + ".shp"
>
> all files are read :-) but came up with new errors
>
> (0) Reading 'shapefile/switzerland/waterways.shp'
> (0) Reading 'shapefile/switzerland/CHE_adm0.shp'
> (0) Reading 'shapefile/switzerland/CHE_adm1.shp'
> fatal:Subscript out of range, error in subscript #0
> fatal:An error occurred reading colors
> fatal:Execute: Error occurred at or near line 106
>
> any suggestion?
>
> Regards
>
> Ugo
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Apr 19 07:20:15 2011

This archive was generated by hypermail 2.1.8 : Tue Apr 19 2011 - 18:32:02 MDT