Error uploading asset to Google Earth Engine - google-earth-engine

I am trying to upload a simple shapefile to my assets in Google Earth Engine (GEE). Since I started studying GEE I found these errors when uploading some .shp files:
"Error: Multiple primary files found."; and
"Error: Could not unzip file."
Both errors happened to the same asset, and also for some other assets.
All .shp and auxiliary files were compressed to .zip
These are the files I got compressed + the .zip file itself:

In a single upload, you must upload exactly one shapefile .shp, and its auxiliary files (.shx, .dbf, .prj, and so on). You cannot upload multiple shapefiles at once.

Related

How to read BUFR files in R

I am trying to read a BUFR binary in R for cyclone track forecasts.
Trying to read the file using rasters since that worked on GRIB files, but are not successful as the files are not recognized.

Problem with R downloading zipped ACS data files

I have been having a problem trying to download a zipped file with American Community Survey (ACS) data. The file is a zipped folder that contains zipped sub-folders within it. I want to download and unzip the file leaving the individual zipped sub-folders. The code I am using is:
ACS.url<-"https://www2.census.gov/programs-surveys/acs/summary_file/2019/data/5_year_entire_sf/Tracts_Block_Groups_Only.zip"
dir<-getwd()
zip.file<-"CTrctACS19.zip"
zip.combine<-as.character(paste(dir,zip.file,sep="/"))
download.file(ACS.url,destfile=zip.combine,mode="wb")
unzip(zip.file)
After running the code I get what appears to be a correct download, but the unzip does not work. I get the following error message:
In unzip(zip.file) : error 1 in extracting from zip file
The downloaded file is only about half of the size zip of the file I am trying to download (the original is 3.7G at Census website but I have about 1.8G) so I think it is not downloading the data correctly. I tried to access the downloaded file with the winzip program and it would not work either. I can download files from that website if they are smaller and don't include zipped subfolders. Any help would be appreciated.

What R command to use to force download files from iCloud

On a mac using iCloud file optimization, large files that are seldom used are uploaded to iCloud and only a small pointer file is left. When I look for the file in Finder, I see the file name and to the left is an icon that indicates that the file is in the cloud. To access the file, I click on the icon and the file is downloaded. With the file.exist command, R returns FALSE for the existence of the file. But after some research I found that the file link is stored in a directory below ~/Library/Mobile\ Documents/com~apple~CloudDocsand the file name is changed to xxx.icloud where xxx is the original file name.
Here's an example of the path to a a directory that holds a .icloud file from a shell in my mac
/Users/gcn/Library/Mobile Documents/com~apple~CloudDocs/Documents/workspace/nutmod/data-raw/NutrientData
I can query for the existence of the file with exists(xxx.icloud). But how do I tell my mac to download the iCloud file and then read it in? Using something like read.table or read.csv doesn't work because the pointer file is not csv.
You can read a csv file directly from a iCloud folder on the Mac by using the path to that folder. Get the path by finding it in the finder. Then right click on the filename at the bottom of the finder window where it shows all the folders leading to the file and choose: Copy "YourFile" as Pathname.
That path will look something like this:
"/Users/NAME/Library/Mobile
Documents/com~apple~CloudDoc/Docs/YourFile.csv"
Use that in your read code:
iCloudDat <- read_csv("/Users/NAME/Library/Mobile Documents/com~apple~CloudDocs/Documents/YourFileName.csv")
That should work.
If the extension isn't .txt or .csv read.table and read.csv won't work.
you have to download the file and extract the tables to a readable format.
you can download the file using download.file() which is is the utils basic library.

Opening .jpg files in R: can you only open JPEG files if the file lies in an R packages?

I noticed that if you are trying to use "system.file()" to source the image for "readJPEG()", then you have to include a package name in order to open the image. But what if I wanted to open a .jpg file from say, my pictures folder? Is this possible? Is R only able to open images using system.file() to source .jpg files?
install jpeg library and load it and then call readJPEG function with the .jpg file.
library('jpeg')
myjpeg_array <- jpeg::readJPEG(source = "myjpeg.jpg")

Read Doc file and file path from Browser

I have an issue that I want to read a DOC file in my system but the condition is
Suppose you are working on browser and download some PDF or DOC file ,then my program should run and get the path of that file and convert that doc file in binary format.
the file download path may be change because some time it download in default folder but some times you saves that file in other locations.
my concern is this that code should execute at download time and should get file path from download history and read that file.

Resources