Skip to content

add EPSG:31370 #263

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

Merged
merged 12 commits into from
Jun 17, 2025
Merged

add EPSG:31370 #263

merged 12 commits into from
Jun 17, 2025

Conversation

tcarion
Copy link
Contributor

@tcarion tcarion commented Apr 30, 2025

@tcarion
Copy link
Contributor Author

tcarion commented Apr 30, 2025

the conversion method use Lambert Conic Conformal, but I couldn't find reference to it in the code. Is it currently missing?

@juliohm
Copy link
Member

juliohm commented Apr 30, 2025

Thank you for the PR @tcarion !

the conversion method use Lambert Conic Conformal, but I couldn't find reference to it in the code. Is it currently missing?

That is right. We need to implement the formula first, in order to attach the correct CRS type to the EPSG code instead of the generic Cartesian2D.

The formula is well-documented in the link shared, but I would make sure they match the formulas in the official EPSG guide. Do you think you have some time to work on this new LambertConic type?

@tcarion
Copy link
Contributor Author

tcarion commented Apr 30, 2025

Sure, I can try to help!

Do you think I should do this here or rather create another PR?

@juliohm
Copy link
Member

juliohm commented Apr 30, 2025 via email

@juliohm
Copy link
Member

juliohm commented Jun 16, 2025

@tcarion I believe we can map the new CRS type to the EPSG code now 🙂

@codecov-commenter
Copy link

codecov-commenter commented Jun 16, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.85%. Comparing base (395b9c1) to head (c81d172).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/datums.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #263      +/-   ##
==========================================
- Coverage   91.90%   91.85%   -0.06%     
==========================================
  Files          40       40              
  Lines        1754     1755       +1     
==========================================
  Hits         1612     1612              
- Misses        142      143       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

src/get.jl Outdated
@@ -90,6 +90,7 @@ end
@crscode EPSG{27700} shift(TransverseMercator{0.9996012717,49.0°,OSGB36}, lonₒ=-2.0°, xₒ=400000.0m, yₒ=-100000.0m)
@crscode EPSG{28355} shift(TransverseMercator{0.9996,0.0°,GDA94}, lonₒ=147.0°, xₒ=500000.0m, yₒ=10000000.0m)
@crscode EPSG{29903} shift(TransverseMercator{1.000035,53.5°,Ire65}, lonₒ=-8.0°, xₒ=200000.0m, yₒ=250000.0m)
@crscode EPSG{31370} shift(LambertConic{90.0°,51.1667°,49.8333°, RNB72}, lonₒ=4.3675°, xₒ=150000m, yₒ=5400088m)
Copy link
Member

@juliohm juliohm Jun 16, 2025

Choose a reason for hiding this comment

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

The table of parameters in the EPSG database is the following:

image

I believe we should add the .013 decimal values to xₒ and the .438 decimal values to yₒ given the sensitivity of these formulas and potential error propagation.

It is unfortunate that other parameters are given in DMS. Could you please elaborate on the method used to convert to decimals?

@tcarion
Copy link
Contributor Author

tcarion commented Jun 16, 2025

For the parameters, I changed them to be the same as the projstring given by proj:

$ projinfo EPSG:31370
PROJ.4 string:
+proj=lcc +lat_0=90 +lon_0=4.36748666666667 +lat_1=51.1666672333333 +lat_2=49.8333339 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +units=m +no_defs +type=crs

Do you think I should precise this in the comments?

Also, I would like to add the transformation from BD72 to WGS84 in transforms.jl. I used the parameters from this page, but it gives slightly different results than Proj, which makes the test fail

@juliohm
Copy link
Member

juliohm commented Jun 16, 2025

Do you think I should precise this in the comments?

Perhaps a short comment explaining the choice can help future contributors. We can explain that the EPSG database shows parameters in DMS, and because of that we opted for the C PROJ parameters.

Also, I would like to add the transformation from BD72 to WGS84 in transforms.jl. I used the parameters from this page, but it gives slightly different results than Proj, which makes the test fail

That could be done in a separate PR for better review.

@juliohm juliohm merged commit 79681d2 into JuliaEarth:main Jun 17, 2025
12 checks passed
@tcarion tcarion deleted the add31370 branch June 17, 2025 11:22
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.

3 participants