1

I would like to import the Sentinel-2 tiling grid as an asset to Google Earth Engine. This grid is provided as a .kml file on an ESA page: .kml-File

Now, unfortunately, Google has discontinued Fusion Tables which formerly could be used to convert .kml files to FeatureCollections. A straight-forward solution seems to be the offline conversion of the .kml file to a .shp file and upload it then via Google Earth Engine's Asset functionality. Problem is: I cannot transform the .kml file! Drawing inspiration from another thread on here, I tried ogr2ogr -f 'ESRI Shapefile' S2-tiles.shp S2A_OPER_GIP_TILPAR_MPC__20151209T095117_V20150622T000000_21000101T000000_B00.kml, but this just gives the following error message:

ERROR 6: Geometry type of `3D Geometry Collection' not supported in shapefiles.  
Type can be overridden with a layer creation option of SHPT=POINT/ARC/POLYGON/MULTIPOINT/POINTZ/ARCZ/POLYGONZ/MULTIPOINTZ/MULTIPATCH.                                                                                                                                  
ERROR 1: Terminating translation prematurely after failed translation of layer Features (use -skipfailures to skip errors)                                     

Long story short: Is there any (convenient?) way to import .kml files to Google Earth Engine?

Vince
  • 20,017
  • 15
  • 45
  • 64
Michael
  • 1,186
  • 13
  • 29

1 Answers1

1

I think you just need to add -nlt POLYGON to your command.

ogr2ogr -f 'ESRI Shapefile' tiles.shp S2A_OPER_GIP_TILPAR_MPC__20151209T095117_V20150622T000000_21000101T000000_B00.kml -nlt POLYGON
Noel Gorelick
  • 11,405
  • 11
  • 26