|
| 1 | +.. _scatter-ref: |
| 2 | +.. _geospatial-scatter-type: |
| 3 | +.. _geo-spatial: |
| 4 | + |
| 5 | +================== |
| 6 | +Geospatial Scatter |
| 7 | +================== |
| 8 | + |
| 9 | +.. default-domain:: mongodb |
| 10 | + |
| 11 | +.. contents:: On this page |
| 12 | + :local: |
| 13 | + :backlinks: none |
| 14 | + :depth: 1 |
| 15 | + :class: singlecol |
| 16 | + |
| 17 | +Overview |
| 18 | +-------- |
| 19 | + |
| 20 | +Geospatial scatter charts distribute data from a data source across geographical locations, |
| 21 | +and, optionally, color the data points based on the database field of your choice and scale |
| 22 | +the size of data points. The sample images in the next section demonstrate |
| 23 | +how to construct a geospatial scatter chart to locate the nighborhoods in NYC with the most rooms available |
| 24 | +at a specified price. |
| 25 | + |
| 26 | +Encoding Channels |
| 27 | +----------------- |
| 28 | + |
| 29 | +Geospatial scatter charts use the :guilabel:`Coordinates`, :guilabel:`Color` |
| 30 | +and :guilabel:`Size` encoding channels. See :doc:`Geospatial Customization Options </customize-charts/geospatial-customization>` |
| 31 | +for additional options for customizing your geospatial charts. |
| 32 | + |
| 33 | +Coordinates |
| 34 | +~~~~~~~~~~~ |
| 35 | + |
| 36 | +The :guilabel:`Coordinates` encoding channel defines the map |
| 37 | +area of geospatial charts. The image below distributes all of the instances |
| 38 | +of the ``location`` geopoint in the `Sample AirBnB Listings Dataset <https://docs.atlas.mongodb.com/sample-data/sample-airbnb>`_. |
| 39 | +However, all of the circles are green and the same size since we have |
| 40 | +not yet specified fields for the :guilabel:`Size` and :guilabel:`Color` |
| 41 | +encoding channels. |
| 42 | + |
| 43 | +.. note:: |
| 44 | + |
| 45 | + |service| provides `several sample data sets <https://docs.atlas.mongodb.com/sample-data/available-sample-datasets/>`_ |
| 46 | + for download. |
| 47 | + |
| 48 | +See the :ref:`Geopoint <geopoint-channel>` reference |
| 49 | +page for more information about what types of data you can use in this |
| 50 | +channel. |
| 51 | + |
| 52 | +.. figure:: /images/charts/geospatial-scatter-coordinates-example.png |
| 53 | + |
| 54 | +Color |
| 55 | +~~~~~ |
| 56 | + |
| 57 | +(*Optional*) The :guilabel:`Color` encoding channel changes the color of the data points to |
| 58 | +categorize the displayed geopoints by the value of the selected collection field. |charts| lists |
| 59 | +the colors used in a key to the right of the chart. In the image below, the ``property_type`` |
| 60 | +distributes the property types in NYC by color. The key to the right of the chart indicates |
| 61 | +green for guest suites and dark blue for apartments, for example. |
| 62 | +However, all of the circles are still the same size since we have |
| 63 | +not yet specified a field for the :guilabel:`Size` encoding channel. |
| 64 | + |
| 65 | +.. figure:: /images/charts/geospatial-scatter-color-example.png |
| 66 | + |
| 67 | +Size |
| 68 | +~~~~ |
| 69 | + |
| 70 | +(*Optional*) The :guilabel:`Size` aggregation encoding channel changes the size of the |
| 71 | +data point markers, with larger sizes indicating larger aggregated values. The image below |
| 72 | +uses the mean of the ``weekly_price`` collection field to aggregate all instances of the geopoint that you |
| 73 | +chose for the :guilabel:`Coordinates` encoding channel. The key to right of the chart |
| 74 | +indicates the aggregation value for the different circle sizes. |
| 75 | + |
| 76 | +.. figure:: /images/charts/geospatial-scatter-size-example.png |
| 77 | + |
| 78 | +.. note:: |
| 79 | + |
| 80 | + If no fields are encoded in the :guilabel:`Size` encoding channel, |charts-short| displays all points with the same size. |
| 81 | + |
| 82 | + |
| 83 | +Limitations |
| 84 | +----------- |
| 85 | + |
| 86 | +The maximum query response size for Scatter charts is 1000 documents. |
| 87 | + |
| 88 | +Build a Geospatial Scatter Chart |
| 89 | +-------------------------------- |
| 90 | + |
| 91 | +To create a geospatial scatter chart: |
| 92 | + |
| 93 | +1. On the :guilabel:`Chart Builder`, select :guilabel:`Geospatial` from |
| 94 | + the :guilabel:`Chart Type` list. |
| 95 | + |
| 96 | +#. Select :guilabel:`Scatter` from the three available geospatial |
| 97 | + chart types. |
| 98 | + |
| 99 | +#. Choose the data source for your chart from the :guilabel:`Data Source` list. |
| 100 | + |
| 101 | + .. note:: See :ref:`Add a Data Source <add-data-source>` if you have not yet defined a data source for your charts. |
| 102 | + |
| 103 | +#. Drag a geopoint field from :guilabel:`Fields` to the :guilabel:`Coordinates` |
| 104 | + encoding channel. |
| 105 | + |
| 106 | + |charts| distributes the data from your MongoDB collection based |
| 107 | + on the values of the selected geopoint field. |
| 108 | + |
| 109 | +#. (*Optional*) Drag another collection field from the :guilabel:`Fields` to the :guilabel:`Color` |
| 110 | + encoding channel. |
| 111 | + |
| 112 | + |charts| colors the data points according to your selection. |
| 113 | + |
| 114 | +#. (*Optional*) Drag another collection field to the :guilabel:`Size` |
| 115 | + encoding channel. |
| 116 | + |
| 117 | + |charts| aggregates document fields with matching values in the data source. |
| 118 | + |
| 119 | +#. Click the pencil icon above the chart to give it name. |
| 120 | + |
| 121 | +#. Click :guilabel:`Save and Close`. |
0 commit comments