Skip to content

Commit

Permalink
address pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Apr 25, 2024
1 parent bc95333 commit 6c41a19
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion env.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ BUGSNAG_NOTIFIER_KEY: INSERT BUGSNAG NOTIFIER KEY HERE
GEOCODERS: <Stringified JSON Array of OTP-UI `GeocoderConfig`s>
BACKUP_GEOCODERS: <Stringified JSON Array of OTP-UI `GeocoderConfig`'s. Same length and order as GEOCODERS>

LOCATION_COMPARISON_COORDIATE_ACCURACY: defaults to 4 (~10m). What accuracy to use when comparing if two locations are the same
LOCATION_COMPARISON_COORDINATE_PRECISION: defaults to 4 (~10m). What precision to use when comparing if two locations are the same
2 changes: 1 addition & 1 deletion serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ provider:
GEOCODERS: ${self:custom.secrets.GEOCODERS}
BACKUP_GEOCODERS: ${self:custom.secrets.BACKUP_GEOCODERS}
BUGSNAG_NOTIFIER_KEY: ${self:custom.secrets.BUGSNAG_NOTIFIER_KEY}
LOCATION_COMPARISON_COORDIATE_ACCURACY: ${self:custom.secrets.LOCATION_COMPARISON_COORDIATE_ACCURACY, 4}
LOCATION_COMPARISON_COORDINATE_PRECISION: ${self:custom.secrets.LOCATION_COMPARISON_COORDINATE_PRECISION, 4}
package:
patterns:
- pois.json
Expand Down
4 changes: 2 additions & 2 deletions utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export type ServerlessResponse = {
// Consts
const PREFERRED_LAYERS = ['venue', 'address', 'street', 'intersection']

const { LOCATION_COMPARISON_COORDIATE_ACCURACY } = process.env
const { LOCATION_COMPARISON_COORDINATE_PRECISION } = process.env

/**
* This method removes all characters Pelias doesn't support.
Expand Down Expand Up @@ -182,7 +182,7 @@ const filterOutDuplicateStops = (
return arePointsRoughlyEqual(
feature.geometry.coordinates,
otherFeature.geometry.coordinates,
parseInt(LOCATION_COMPARISON_COORDIATE_ACCURACY || '')
!!LOCATION_COMPARISON_COORDINATE_PRECISION ? parseInt(LOCATION_COMPARISON_COORDINATE_PRECISION) : undefined

Check failure on line 185 in utils.ts

View workflow job for this annotation

GitHub Actions / test-lambda-function

Redundant double negation

Check failure on line 185 in utils.ts

View workflow job for this annotation

GitHub Actions / test-lambda-function

Replace `·?·parseInt(LOCATION_COMPARISON_COORDINATE_PRECISION)` with `⏎········?·parseInt(LOCATION_COMPARISON_COORDINATE_PRECISION)⏎·······`
)
})
}
Expand Down

0 comments on commit 6c41a19

Please sign in to comment.