chrisvwn / Rnightlights

R package to extract data from satellite nightlights.
GNU General Public License v3.0
47 stars 14 forks source link

Error when running getCtryNlData #13

Closed giacfalk closed 6 years ago

giacfalk commented 6 years ago

I am running the following command

getCtryNlData(ctryCode = "AGO", 
                admLevel = "adm_2",
                nlType = "VIIRS.Y", 
                nlPeriods = "2015", 
                nlStats = "sum",
                ignoreMissing=FALSE)

After the script gets the shapefile and the raster tile, it returns the following error code:

Error in file.rename(file.path(getNlDir("dirNlTiles"), tgzAvgRadFilename),  : 
  'from' and 'to' are of different lengths

The entire output is the following

Processing missing data: AGO:VIIRS.Y:2015:sum. This may take a while. 
Note: Set 'ignoreMissing=TRUE' to return only data found or 
'ignoreMissing=NULL' to return NULL if not all the data is found
Downloading country polygons ...
Downloading polygon: AGO
Downloading ctry poly: AGO
Polygon dir for AGO already exists
Downloading country polygons ... DONE
**** PROCESSING nlType:VIIRS.Y nlPeriod:2015****
Checking tiles required for VIIRS.Y 2015
AGO: Stats missing. Adding tiles
   |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 00s
1 Required tiles: 00N060W
Downloading tile: 20155
trying URL 'https://data.ngdc.noaa.gov/instruments/remote-sensing/passive/spectrometers-radiometers/imaging/viirs/dnb_composites/v10//2015/SVDNB_npp_20150101-20151231_00N060W_v10_c201701311200.tgz'
Content type 'application/x-gzip' length 3662257036 bytes (3492.6 MB)
downloaded 3492.6 MB

Extracting C:/xxx/.Rnightlights/tiles/NL_TILE_VIIRS.Y_2015_00N060W.tgz Wed Sep 05 14:49:56 2018
Getting list of files in C:/xxx/.Rnightlights/tiles/NL_TILE_VIIRS.Y_2015_00N060W.tgz Wed Sep 05 14:49:57 2018
Decompressing SVDNB_npp_20150101-20151231_00N060W_vcm-ntl_v10_c201701311200.avg_rade9.tifSVDNB_npp_20150101-20151231_00N060W_vcm-orm-ntl_v10_c201701311200.avg_rade9.tifSVDNB_npp_20150101-20151231_00N060W_vcm-orm_v10_c201701311200.avg_rade9.tifSVDNB_npp_20150101-20151231_00N060W_vcm_v10_c201701311200.avg_rade9.tif Wed Sep 05 14:51:50 2018
chrisvwn commented 6 years ago

Hi,

Apologies for this. This issue was raised and is addressed in #12. In short, this has been fixed. Please try installing the dev version from github using:

devtools::install_github("chrisvwn/Rnightlights")

Do post back if you encounter any further issues..

chrisvwn commented 6 years ago

Please update if this fixed your issue so that I can provide farther assistance or close this issue.

chrisvwn commented 6 years ago

Closing this issue. Please reopen if it is not yet resolved.