AWS Location Service: Where my AWS Community Builders at?

TLDR; I built a map of AWS Community Builders using AWS Location Services. Click here for the map, click here for the code.

I was recently accepted into the AWS Community Builders program and have been blown away by how geographically diverse the …


This content originally appeared on DEV Community and was authored by Jared Donboch

TLDR; I built a map of AWS Community Builders using AWS Location Services. Click here for the map, click here for the code.

I was recently accepted into the AWS Community Builders program and have been blown away by how geographically diverse the group is. The program is split up into different technology-based cohorts--although this is very loose coupling and members are free to join discussions and sessions for any set of technology they are interested in--but there is no location based grouping.

This led to many asking the same question: are there any other AWS Community Builders near me?

The manager of the program, Jason Dunn, agreed to share some anonymized location data with me and I volunteered to draft a quick proof-of-concept map that would display the locations.

I initially implemented this via Google Maps JS API (code can be found here) but with the release of AWS Location Service, I decided it was worth trying to experiment with this new service.

What is Amazon Location Service?

Amazon Location Service is a new set of resources to support maps and location-based use cases such as geocoding, routing, asset/device tracking and geo-fence events.

As of the writing of this, the AWS Location Service has been GA for less than 2 weeks. I look forward to new features and integrations that will inevitably come in the future as the service continues to get some exercise.

Initial Impressions (of Maps and Geocoding)

Here are my initial impressions. I have only really experimented with maps and geocoding to support this simple use case.

The routing, tracking and geofencing components look very interesting but I don't have any direct experience with them yet.

Good: Great integration with other AWS Services

If you are already in the AWS eco-system, using Amazon Location Services will be very easy as you can continue to use the tools and SDKs you are already using. You can control access and security via IAM, automate deployments via CloudFormation, monitor with CloudWatch, be notified of location-based events via Amazon EventBridge, etc.

Good: Creates an abstraction for various location providers.

Amazon currently supports its clients using Esri or HERE data sets and services. When you create Amazon resources for maps, places, etc you choose which provider you want to supply the data. Each provider has their own strengths and weakness but you can now switch easily without needing to integrate with each unique location provider API. As new providers are added, you can continue to leverage the same interface.

Good: Better privacy and security

AWS does not have rights to sell your data or use it for advertising purposes (can Google say that?). They also anonymize all your requests before submitting them to vendors. Any tracking and geofence data is stored only in your AWS account (not 3rd parties) which gives you the power to control and secure that information.

Not so good: Free Tier/Pricing

AWS offers a free tier but it is only a 3-month trial. After 3 months, you are on the hook for your requests based usage. Google Maps free-tier equivalent (free mobile usage and $200 maps credit each month) does not expire and is much more generous. The maps and geocoding prices are competitive with other services but Amazon charges on a per-tile basis when many other providers charge on a per map-load basis. This means if your users are zooming and panning frequently, you will likely be paying more for Amazon Location Services.

This pricing makes Amazon Location Services a little less desirable for individuals, small prototyping efforts, and mobile map applications that are extremely price sensitive as you'll probably end up paying when other providers (i.e. Google) you can do a lot more with their free tier.

I hope that Amazon creates a more permanent free-tier for the mapping service at least.

Not so good: Lacking access controls for anonymous access to public maps.

Amazon Location Services provides an API that can be connected to other map libraries (i.e. MapLibre and Tangram). This is sort of nice but it requires you to use a Cognito Identity Pool with anonymous access enabled if you want to display on a public website. This is well documented in their developer guide but I feel like there are some access-controls lacking as there is no way to lock down your anonymous credentials to a particular IP or HTTP referrer like you can do with Google's API Keys. This means someone could grab the Cognito Identity Pool ID from the Javascript source code in the browser and use it for their own map requests. This seems like a big flaw and hoping some additional Conditional support could be added to IAM policies to better control anonymous access.

Creating the map and geocoding the data

To complete this proof of concept, I needed the following:

Given a list of locations, I needed to 1) geocode the locations to get their latitudes and longitudes and then 2) create a static map webpage to display the locations as markers on a map. Bonus points if we can add some metadata on the markers.

The map

There was not much innovation for the map part of the project and just a quick proof of concept was the goal. It was accomplished by walking through the following sections of the AWS Location Service Developer Guide which is a great resource to get started! :

I also used some MapLibre tutorials below to help create the markers, icons and pop ups on the map:

The geocoding process

We need to create a Place Index resource to support the geocoding.

To do the geocoding and create the GeoJSON that is displayed by the map, I wrote a quick Python script to perform that. This was fairly easy since the geocoding actions have been added to boto3 (i.e. the Python AWS SDK).

Unfortunately, the only location information that we had for Amazon Community Builders was Country. This resulted in many duplicate markers being generated which the mapping library was not happy about. In the end, I adjusted the logic of the geocoding script to create a single point for each country but then add properties to the point that indicated the number of people in that country. This member count property could then be displayed as a pop up on the map when the user hovered over the map marker.

Final Results

To see the final code and the geocoding script, check out the acbmap-aws repo on GitHub. I tried to add more details to that README with the specifics if you want to try and run this locally.

You can find the a hosted version of the AWS Community Builders map, powered by Amazon Location Services, at the following location:

http://acbmap.humbleg.com/aws/


This content originally appeared on DEV Community and was authored by Jared Donboch


Print Share Comment Cite Upload Translate Updates
APA

Jared Donboch | Sciencx (2021-06-11T20:46:06+00:00) AWS Location Service: Where my AWS Community Builders at?. Retrieved from https://www.scien.cx/2021/06/11/aws-location-service-where-my-aws-community-builders-at/

MLA
" » AWS Location Service: Where my AWS Community Builders at?." Jared Donboch | Sciencx - Friday June 11, 2021, https://www.scien.cx/2021/06/11/aws-location-service-where-my-aws-community-builders-at/
HARVARD
Jared Donboch | Sciencx Friday June 11, 2021 » AWS Location Service: Where my AWS Community Builders at?., viewed ,<https://www.scien.cx/2021/06/11/aws-location-service-where-my-aws-community-builders-at/>
VANCOUVER
Jared Donboch | Sciencx - » AWS Location Service: Where my AWS Community Builders at?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/06/11/aws-location-service-where-my-aws-community-builders-at/
CHICAGO
" » AWS Location Service: Where my AWS Community Builders at?." Jared Donboch | Sciencx - Accessed . https://www.scien.cx/2021/06/11/aws-location-service-where-my-aws-community-builders-at/
IEEE
" » AWS Location Service: Where my AWS Community Builders at?." Jared Donboch | Sciencx [Online]. Available: https://www.scien.cx/2021/06/11/aws-location-service-where-my-aws-community-builders-at/. [Accessed: ]
rf:citation
» AWS Location Service: Where my AWS Community Builders at? | Jared Donboch | Sciencx | https://www.scien.cx/2021/06/11/aws-location-service-where-my-aws-community-builders-at/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.