Skip to content

fix: correctly set geojson writeFeaturesObject options for coordinates projected in EPSG:27700#261

Merged
jessicamcinchak merged 2 commits intomainfrom
jess/fix-projection-epsg27700
Feb 7, 2023
Merged

fix: correctly set geojson writeFeaturesObject options for coordinates projected in EPSG:27700#261
jessicamcinchak merged 2 commits intomainfrom
jess/fix-projection-epsg27700

Conversation

@jessicamcinchak
Copy link
Copy Markdown
Member

@jessicamcinchak jessicamcinchak commented Feb 6, 2023

fixes bug spotted over here: theopensystemslab/planx-new#1377 (comment)

geojson change events now logging out "EPSG:27700" coordinates as proper 6-digit positive integers, "EPSG:3857" coordinates were always correct - and remain so!

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 6, 2023

Deploy Preview for oslmap ready!

Name Link
🔨 Latest commit 8711e71
🔍 Latest deploy log https://app.netlify.com/sites/oslmap/deploys/63e26abb87053d0008941226
😎 Deploy Preview https://deploy-preview-261--oslmap.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Copy Markdown
Contributor

@DafyddLlyr DafyddLlyr left a comment

Choose a reason for hiding this comment

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

One small question / comment!

Comment thread src/components/my-map/utils.ts Outdated
? {
dataProjection: projection,
featureProjection: "EPSG:3857",
decimals: 0,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So this is a tricky one for me here.

decimals: 0 will (I think) give us a less accurate/meaningful GeoJSON, because BNG Eastings / Northings to 8 figures are accurate to 10m (https://digimap.edina.ac.uk/help/our-maps-and-data/bng/).

What I think we want to do is still output at the drawn accuracy (as well as OpenLayers can give us), but then just display in PlanX a rounded, consumable version?

Copy link
Copy Markdown
Member Author

@jessicamcinchak jessicamcinchak Feb 7, 2023

Choose a reason for hiding this comment

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

this is fair! while doing this, I did confirm that OS directly returns non-decimal BNG coordinates via OS Places and was loosely thinking it was okay to align to that, but I'm happy to keep full decimal accuracy for ourselves here and just display a rounded version later. updated now!

@jessicamcinchak jessicamcinchak merged commit 27486ab into main Feb 7, 2023
@jessicamcinchak jessicamcinchak deleted the jess/fix-projection-epsg27700 branch February 7, 2023 15:37
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.

2 participants