Skip to content

Conversation

@mraspaud
Copy link
Contributor

@mraspaud mraspaud commented Apr 14, 2020

This PR fixes the Robinson inverse projection so that coordinates outside of the main projection area become invalid.

  • Closes #xxxx
  • Tests added
  • Added clear title that can be used to generate release notes
  • Fully documented, including updating docs/source/*.rst for new API

The issue can be simply illustrated with this:

> invproj +proj=robin +a=6371000
16986804.16 100000
179d59'21.026"W	0d56'9.769"N
> proj +proj=robin +a=6371000   
179d59'21.026"W	0d56'9.769"N
-16984760.94	99999.99
> invproj +proj=robin +a=6371000
-16984760.94	99999.99
179d59'21.026"W	0d56'9.769"N

The first call to invproj should actually return invalid values.

Here is an illustration on before and after, showing the longitudes for the different coordinates (produced with pyproj and matplotlib).
before_robin
after_robin

The white areas denote invalid values. As you can see, before this PR, the longitudes were wrapped around the edges of the projection area.

I didn't add any unittest though, because I haven't found the file to add then too. Could give anyone give a hint for that ?

@rouault
Copy link
Member

rouault commented Apr 14, 2020

I didn't add any unittest though, because I haven't found the file to add then too. Could give anyone give a hint for that ?

In test/gie/builtins.gie , look for robin. The syntax should hopefully be obvious from existing cases
You can run it with gie test/gie/builtins.gie

@mraspaud
Copy link
Contributor Author

Thanks

@mraspaud
Copy link
Contributor Author

Ok, I'm not sure how to test invalid values:

accept 17250000 100000
expect *	*

^ this doesn't seem to work

@rouault
Copy link
Member

rouault commented Apr 14, 2020

expect * *

expect failure or if you want to be more specificic expect failure errno lat_or_lon_exceed_limit (the 'lat_or_lon_exceed_limit' string comes from the lookup[] table in src/apps/gie.cpp, and you remove the leading pjd_err_ suffix from the strings there)

@mraspaud
Copy link
Contributor Author

Thanks, fixed now!

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