Skip to main content
Astrato Map
Piers Batchelor avatar
Written by Piers Batchelor
Updated this week

Contents:



Preparing geo data

Our map supports multiple input formats for geo data. See the table below to learn what is supported.

Type

Example

Format

SQL (tested in Snowflake)

Geocode

[48.5701099999999997 , 34.7904899999999984]

[longitude, latitude]

SELECT
CONCAT('[', longitude, ',', latitude, ']') as GEOCODE
FROM MY_TABLE;

Longitude & Latitude

48.5701099999999997

34.7904899999999984

ℹ 1 field for each

SELECT
longitude, latitude
FROM MY_TABLE;

9q9j8ue2v71y5zzy0s4q

Hash

SELECT ST_GEOHASH( TO_GEOGRAPHY('POINT(-122.306100 37.554162)')) AS geohash_of_point_a;

Geography

-

GEJSON

-


❄️ Creating & Storing Geo Data in Snowflake

The file below can be imported into Snowflake to be used with our map object.

Query used to extract data - be mindful of datatypes - the last type is geography.


SELECT
feature.value:properties:sovereignt::STRING AS sovereign_country,
feature.value:properties:admin::STRING AS admin_name,
feature.value:properties:iso_a3::STRING AS iso_code,
feature.value:properties:pop_est::INT AS population_estimate,
feature.value:properties:gdp_md::INT AS gdp_in_millions,
TRY_TO_GEOMETRY(feature.value:geometry) AS geography
FROM
TBL_GEOJSON,
LATERAL FLATTEN(input => TBL_GEOJSON.geo_data:features) feature
;


Configuring the map

Property

Function / Purpose

Dimension

(tooltip value)

Presented in the tooltip, this is what we use to group by when querying your data.

Location type

This is the location we use. This is an aggregation, for example with latitude/longiutude we can use min/max/average, which helps when working with different grains of location data.

Size

Pixels

Point size can be fixed, where the point size remains the same regardless of screen size. This can be variable based on using a measure.

Distance

Dynamic sizing, which will adjust as you zoom in and out of the map. For example, a point can be 5 km wide. This can be variable based on using a measure. This mode is responsive to zoom level.

Layers

Our map supports multiple layers to help you visualize your data in multiple ways simultaneously.

Point Layer

The point layer draws points for a given event or object based on its location coordinates: longitude and latitude. Point layers are specially used for displaying data with a wide distribution of geographic information & help you be precise and rapidly position your point events on a map.

  • Point Layer Settings

    • Data Tab

      • Name- The name of the layer, this setting only appears in editing mode

      • Dimension- the unique identity for the layer; this value will appear in the layer tooltip.

      • Location type- This is the location we use. This is an aggregation; for example, with latitude/longitude, we can use min/max/average, which helps when working with different grains of location data.
        The options are

        • Latitude\Longitude- requires two inputs

        • Geo-point- one input, a geography-type field

        • Geo-hash- one input a geohash type field.

      • Size by-

        • Pixels

          Point size can be fixed, where the point size remains the same regardless of screen size. This can be variable based on using a measure.

        • Distance

          Dynamic sizing, which will adjust as you zoom in and out of the map. For example, a point can be 5 km wide. This can be variable based on using a measure. This mode is responsive to zoom level.

      • Size-
        Fix- set the size in the selected unit, either pixels or kilometers.
        Measure- set the measure to use for setting the size of the points.

        • Measure format- set how the measure value will appear in the tooltip

        • Size range- set the method to calculate the size of each point.

          • Auto- will set the size between the min and the max values of the points

          • Custom- set the range min and max values manually.

      • Show conditionally-
        Set the zoom level so the layer will be displayed; the higher value means a more detailed display.

      • Limiting-

        • Visualization- set the number of points to be drawn on the map; by default, the value is 1000.

        • Export- set the number of points to be drawn when exporting the map; by default, the value is 100000.

    • Style Tab

      • Shape- set the point shape representation on the map.

      • Color-

        • Single- set the color of all points.

        • Categorical- set the color of each point in its defined color according to the categorical color palette.

        • Gradient- set the color of points according to a measured value.

      • Conditional coloring- define a rule for coloring specific points according to their dimension value.

Cluster

Cluster maps are a great tool for determining how many data points are located in a specific region. I
The cluster display is part of the point layer. The cluster setting is in the grouping sector in the properties panel.

The layer properties define the cluster's coloring and size, as displayed in the image below.

Heat map

A heatmap indicates the weight of each point in a geographical range. It can show the distribution or density variation of any phenomenon across a geographical area.

The settings for the heat can be defined in the properties panel as displayed in the image below.

  • Visuals adjust dynamically with zoom levels and data point densities.

  • Customize color gradients and intensity based on data values.

Filtering is not possible in this layer. Please refer to the point layer for use with filtering.

  • Heatmap settings

    • Data Tab

      • Name- The name of the layer, this setting only appears in editing mode

      • Dimension- the unique identity for the layer; this value will appear in the layer tooltip.

      • Location type- This is the location we use. This is an aggregation; for example, with latitude/longitude, we can use min/max/average, which helps when working with different grains of location data.
        The options are

        • Latitude\Longitude- requires two inputs

        • Geo-point- one input, a geography-type field

        • Geo-hash- one input a geohash type field.

      • Heat

        • Value by- set the method to calculate the heatmap.

          • Fixed- heatmap is calculated by the count of entities in the area.

            • Intensity- set the color intensity to a lower value that is less intense.

            • Detail level- The higher the detail level, the less area the coloring will cover.

          • Measure- the heatmap is calculated by the measured value in each area.

            • Value range- select between Fixed and Auto.

            • Detail level- The higher the detail level, the less area the coloring will cover.

        • Re-draw heatmap on zoom- when the user zooms in and out, the heatmap is redrawn according to the map's visible area.

        • Coverage- define the coverage area of each point. The higher the value, the more area is covered by each point.

        • Blend- define the intensity of the color blend.

        • Ranges- an option to set the map coloring by defining the range either by percent from the center or by the value of the area.

      • Show conditionally-
        Set the zoom level so the layer will be displayed; the higher value means a more detailed display.

      • Limiting-

        • Visualization- set the number of points to be drawn on the map; by default, the value is 1000.

        • Export- set the number of points to be drawn when exporting the map; by default, the value is 100000.

Shape (Polygon Layer)

Polygon maps are best used to show the distribution of some features in different regions. They can be used to map the number of taxpayers in a particular region or to show the sales figures in a particular city. They can also be used to depict employment/unemployment levels in a particular area.

Polygon maps work with Geography type columns.

When using a large number of polygons, it's recommended to enable the simplified future that reduces the level of details for each polygon and improve performance

  • Shape Layer Settings

    • Data Tab

      • Name- The name of the layer, this setting only appears in editing mode

      • Dimension- the unique identity for the layer; this value will appear in the layer tooltip.

      • Geography- set the field that contains the polygon definitions. Geography is the only supported field type.

      • Simplified- The Simplified function reduces the level of detail on the polygon border and the amount of data needed to draw the polygon.

      • Tolerance- set the number of simplified meters; the higher the value, the more simplified the layer.

        Given an input GEOGRAPHY or GEOMETRY object that represents a Line or Polygon, returns a simpler approximation of the object. The function identifies and removes selected vertices, resulting in a similar object that has fewer vertices.For example, if the input object is a Polygon with 50 vertices, ST_SIMPLIFY can return a simpler Polygon with only 20 of those vertices.When simplifying an object, the function removes a vertex only if the distance between that vertex and the edge resulting from the removal of that vertex is within the specified tolerance.

      • The image below shows a layer when simplified, is disabled.

      • This is the same image when simplified is enabled with a tolerance of 2500

      • It's recommended that tolerance be used to improve the map's performance.

      • Show conditionally-
        Set the zoom level so the layer will be displayed; the higher value means a more detailed display.

Map

This layer controls the map settings, such as opacity.

Image

A custom image can layer your maps or markers onto the map, such as roads, paths, map updates, topography, etc.


  • Image Layer Settings

    • Data Tab

      • Name- The name of the layer. This setting only appears in edit mode

      • Image Source- the source of the image.

        • From Gallery- The image is uploaded to Astrato Gallery, either workbook or tenant. This is the most performant method.

        • URL Link- The image is hosted in a web bucket.

        • From Variable- The Image URL is stored in an astrato variable, which allows for changing the image dynamically according to users' interactions.

      • Position- set the coordinates for the top left corner and the bottom right for the image, the coordinates should be set according to the coordinates of other layers.

Known limitations

  • Global filtering is not yet supported in the map

  • Fixed point size can produce varying point sizes based on map projection

Did this answer your question?