Add Data Is Broken?

I am at http://localhost:5601/app/home#/tutorial_directory

Specifically Add Data / Upload File.

When I Upload my newline delimited JSON file, it is correctly formatted as ndjson.

HOWEVER THERE ARE ABSOLUTELY NO ITEMS FOUND AND NO FILE STATS APPEARING. When I try to import it just goes to a white screen!?

{"properties": {"fid": 1, "searchable_site": "Site Name etc"}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[coordinates etc......]]]]}}

File Uploader expects a flat object but you are uploading a sequential GeoJSON file that contains features where properties are a full object. Each line is like this:

{
"type": "Feature",
"geometry": ...
  "properties": {
    "prop1": "val1",
    "prop2": "val2",
    ....
  }
}

And you'd need to convert them into something like:

{
  "geometry": ...,
  "prop1": "val1",
  "prop2": "val2",
  ....
}

Still, I could not make it work for a polygon dataset, getting this error that tells me that the tool could not understand the geometry object.

Your best option is to convert your sequential GeoJSON into a normal GeoJSON file and if it's below 100MB, you should be able to upload it using The Maps App. You can find a tutorial on how the tool works here.

To convert the sequential GeoJSON you can use the geojson2ndjson. I've tested it with a multipolygon dataset successfully.

ndjson2geojson /tmp/countries.seq.geo.json > /tmp/countries.geo.json

If your output JSON file is larger than 100MB then maybe you can consider using GDAL to upload your dataset to Elasticsearch.

Hope it helps.

1 Like

Sorry I missed one thing. You can change the file upload 100MB limit with this setting fileUpload:maxFileSize.

(thanks @Nathan_Reese for the tip)

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.