2019-09-17 16:34:47 +02:00
[role="xpack"]
[[indexing-geojson-data-tutorial]]
2020-06-17 16:31:37 +02:00
=== Tutorial: Index GeoJSON data
2019-09-17 16:34:47 +02:00
2019-10-23 15:52:38 +02:00
In this tutorial, you'll build a customized map that shows the flight path between
2019-09-17 16:34:47 +02:00
two airports, and the lightning hot spots on that route. You'll learn to:
* Import GeoJSON files into Kibana
* Index the files in {es}
* Display the data in a multi-layer map
[float]
=== Before you begin
This tutorial requires you to download the following GeoJSON sample data files.
These files are good examples of the types
of vector data that you can upload to Kibana and index in
2020-06-17 16:31:37 +02:00
Elasticsearch for display in Maps.
2019-09-17 16:34:47 +02:00
* https://raw.githubusercontent.com/elastic/examples/master/Maps/Getting%20Started%20Examples/geojson_upload_and_styling/logan_international_airport.geojson[Logan International Airport]
* https://raw.githubusercontent.com/elastic/examples/master/Maps/Getting%20Started%20Examples/geojson_upload_and_styling/bangor_international_airport.geojson[Bangor International Airport]
* https://raw.githubusercontent.com/elastic/examples/master/Maps/Getting%20Started%20Examples/geojson_upload_and_styling/lightning_detected.geojson[Lightning detected]
* https://raw.githubusercontent.com/elastic/examples/master/Maps/Getting%20Started%20Examples/geojson_upload_and_styling/original_flight_path.geojson[Original flight path]
* https://raw.githubusercontent.com/elastic/examples/master/Maps/Getting%20Started%20Examples/geojson_upload_and_styling/modified_flight_path.geojson[Modified flight path]
2019-10-23 15:52:38 +02:00
The data represents two real airports, two fictitious flight routes, and
2019-09-17 16:34:47 +02:00
fictitious lightning reports. You don't need to use all of
these files. Feel free to work with as many files as you'd like, or use valid GeoJSON
files of your own.
[float]
[role="xpack"]
=== Create and set up a map
. <<maps-create, Create a new map>>.
. Zoom in on the New England area in the northeast United States.
+
You're adding flight paths to this area, and this
sets up the map for a good view of the data.
+
[role="screenshot"]
image::maps/images/fu_gs_new_england_map.png[]
[float]
[[upload-and-index-geojson-file]]
=== Upload and index GeoJSON files
For each GeoJSON file you downloaded, complete the following steps:
2020-03-16 15:58:16 +01:00
. Click *Add layer*.
2020-10-19 23:42:15 +02:00
. From the list of layer types, click *Upload GeoJSON*.
2019-09-17 16:34:47 +02:00
. Using the File Picker, upload the GeoJSON file.
+
2019-10-23 15:52:38 +02:00
Depending on the geometry type of your features, this will
2019-09-17 16:34:47 +02:00
auto-populate *Index type* with either {ref}/geo-point.html[geo_point] or
2019-10-23 15:52:38 +02:00
{ref}/geo-shape.html[geo_shape] and *Index name* with
2019-09-17 16:34:47 +02:00
`<file name>`.
2020-04-09 19:42:30 +02:00
. Click *Import file*.
2019-09-17 16:34:47 +02:00
+
You'll see activity as the GeoJSON Upload utility creates a new index
and index pattern for the data set. When the process is complete, you should
receive messages that the creation of the new index and index pattern
2019-10-23 15:52:38 +02:00
were successful.
2019-09-17 16:34:47 +02:00
2020-04-09 19:42:30 +02:00
. Click *Add layer*.
2019-09-17 16:34:47 +02:00
. In *Layer settings*, adjust settings and <<maps-vector-style-properties, properties>> as needed.
. Click *Save & close*.
. Once you've added all of the sample files,
<<maps-save, save your map>>.
+
2019-10-23 15:52:38 +02:00
At this point, you could consider the map complete,
2019-09-17 16:34:47 +02:00
but there are a few additions and tweaks that you can make to tell a
better story with your data.
+
[role="screenshot"]
image::maps/images/fu_gs_flight_paths.png[]
[float]
=== Add a heatmap aggregation layer
Looking at the `Lightning detected` layer, it's clear where lightning has
2019-10-23 15:52:38 +02:00
struck. What's less clear, is if there have been more lightning
strikes in some areas than others, in other words, where the lightning
2019-09-17 16:34:47 +02:00
hot spots are. An advantage of having indexed
2019-10-23 15:52:38 +02:00
{ref}/geo-point.html[geo_point] data for the
lightning strikes is that you can perform aggregations on the data.
2019-09-17 16:34:47 +02:00
2020-03-16 15:58:16 +01:00
. Click *Add layer*.
2020-05-12 18:28:52 +02:00
. From the list of layer types, click *Heat map*.
2019-09-17 16:34:47 +02:00
+
2019-10-23 15:52:38 +02:00
Because you indexed `lightning_detected.geojson` using the index name and
2019-09-17 16:34:47 +02:00
pattern `lightning_detected`, that data is available as a {ref}/geo-point.html[geo_point]
2019-10-23 15:52:38 +02:00
aggregation.
2019-09-17 16:34:47 +02:00
. Select `lightning_detected`.
. Click *Add layer* to add the heat map layer
"Lightning intensity".
+
The remaining default settings are good, but there are a couple of
2019-10-23 15:52:38 +02:00
settings that you might want to change.
2019-09-17 16:34:47 +02:00
. Play around with the *Layer Style* >
2019-10-23 15:52:38 +02:00
*Color range* setting.
2019-09-17 16:34:47 +02:00
+
Again the default looks good, but feel free to choose a
different color range.
. When you're finished modifying settings, click *Save & close*.
+
With your new lightning heat map layer, your map should look
like this:
+
[role="screenshot"]
image::maps/images/fu_gs_lightning_intensity.png[]
[float]
=== Organize the layers
Consider ways you might improve the appearance of the final map.
2019-10-23 15:52:38 +02:00
Small changes in how and when layers are shown can help tell a
2019-09-17 16:34:47 +02:00
better story with your data. Here are a few final tweaks
you might make:
* Update layer names
* Adjust styles for each layer
* Adjust the layer order
2019-10-23 15:52:38 +02:00
* Decide which layers to show at different zoom levels
2019-09-17 16:34:47 +02:00
When you've finished, again be sure to <<maps-save, save your work >>.
Your final map might look like this:
[role="screenshot"]
image::maps/images/fu_gs_final_map.png[]