With Amazon Fast Sight layer maps, now you can plot factors and routes, like retailer areas throughout a metropolis or flights leaving an airport. Geospatial maps assist companies spot patterns which can be tied to location, like how a area is performing or the place clients are concentrated. Amazon Fast Sight helps this with a number of map varieties, together with level maps, crammed maps, and layer maps. When layer maps first launched, you may add a GeoJSON file to attract customized form layers, similar to gross sales territories or districts, and be part of these shapes to a dataset. That dealt with areas and limits effectively, but it surely didn’t cowl the person areas inside them or the routes operating between them.
Layer maps now assist two extra geometry varieties from the identical GeoJSON workflow: Level and LineString. Factors mark particular areas, similar to particular person retailer or facility websites. A LineString traces the route between areas, like a supply path or a flight between airports.
Amazon Fast Sight, the enterprise intelligence (BI) functionality of Amazon Fast, is a unified BI service. It delivers fashionable interactive dashboards, pure language querying, pixel-perfect reviews, machine studying (ML) insights, and embedded analytics at scale. Amazon Fast brings collectively AI brokers for enterprise insights, analysis, and automation in a single built-in expertise, serving to you’re employed smarter and quicker whereas sustaining safety and entry insurance policies.
On this put up, we stroll by means of the dataset and GeoJSON construction that layer maps require. We additionally clarify how factors and contours work in a layer map visible and when to decide on every. Lastly, we cowl superior methods for controlling the viewport, layering geometries, and updating GeoJSON recordsdata programmatically.
Dataset construction concerns
A layer map will get its shapes from a GeoJSON file and its metrics from a Fast Sight dataset, and a shared key joins the 2. The way you construction every one determines what the map can present. This part covers what you want earlier than you begin and the way a GeoJSON file is organized.
Stipulations
The next are the stipulations that you just want earlier than making a layer map in Fast Sight:
- A GeoJSON file describing your geometry.
- A Fast Sight dataset holding the metrics and dimensions.
- A be part of key shared between the Fast Sight dataset and the GeoJSON file.
- The GeoJSON file should be saved in .geojson format, with a most supported file dimension of 100 MB.
Construction of the GeoJSON file
GeoJSON is a JSON-based format for describing geographic options similar to factors and contours.
The construction of the file is as follows:
- FeatureCollection is the entire file. It has a sort of FeatureCollection and a options array.
- Characteristic is a single map factor. It carries a geometry (the form) and a properties object, which holds the be part of key.
- geometry has a sort (Level, LineString, or Polygon) and its coordinates. The coordinates maintain a single [longitude, latitude] place for a Level, and an ordered record of positions for a LineString.
Configuring the Fast Sight dataset and its GeoJSON
In Fast Sight, if you configure a layer in a layer map visible, there are two major settings to contemplate. The primary is the Geometry sort to visualise, which units which geometry from the GeoJSON file renders: Factors, Strains, or Polygons. A layer renders one geometry sort at a time, so when a file mixes varieties just like the previous instance, solely Options of the chosen sort seem on the map. The second is matching the Form file key subject to the Dataset key subject, which hyperlinks every Characteristic within the GeoJSON to a row in your Fast Sight dataset. The sphere names don’t should be an identical, however the values do. The next two examples present this finish to finish, first a LineString layer after which a Level layer.
Instance: LineString layer
Take into account instance knowledge exhibiting a flight from JFK to a vacation spot metropolis like Los Angeles. The GeoJSON construction for a single datapoint is configured as follows:
The corresponding row within the Fast Sight dataset accommodates the next info:
The route_id subject is used to hitch the Fast Sight dataset with the GeoJSON file. The GeoJSON holds one such function per route, and the dataset one row per route. The Geometry sort to visualise is ready to Strains.
Instance: Level layer
Take into account instance knowledge exhibiting a retail retailer location like Lengthy Island Metropolis. The GeoJSON construction for a single datapoint is configured as follows:
The corresponding row within the Fast Sight dataset accommodates the next info:
The store_id subject is used to hitch the Fast Sight dataset with the GeoJSON file. The GeoJSON holds one such function per retailer, and the dataset one row per retailer. The Geometry sort to visualise is ready to Factors.
Strains on layer map visuals
Layer map visuals now assist LineString geometry, connecting an ordered record of coordinates right into a single path. As coated within the knowledge construction part, every route is one function, and its coordinates are the ordered positions the map connects in sequence.
Use traces when the connection between areas is what you need to present, similar to flight paths, supply routes, delivery lanes, or pipeline segments. The visible attracts every path from the coordinates in your GeoJSON file moderately than producing it out of your knowledge at load time. A subject out of your joined dataset can decide the road shade encoding, so you may group routes by no matter that subject represents. Along with shade, you may customise traces with width and opacity controls to regulate visible prominence and readability on the map. The be part of key within the GeoJSON properties object ties every LineString to the dataset row behind its tooltip and shade.
For instance, an airport operations group would possibly map the flights leaving New York (JFK) on a given day. The GeoJSON file holds one LineString per route, keyed by a route ID that joins to the dataset. Every line begins at JFK and ends at its vacation spot, similar to Los Angeles, Chicago, or Miami. The dataset provides the origin, vacation spot, and provider that present up within the tooltip.
Factors on layer map visuals
Amazon Fast Sight presents a local level map visible sort that geocodes location names robotically and refreshes along with your SPICE schedule or Direct Question connection. It helps dynamic level sizing, shade encoding, and level kinds similar to cluster factors and heatmap density gradients. It really works finest with knowledge that adjustments ceaselessly and the place you need the map to answer these adjustments visually.
With the added assist for GeoJSON level layers in layer map visuals, Fast Sight now presents a second level mapping functionality with just a few key variations. Layer map visible factors use a uniform marker dimension and don’t assist geocoding, so that you present specific coordinates within the GeoJSON file. In return, you may management the viewport exactly, locking the map to a precise geographic area, and disabling panning and zooming.
The next desk summarizes the important thing variations:
| Characteristic | Level map | Layer map visible factors |
| Knowledge supply | Latitude/longitude values or geolocation names in your dataset | GeoJSON Level options joined to your dataset by a shared key |
| Geocoding | Acknowledges metropolis, county, state, nation, and postal code robotically | Not out there. Should present specific coordinates within the GeoJSON file |
| Location updates | Mapping updates robotically with SPICE refreshes or Direct Question as location values change | Visible makes use of a static GeoJSON file for level areas. Requires handbook re-upload or API name to replace geometry |
| Viewport | Auto-fits to your knowledge, panning and zooming at all times enabled | Auto-fits by default, can configure if panning and zooming is allowed |
| Look | Dimension and shade may be encoded from the dataset. Level type configuration out there (primary, cluster, heatmap) | Customizable uniform marker dimension, fill opacity, border shade and thickness. Coloration may be encoded from the dataset |
Select layer map visible factors when:
- You require a locked, non-scrollable viewport.
- Your areas are mounted and curated (similar to regional places of work, distribution facilities, retail shops) moderately than altering with every knowledge refresh.
- You intend to mix factors with different geometry varieties (coated within the superior use instances part).
Take into account a retail model whose regional managers use a Fast Sight dashboard to trace retailer efficiency throughout a metro space. The GeoJSON file accommodates a Level function for every retailer with a retailer ID property that joins to the dataset. The dataset holds the metrics (retailer sort, month-to-month income, each day foot site visitors) that drive the tooltip and shade encoding. You place the map on the zoom degree protecting the metro space, then disable map navigation so the map renders at a constant view on each load. Managers can’t unintentionally zoom out to a nationwide or international view.
Superior use instances
The earlier sections cowl a regular layer map setup. Use the next methods if you want extra management over what readers see, need to mix geometry varieties in a single view, or want geometry that adjustments over time.
Controlling the viewport
When that you must management the viewport in layer map visuals, you may pan and zoom to the view you need manually. Then disable map navigation to lock it in place. To be used instances the place you want extra exact boundaries or programmatic management, you may set the precise viewport coordinates by means of the visible definition utilizing the Fast Sight APIs.
The layer map visible shops its viewport configuration within the MapState property inside ChartConfiguration. This property accepts two fields:
- Bounds: The geographic coordinates defining the minimal seen space (North, South, East, West).
- MapNavigation:
ENABLEDorDISABLEDto manage whether or not readers can pan and zoom.
Though the bounds property just isn’t uncovered on the console, you may set these bounds when working with the dashboard definition JSON for programmatic asset administration. For instance, to outline the bounds, modify the MapState block within the visible definition, then name the CreateDashboard or UpdateDashboard APIs.
The bounds outline the minimal space that’s assured to be seen. The map zooms to verify this complete space matches throughout the visible container. For the tightest match with minimal additional area added to the map, match the side ratio of your bounds to the form of your visible container.
Layering geometries
To be used instances that require combining a number of geometry varieties right into a single view, you may layer visuals on prime of one another. For instance, the next screenshot demonstrates plotting buyer areas as factors inside US regional boundaries outlined by polygons. This composition reveals which territories have the very best buyer density and can be utilized to correlate with different metrics current within the dataset like efficiency.
This second instance demonstrates combining factors as stops alongside a supply route path. The LineString attracts the deliberate route, and Level options mark every scheduled cease alongside the best way.
To layer geometries, you stack a number of layer map visuals on prime of one another, following these steps:
- Use free-form structure: Change the sheet structure setting to free-form in order that visuals can overlap and stack.
- Create two layer map visuals: Create the 2 layer map visuals that you just mix right into a single view, similar to one utilizing a Level GeoJSON file and one utilizing a LineString GeoJSON file.
- Use matching bounds: Utilizing the method beforehand described for controlling the viewport, confirm all layer map visuals use an identical bounds to have the identical underlying map view.
- Disable panning and zooming: For every layer map visible, disable the panning and zooming underneath Map choices in order that alignment stays the identical.
- Cover the bottom map and background on higher layer: Set the higher visible’s background to hidden underneath Show settings and disable the bottom map underneath Map choices.
- Stack the visuals: Transfer the highest visible on prime of the bottom layer utilizing drag-and-drop or by matching exact dimension and place coordinates underneath Show settings.
Layer ordering follows the visible stacking order within the free-form structure. To alter a visible’s place within the stack, select the menu icon (three dots) on the visible, then select Ship backward or Carry ahead. Readers can entry the tooltip of the topmost visible, so place the layer that readers want particulars from on prime. Every sheet helps as much as 5 layer map visuals.
Dynamically updating GeoJSON
In contrast to different Fast Sight visuals the place knowledge refreshes by means of SPICE or Direct Question, layer map geometry lives within the GeoJSON file itself. When your dataset refreshes on schedule, the metrics replace (for instance, colours change and tooltip values refresh), however the geometry stays at its unique place.
To replace what seems on the map, like a brand new route, new level areas, or up to date boundaries, that you must replace the GeoJSON file and republish the dashboard. You’ll be able to change a GeoJSON file manually by means of the Fast Sight console by enhancing the layer map visible throughout the Evaluation and importing a brand new file. This works for rare adjustments similar to updating territory boundaries quarterly or including a brand new retailer location.
For automated, on-demand, or dynamic updates, the method entails Amazon Easy Storage Service (Amazon S3) and the Fast Sight APIs outlined within the following steps:
- Add the brand new GeoJSON to Amazon S3: Generate your up to date geometry and reserve it to an Amazon S3 bucket. Customized options can use different AWS companies similar to Amazon Location Service to create the GeoJSON recordsdata.
- Reference the file on the dashboard definition: The dashboard definition accommodates a StaticFiles array with a
SpatialStaticFileentry for every GeoJSON file. Modify the file reference to the S3 location of your up to date file entry for every GeoJSON file. - Name the UpdateDashboard API: Submit the up to date definition with the brand new file reference utilizing the UpdateDashboard API.
- Name the UpdateDashboardPublishedVersion API: Publish the change so it’s seen to dashboard readers with the UpdateDashboardPublishedVersion API.
The next instance makes use of this sample to assist on-demand map updates in an embedded dashboard to generate optimum routes between areas and waypoints. Though outdoors the scope of this put up, this represents a sophisticated use case that mixes every of the previous approaches.
Conclusion
On this put up, we confirmed tips on how to use Level and LineString geometry in Amazon Fast Sight layer maps to plot particular areas and the routes between them. We coated the GeoJSON construction and dataset be part of that layer maps require, and in contrast layer map factors with the native level map. We additionally walked by means of superior methods for controlling the viewport, layering separate visuals into one view, and refreshing GeoJSON recordsdata with Amazon S3 and the Fast Sight APIs.
To study extra about layered maps, discuss with the Amazon Fast Sight layered maps documentation. Go to the Amazon Fast Neighborhood to attach with friends and keep up to date on the latest options and sources.
In regards to the authors










