I have 100 comma separated longitude and latitude values in a text file. I want to mark all these 100 points on GEE maps and see where they lie. This is the script I am using for marking the point:

var point1 = ee.Geometry.Point([x, y]);
Map.addLayer(point1, {color: 'cyan'}, 'geodesic polygon');

where x and y are longitude and latitude values respectively. I followed this link with a similar query but here the answer suggests to get the json text using print(geometry) but my problem is that I have generated these 100 points through a Matlab code (instead of generating them directly on GEE) according to some analysis so I don't possibly have a JSON data for them. Thus I need wanted to know how can I import these points from a local text file and work with them on GEE?

  • 1
    Why not just convert your csv to json externally? csvjson.com/csv2json – HDunn May 29 '19 at 13:43
  • Or export them as a shapefile and load them as an (Table) asset. Any GIS can do this. – Jon May 29 '19 at 13:49
  • You are probalby fine with comma seperated lists using: ee.Geometry.MultiPoint(coords, proj) link. Could you show an example of ~10 points using a EarthEngine link? – Kuik May 29 '19 at 13:55
  • @Kuik I'm sorry but I don't know how to import these points from my local file on code.editor in the first place. – Prachi May 29 '19 at 14:03
  • @Jon to export them as a shapefile I again need to read these points from my local text file to code.editor. – Prachi May 29 '19 at 14:04

I solved it after suggestions in the comment. I exported it as a shapefile using QGIS and then imported it as a table.

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.