2

I have a GeoJSON file. I have opened it in Sublime Text Editor

How can I import it in Google Earth Engine?

3

You should be able to import GeoJSON geometry objects directly.

Here is an example of a MultiPolygon:

feature_geometry =
{
'type': 'MultiPolygon',
'coordinates': [[[
    [-90, 24],
    [-90.001, 40],
    [-90.001, 39.001],
    [-90, 31.001],
    [-90, 27]
]]]
}

Also, as mentioned in the comments, you can directly convert geojson into a shapefile using qgis or ogr then import into GEE.

  • No, I am having a file with so much data like wards for a corporation/city. I found a way to directly convert geojson into .shp using qgis and then importing into GEE. I am looking for an easier way. – Prasad Thota Oct 31 '18 at 15:43
  • 1
    An easier way may be a python script to perform the task through automation. That's what comes to my mind for this in the case you are looking to make it "easier" – whyzar Oct 31 '18 at 15:54
  • 2
    How much easier can it get, than 1 conversion followed by 1 upload? You can paste the complete content of the GeoJSON into the code editor, like this answer suggests, but if you have a large file that is bound to crash your browser. – Kersten Oct 31 '18 at 16:26
  • Actually, I have asked the question before I did find the way :) – Prasad Thota Oct 31 '18 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.