Skip to content

Commit c4ac25d

Browse files
author
awstools
committed
feat(client-location): Amazon Location Service now allows circular geofences in BatchPutGeofence, PutGeofence, and GetGeofence APIs.
1 parent 928a5b6 commit c4ac25d

File tree

7 files changed

+139
-26
lines changed

7 files changed

+139
-26
lines changed

clients/client-location/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
AWS SDK for JavaScript Location Client for Node.js, Browser and React Native.
1111

12-
Suite of geospatial services including Maps, Places, Routes, Tracking, and Geofencing
12+
<p>"Suite of geospatial services including Maps, Places, Routes, Tracking, and Geofencing"</p>
1313

1414
## Installing
1515

clients/client-location/src/Location.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ import {
228228
import { LocationClient } from "./LocationClient";
229229

230230
/**
231-
* Suite of geospatial services including Maps, Places, Routes, Tracking, and Geofencing
231+
* <p>"Suite of geospatial services including Maps, Places, Routes, Tracking, and Geofencing"</p>
232232
*/
233233
export class Location extends LocationClient {
234234
/**
@@ -540,6 +540,10 @@ export class Location extends LocationClient {
540540
* the routes. This also lets you specify additional route preferences in
541541
* <code>CarModeOptions</code> if traveling by <code>Car</code>, or
542542
* <code>TruckModeOptions</code> if traveling by <code>Truck</code>.</p>
543+
* <note>
544+
* <p>If you specify <code>walking</code> for the travel mode and your data
545+
* provider is Esri, the start and destination must be within 40km.</p>
546+
* </note>
543547
* </li>
544548
* </ul>
545549
*/

clients/client-location/src/LocationClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ type LocationClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHand
447447
export interface LocationClientResolvedConfig extends LocationClientResolvedConfigType {}
448448

449449
/**
450-
* Suite of geospatial services including Maps, Places, Routes, Tracking, and Geofencing
450+
* <p>"Suite of geospatial services including Maps, Places, Routes, Tracking, and Geofencing"</p>
451451
*/
452452
export class LocationClient extends __Client<
453453
__HttpHandlerOptions,

clients/client-location/src/commands/CalculateRouteCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ export interface CalculateRouteCommandOutput extends CalculateRouteResponse, __M
5656
* the routes. This also lets you specify additional route preferences in
5757
* <code>CarModeOptions</code> if traveling by <code>Car</code>, or
5858
* <code>TruckModeOptions</code> if traveling by <code>Truck</code>.</p>
59+
* <note>
60+
* <p>If you specify <code>walking</code> for the travel mode and your data
61+
* provider is Esri, the start and destination must be within 40km.</p>
62+
* </note>
5963
* </li>
6064
* </ul>
6165
* @example

clients/client-location/src/models/models_0.ts

Lines changed: 68 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,27 @@ export interface BatchGetDevicePositionResponse {
490490
DevicePositions: DevicePosition[] | undefined;
491491
}
492492

493+
/**
494+
* <p>A circle on the earth, as defined by a center point and a radius.</p>
495+
*/
496+
export interface Circle {
497+
/**
498+
* <p>A single point geometry, specifying the center of the circle, using <a href="https://gisgeography.com/wgs84-world-geodetic-system/">WGS 84</a>
499+
* coordinates, in the form <code>[longitude, latitude]</code>.</p>
500+
*/
501+
Center: number[] | undefined;
502+
503+
/**
504+
* <p>The radius of the circle in meters. Must be greater than zero and no
505+
* larger than 100,000 (100 kilometers).</p>
506+
*/
507+
Radius: number | undefined;
508+
}
509+
493510
/**
494511
* <p>Contains the geofence geometry details.</p>
512+
* <p>A geofence geometry is made up of either a polygon or a circle. Can be either a
513+
* polygon or a circle. Including both will return a validation error.</p>
495514
* <note>
496515
* <p>Amazon Location doesn't currently support polygons with holes, multipolygons, polygons
497516
* that are wound clockwise, or that cross the antimeridian. </p>
@@ -507,8 +526,14 @@ export interface GeofenceGeometry {
507526
* list their vertices in counter-clockwise order around the ring's center, where the left
508527
* side is the polygon's exterior. Inner rings must list their vertices in clockwise order,
509528
* where the left side is the polygon's interior.</p>
529+
* <p>A geofence polygon can consist of between 4 and 1,000 vertices.</p>
510530
*/
511531
Polygon?: number[][][];
532+
533+
/**
534+
* <p>A circle on the earth, as defined by a center point and a radius.</p>
535+
*/
536+
Circle?: Circle;
512537
}
513538

514539
/**
@@ -521,9 +546,11 @@ export interface BatchPutGeofenceRequestEntry {
521546
GeofenceId: string | undefined;
522547

523548
/**
524-
* <p>Contains the polygon details to specify the position of the geofence.</p>
549+
* <p>Contains the details of the position of the geofence. Can be either a
550+
* polygon or a circle. Including both will return a validation error.</p>
525551
* <note>
526-
* <p>Each <a href="https://docs.aws.amazon.com/location-geofences/latest/APIReference/API_GeofenceGeometry.html">geofence polygon</a> can have a maximum of 1,000 vertices.</p>
552+
* <p>Each <a href="https://docs.aws.amazon.com/location-geofences/latest/APIReference/API_GeofenceGeometry.html">
553+
* geofence polygon</a> can have a maximum of 1,000 vertices.</p>
527554
* </note>
528555
*/
529556
Geometry: GeofenceGeometry | undefined;
@@ -679,6 +706,11 @@ export interface TruckDimensions {
679706
* <p>For example, <code>15.5</code>.</p>
680707
* </li>
681708
* </ul>
709+
* <note>
710+
* <p>
711+
* For routes calculated with a HERE resource, this value must be between 0 and 300 meters.
712+
* </p>
713+
* </note>
682714
*/
683715
Length?: number;
684716

@@ -689,6 +721,11 @@ export interface TruckDimensions {
689721
* <p>For example, <code>4.5</code>.</p>
690722
* </li>
691723
* </ul>
724+
* <note>
725+
* <p>
726+
* For routes calculated with a HERE resource, this value must be between 0 and 50 meters.
727+
* </p>
728+
* </note>
692729
*/
693730
Height?: number;
694731

@@ -699,6 +736,11 @@ export interface TruckDimensions {
699736
* <p>For example, <code>4.5</code>.</p>
700737
* </li>
701738
* </ul>
739+
* <note>
740+
* <p>
741+
* For routes calculated with a HERE resource, this value must be between 0 and 50 meters.
742+
* </p>
743+
* </note>
702744
*/
703745
Width?: number;
704746

@@ -847,7 +889,8 @@ export interface CalculateRouteRequest {
847889

848890
/**
849891
* <p>Specifies the mode of transport when calculating a route. Used in estimating the speed
850-
* of travel and road compatibility.</p>
892+
* of travel and road compatibility. You can choose <code>Car</code>, <code>Truck</code>,
893+
* or <code>Walking</code> as options for the <code>TravelMode</code>.</p>
851894
* <p>The <code>TravelMode</code> you specify also determines how you specify route
852895
* preferences: </p>
853896
* <ul>
@@ -1639,7 +1682,7 @@ export interface MapConfiguration {
16391682
* <ul>
16401683
* <li>
16411684
* <p>
1642-
* <code>VectorHereBerlin</code> – The HERE Berlin map style is a high contrast
1685+
* <code>VectorHereContrast</code> – The HERE Contrast (Berlin) map style is a high contrast
16431686
* detailed base map of the world that blends 3D and 2D rendering.</p>
16441687
* </li>
16451688
* <li>
@@ -1656,6 +1699,11 @@ export interface MapConfiguration {
16561699
* within transport and logistics.</p>
16571700
* </li>
16581701
* </ul>
1702+
* <note>
1703+
* <p>The <code>VectorHereContrast</code> style has been renamed from <code>VectorHereBerlin</code>.
1704+
* <code>VectorHereBerlin</code> has been deprecated, but will continue to work in
1705+
* applications that use it.</p>
1706+
* </note>
16591707
*/
16601708
Style: string | undefined;
16611709
}
@@ -2738,7 +2786,7 @@ export interface GetGeofenceResponse {
27382786
GeofenceId: string | undefined;
27392787

27402788
/**
2741-
* <p>Contains the geofence geometry details describing a polygon.</p>
2789+
* <p>Contains the geofence geometry details describing a polygon or a circle.</p>
27422790
*/
27432791
Geometry: GeofenceGeometry | undefined;
27442792

@@ -2892,7 +2940,7 @@ export interface ListGeofenceResponseEntry {
28922940
GeofenceId: string | undefined;
28932941

28942942
/**
2895-
* <p>Contains the geofence geometry details describing a polygon.</p>
2943+
* <p>Contains the geofence geometry details describing a polygon or a circle.</p>
28962944
*/
28972945
Geometry: GeofenceGeometry | undefined;
28982946

@@ -2966,9 +3014,11 @@ export interface PutGeofenceRequest {
29663014
GeofenceId: string | undefined;
29673015

29683016
/**
2969-
* <p>Contains the polygon details to specify the position of the geofence.</p>
3017+
* <p>Contains the details to specify the position of the geofence. Can be either a
3018+
* polygon or a circle. Including both will return a validation error.</p>
29703019
* <note>
2971-
* <p>Each <a href="https://docs.aws.amazon.com/location-geofences/latest/APIReference/API_GeofenceGeometry.html">geofence polygon</a> can have a maximum of 1,000 vertices.</p>
3020+
* <p>Each <a href="https://docs.aws.amazon.com/location-geofences/latest/APIReference/API_GeofenceGeometry.html">
3021+
* geofence polygon</a> can have a maximum of 1,000 vertices.</p>
29723022
* </note>
29733023
*/
29743024
Geometry: GeofenceGeometry | undefined;
@@ -3205,7 +3255,7 @@ export interface GetMapGlyphsRequest {
32053255
* <p>Valid font stacks for <a href="https://docs.aws.amazon.com/location/latest/developerguide/HERE.html">HERE Technologies</a> styles: </p>
32063256
* <ul>
32073257
* <li>
3208-
* <p>VectorHereBerlin – <code>Fira
3258+
* <p>VectorHereContrast – <code>Fira
32093259
* GO Regular</code> | <code>Fira GO Bold</code>
32103260
* </p>
32113261
* </li>
@@ -4754,12 +4804,21 @@ export const BatchGetDevicePositionResponseFilterSensitiveLog = (obj: BatchGetDe
47544804
}),
47554805
});
47564806

4807+
/**
4808+
* @internal
4809+
*/
4810+
export const CircleFilterSensitiveLog = (obj: Circle): any => ({
4811+
...obj,
4812+
...(obj.Center && { Center: SENSITIVE_STRING }),
4813+
});
4814+
47574815
/**
47584816
* @internal
47594817
*/
47604818
export const GeofenceGeometryFilterSensitiveLog = (obj: GeofenceGeometry): any => ({
47614819
...obj,
47624820
...(obj.Polygon && { Polygon: obj.Polygon.map((item) => SENSITIVE_STRING) }),
4821+
...(obj.Circle && { Circle: SENSITIVE_STRING }),
47634822
});
47644823

47654824
/**

clients/client-location/src/protocols/Aws_restJson1.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ import {
171171
CalculateRouteMatrixSummary,
172172
CalculateRouteSummary,
173173
CalculateRouteTruckModeOptions,
174+
Circle,
174175
ConflictException,
175176
DataSourceConfiguration,
176177
DevicePosition,
@@ -5221,6 +5222,13 @@ const serializeAws_restJson1CalculateRouteTruckModeOptions = (
52215222
};
52225223
};
52235224

5225+
const serializeAws_restJson1Circle = (input: Circle, context: __SerdeContext): any => {
5226+
return {
5227+
...(input.Center != null && { Center: serializeAws_restJson1Position(input.Center, context) }),
5228+
...(input.Radius != null && { Radius: __serializeFloat(input.Radius) }),
5229+
};
5230+
};
5231+
52245232
const serializeAws_restJson1CountryCodeList = (input: string[], context: __SerdeContext): any => {
52255233
return input
52265234
.filter((e: any) => e != null)
@@ -5271,6 +5279,7 @@ const serializeAws_restJson1DevicePositionUpdateList = (
52715279

52725280
const serializeAws_restJson1GeofenceGeometry = (input: GeofenceGeometry, context: __SerdeContext): any => {
52735281
return {
5282+
...(input.Circle != null && { Circle: serializeAws_restJson1Circle(input.Circle, context) }),
52745283
...(input.Polygon != null && { Polygon: serializeAws_restJson1LinearRings(input.Polygon, context) }),
52755284
};
52765285
};
@@ -5603,6 +5612,13 @@ const deserializeAws_restJson1CalculateRouteSummary = (output: any, context: __S
56035612
} as any;
56045613
};
56055614

5615+
const deserializeAws_restJson1Circle = (output: any, context: __SerdeContext): Circle => {
5616+
return {
5617+
Center: output.Center != null ? deserializeAws_restJson1Position(output.Center, context) : undefined,
5618+
Radius: __limitedParseDouble(output.Radius),
5619+
} as any;
5620+
};
5621+
56065622
const deserializeAws_restJson1CountryCodeList = (output: any, context: __SerdeContext): string[] => {
56075623
const retVal = (output || [])
56085624
.filter((e: any) => e != null)
@@ -5654,6 +5670,7 @@ const deserializeAws_restJson1DevicePositionList = (output: any, context: __Serd
56545670

56555671
const deserializeAws_restJson1GeofenceGeometry = (output: any, context: __SerdeContext): GeofenceGeometry => {
56565672
return {
5673+
Circle: output.Circle != null ? deserializeAws_restJson1Circle(output.Circle, context) : undefined,
56575674
Polygon: output.Polygon != null ? deserializeAws_restJson1LinearRings(output.Polygon, context) : undefined,
56585675
} as any;
56595676
};

0 commit comments

Comments
 (0)