I would like to use supervised classification for crop mapping in national scale .i have many shp files as training data how can use this file in google earth engine (GEE).
You can use the Asset Manager or command line interface (CLI) to upload datasets in the Shapefile or CSV format. (See Importing Raster Data for details on importing rasters using the Code Editor or CLI.) Your uploaded assets are initially private, but can be shared as described in the Sharing Assets Section.
Upload a Shapefile
To upload a Shapefile from the Code Editor, click the 📷 button, then select Shape files under the Table Upload section. An upload dialog similar to Figure 1 will be presented. Click the SELECT button and navigate to a Shapefile or Zip archive containing a Shapefile on your local file system. When selecting a .shp file, be sure to select the related .dbf, .shx and .prj files. Earth Engine will default to WGS84 (longitude, latitude) coordinates if a .prj file is not provided. If you are uploading a Zip archive, make sure it contains only one Shapefile (set of .shp, .dbf, .shx, .prj, etc.) and no duplicate filenames. Make sure filenames do not include additional periods or dots. (Filenames will include a single period before the extension.)Give the table an appropriate asset ID (which doesn't already exist) in your user folder. Click UPLOAD to start the upload.
📷Figure 1. The Asset Manager Shapefile upload dialog. Note that the .shp, .dbf, and .shx files are required. The other sidecar files are optional. If the .prj file is not provided, WGS84 is assumed.
Upload a CSV file
To upload a CSV from the Code Editor, activate the Assets tab, then click the 📷 button and select CSV file under the Table Upload section. An upload dialog similar to Figure 2 will be presented. Click the SELECT button and navigate to a .csv file on your local file system. Give the table a unique, relevant asset ID name. Click OK to start the upload.
📷Figure 2. The Asset Manager CSV file upload dialog.
The CSV file should contain a row for each feature and as many columns as there are properties or variables for the feature set. If features are geospatial, they must have a geolocation defined by either a geometry string (GeoJSON, WKT) or x and y position properties. If the CSV file is an export from a GIS or geospatial data tool such as GDAL/OGR, a properly formatted and named geometry column should already exist. Alternatively, two columns for x and y coordinates representing point locations can be defined in a spreadsheet application and exported as CSV format along with any other variables.In the Advanced options section of the upload dialog, view and change default settings. Get information about each parameter by hovering your cursor over the question mark symbol following parameter names.Earth Engine will attempt to detect a primary geometry column and assumes the data projection is WGS84 unless otherwise specified. The geodesic state of the geometries are determined by the default edge interpretation of the given projection (e.g. WGS84 uses geodesic geometries), but this can be overridden in the Advanced settings menu. If the geometry of your data are points defined by x and y columns, be sure to name the respective columns "longitude" and "latitude" or specify the x and y column names under Advanced settings.Note: Mixed datatype columns (e.g. numbers and strings) will default to string upon ingestion. This is an important consideration when preparing a table in a spreadsheet application, where it is common to denote missing data as NA, Null, None, --, etc. In the case of missing data, leave the "cell" empty.
Tracking upload progress
After starting a table upload, an 'Asset ingestion' task is added to the Task Manager, found under the Tasks tab at the right side of the Code Editor. Check the upload status by clicking on the ? icon that appears when hovering over the task. To cancel an upload, click on the spinning icon 📷 next to the task. Once the ingestion is complete, the task cell will turn blue and the asset will appear in your user folder under the Assets tab with a table_chart icon.
Loading a table asset to your script
To create a FeatureCollection in your script from a table asset, import it as described on the Managing Assets page.source: https://developers.google.com/earth-engine/importing
I select and upload shp file and import CLI. How can I use this file for supervised classification? In shp file i have difernt ID name but in result of classification observed only one class.
I am facing the same problem. I have taken many ground truth data and imported as a shapefiles in the GEE for crop mapping. I have merged the data according to the class and declare each class as a FeatureCollection. However I am not able to apply any supervised classification technique (SVM, CART) to the data. Did you get the answer or found any resources related to it?
for simplicity, upload a shapefile per class, then import each as FeatureCollection, add a property name (should the same for each collection/shapefile) and define every class with a specific number, starting from 0 to "number of classes you have".
You can upload the different feature classes in the asset section in GEE in the way as suggested by Omid Vakili. Thereafter, the features can be merged by using .merge function in GEE to prepare the feature collection at the national level for supervised classification. For instance:
var features = x.merge(y).merge(z)
where x,y, and z will indicate the feature classes