2017-10-11 6 views
0

J'ai généré des points d'intérêt avec ma base de données avec SQL vers geoJSON.Comment importer des fichiers GeoJSON à utiliser dans Google Earth Engine Code Editor?

GeoJSON:

{ 
    "FeatureCollection" : [ 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.927083, 
        -12.260889 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "626.46" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.916500, 
        -12.255944 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "565.04" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.949417, 
        -12.270361 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "631.47" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.958833, 
        -12.277361 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "591.85" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.942944, 
        -12.249889 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "644.67" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.930917, 
        -12.243611 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "644.67" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.871917, 
        -12.197139 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "574.60" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.866861, 
        -12.206417 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "574.60" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.967389, 
        -12.261889 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "592.50" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.973500, 
        -12.250639 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "592.50" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.962944, 
        -12.245444 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "621.60" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.952667, 
        -12.239778 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "592.50" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.931639, 
        -12.228528 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "574.60" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.908694, 
        -12.247472 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "557.20" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.918667, 
        -12.239139 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "644.50" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.897028, 
        -12.246000 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "557.20" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.906417, 
        -12.230472 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "64.50" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.895750, 
        -12.225028 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "644.50" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.927111, 
        -12.213750 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "564.90" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.917639, 
        -12.208750 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "564.90" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.897833, 
        -12.198444 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "584.00" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.881583, 
        -12.202233 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "574.60" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.876833, 
        -12.235306 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "574.60" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.867278, 
        -12.230306 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "574.60" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.856806, 
        -12.224889 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "574.60" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.861806, 
        -12.215611 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "574.60" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.887833, 
        -12.192806 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "12.60" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.877639, 
        -12.187917 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "564.90" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.941889, 
        -12.234611 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "644.50" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.887111, 
        -12.239889 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "644.50" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.907944, 
        -12.203361 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "591.70" 
      }, 
      "type" : "Feature" 
     }, 
     { 
      "geometry" : { 
       "coordinates" : [ 
        -45.892722, 
        -12.208028 
       ], 
       "type" : "Point" 
      }, 
      "properties" : { 
       "grower" : "foo", 
       "name" : "bar", 
       "radius" : "574.60" 
      }, 
      "type" : "Feature" 
     } 
    ] 
} 

Je voudrais importer ce GeoJSON à mon éditeur de code sur Google Earth Engine. En regardant dans les docs (assets manager), GEE accepte les assets comme images raster, shapefiles (.shp, shx, dbf, prj).

En outre, j'ai trouvé l'importation à la collection de fonctionnalités via des tables de fusion, mais il a toujours besoin de fichiers de formes. J'ai trouvé du geojson dans les conversions de fichiers de formes, même si j'ai besoin d'un moyen d'importer directement mon geojson dans une collection de fonctionnalités sur GEE. Est-ce possible?

+0

Vous ne pouvez pas utiliser l'éditeur de code, mais vous pouvez utiliser l'API Python pour résoudre ce problème. Extrayez les données et créez des objets * ee.Geometry.Point *, faites ce dont vous avez besoin (traitement d'image) et obtenez les résultats. –

+0

Il existe une bibliothèque python que vous recommandez pour gérer GeoJSON? –

Répondre

0

Vous pouvez facilement utiliser OGR pour convertir vos données en un fichier de formes (que vous pouvez ensuite télécharger via l'éditeur de code) ou en KML et le télécharger dans FusionTables. Cependant, votre FeatureCollection n'est pas un GeoJSON valide et vous devrez le corriger en premier. Le préambule devrait ressembler à:

{ 
    "type": "FeatureCollection", 
    "features": [ 
     { 
      "geometry" : { ...