locationtech / locationtech/proj4j
More flexible readEpsgFromParameters function
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 232
- Forks
- 86
- PR merge metrics
- No merged PRs in 30d
Description
In case a bit corrupted proj4 string passed (i.e. “+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs”1 instead of the correct “+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs”). The readEpsgFromParameters function returns null. I would expected it to return the WebMercator EPSG code:
val proj4string = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs"
val crsFactory = new CRSCache()
val epsg = crsFactory.readEpsgFromParameters(proj4string) //> null
May be it is possible to make this parser more flexible.
Reference to the discussion: https://github.com/locationtech/geotrellis/issues/3281#issuecomment-674367298
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the CRSCache.readEpsgFromParameters entry point and compare its handling of the provided proj4 string with the expected WebMercator result. The change is complete when this form, including integer-valued parameters, returns the WebMercator EPSG code instead of null; the payload does not name a test file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100