Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pgr): turf error on some routes (DSR) #105

Merged
merged 3 commits into from
May 16, 2024
Merged

Conversation

azarz
Copy link
Member

@azarz azarz commented May 7, 2024

https://data.geopf.fr/navigation/itineraire?resource=bdtopo-pgr&start=0.725101%2C49.568479&intermediates=0.532261%2C49.698916%7C0.616084%2C49.644273&end=0.403495%2C49.750643&optimization=fastest&crs=EPSG%3A4326&getSteps=true&distanceUnit=kilometer&timeUnit=second&waysAttributes=cpx_gestionnaire

[2024-04-25T15:00:51.671] [ERROR] SIMPLE 124 - {
request: '/simple/1.0.0/itineraire?resource=bdtopo-pgr&start=0.725101%2C49.568479&intermediates=0.532261%2C49.698916%7C0.616084%2C49.644273&end=0.403495%2C49.750643&optimization=fastest&crs=EPSG%3A4326&getSteps=true&distanceUnit=kilometer&timeUnit=second&waysAttributes=cpx_gestionnaire',
query: {
resource: 'bdtopo-pgr',
start: '0.725101,49.568479',
intermediates: '0.532261,49.698916|0.616084,49.644273',
end: '0.403495,49.750643',
optimization: 'fastest',
crs: 'EPSG:4326',
getSteps: 'true',
distanceUnit: 'kilometer',
timeUnit: 'second',
waysAttributes: 'cpx_gestionnaire'
},
body: {},
error: {
errorType: undefined,
message: "Cannot read properties of undefined (reading '0')",
stack: "TypeError: Cannot read properties of undefined (reading '0')\n" +
' at isPointOnLineSegment (/home/docker/app/node_modules/@turf/clean-coords/dist/js/index.js:147:23)\n' +
' at cleanLine (/home/docker/app/node_modules/@turf/clean-coords/dist/js/index.js:120:9)\n' +
' at Object.cleanCoords (/home/docker/app/node_modules/@turf/clean-coords/dist/js/index.js:35:25)\n' +
' at pgrSource.writeRouteResponse (/home/docker/app/src/js/sources/pgrSource.js:1031:63)\n' +
' at /home/docker/app/src/js/sources/pgrSource.js:418:32\n' +
' at Query. (/home/docker/app/node_modules/pg-pool/index.js:428:18)\n' +
' at Query.handleReadyForQuery (/home/docker/app/node_modules/pg/lib/query.js:139:14)\n' +
' at Client._handleReadyForQuery (/home/docker/app/node_modules/pg/lib/client.js:301:19)\n' +
' at Connection.emit (node:events:513:28)\n' +
' at /home/docker/app/node_modules/pg/lib/connection.js:119:12'
}
}

@azarz azarz requested review from lgrd and jmkerloch May 7, 2024 12:28
jmkerloch
jmkerloch previously approved these changes May 7, 2024
Copy link
Contributor

@jmkerloch jmkerloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK for me.

Changelog is updated in a specific PR ?

@azarz
Copy link
Member Author

azarz commented May 7, 2024

OK for me.

👍

Changelog is updated in a specific PR ?

No, I forgot (as I often do haha...)

Copy link
Contributor

@jmkerloch jmkerloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good 👍

@azarz
Copy link
Member Author

azarz commented May 7, 2024

Waiting for @lgrd 's review, since the problem the PR tries to fix has a workaround

Copy link
Collaborator

@lgrd lgrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect !

@azarz azarz merged commit 64f43ba into develop May 16, 2024
3 checks passed
@azarz azarz deleted the fix-pgr-turf-error branch May 16, 2024 16:15
azarz added a commit that referenced this pull request May 16, 2024
fix(pgr): turf error on some routes (DSR) (#105)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants