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

Improve proj4j tests to reflect the recent changes and the moved out EPSG resources #96

Open
pomadchin opened this issue Dec 13, 2022 · 3 comments

Comments

@pomadchin
Copy link
Member

pomadchin commented Dec 13, 2022

After separating the project into two, we may get some confusing errors; i.e.

java.lang.IllegalStateException: Unable to access CRS file: proj4/nad/epsg
  at org.locationtech.proj4j.io.Proj4FileReader.readParametersFromFile(Proj4FileReader.java:44)
  at org.locationtech.proj4j.io.Proj4FileReader.getParameters(Proj4FileReader.java:119)
  at org.locationtech.proj4j.CRSFactory.createFromName(CRSFactory.java:83)
  at org.apache.calcite.runtime.ProjectionTransformer.<init>(ProjectionTransformer.java:57)
  at org.apache.calcite.runtime.SpatialTypeFunctions.ST_Transform(SpatialTypeFunctions.java:[1196]

This task is to improve error messages and documentation.

cc @bchapuis

@RoggenRentier
Copy link

For anyone coming across this issue when looking up this error message:
The project has been seperated into two and the epsg CRS files are now longer included in the Proj4j library, but in a seperate proj4j-epsg library.
The error is fixed by adding this library to your project.

@pomadchin
Copy link
Member Author

Also PRs are welcome! If there is a way to make this more clear we need it!

@bchapuis
Copy link
Contributor

Yes, we should definitively make things clearer. I see that the README has been updated. What about the following ideas:

Add a clearer error message, such as:

java.lang.IllegalStateException: The proj4j-epsg JAR file is not present in the classpath. This dependency is required to access the proj4/nad/epsg file. Please ensure that the proj4j-epsg JAR is added to your project dependencies.

Hard coding a couple of projection definitions in the core library (e.g. epsg:4326, epsg:3857, etc.). Apparently, the following was acceptable from an Apache License perspective.

https://github.com/apache/incubator-baremaps/blob/8dce39f7d87bdc932c832df5418cc2fdcd1add7f/baremaps-openstreetmap/src/main/java/org/apache/baremaps/openstreetmap/utils/CRSUtils.java#L24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants