[PROJ] Realistic way of handling unknown bounds in proj_get_area_of_use

Even Rouault even.rouault at spatialys.com
Wed Nov 4 11:33:44 PST 2020


On mercredi 4 novembre 2020 21:08:17 CET Laurențiu Nicola wrote:
> Hello, and sorry if this is a strange question -- I'm not really familiar
> with the PROJ library.
> 
> While trying to include proj_get_area_of_use in the Rust PROJ bindings
> (https://github.com/georust/proj/pull/50) a question came up of how
> probable is the case when the call succeeds, but the bounds are not
> available (and are thus returned as -1000).
> 
> From the implementation, it looks like it might happen (it could be that
> only one of the four values is unknown), but as a novice user I would
> associate that with an error case. So I guess I'm asking if:
> 
> 1. could it happen that the area name is available but the bounds are
> missing? 2. if one or more of the limits is missing, can a caller do
> anything meaningful with the result, or is it practically an error?
> 
> As prior art, pyproj doesn't seem to check for -1000, putting the onus on
> the caller to validate the bounds. My feeling is that the answer to both
> questions above is true and the Rust bindings should try to preserve that
> functionality.

It should be uncommon to have an area of use without its bounding box, but if 
you instanciate a CRS from WKT2 with a USAGE[AREA["foo]] node, you would be in 
that situation.
You'll get either all 4 bounds valid or at -1000, not a mix of valid and 
invalid values.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the PROJ mailing list