Ticket #142 (closed enhancement: fixed)

Opened 16 months ago

Last modified 15 months ago

proj_api.h access to (spheroid|other) parameters

Reported by: pramsey Owned by: warmerdam
Priority: major Milestone: 4.8.0
Component: Core Version: Development (trunk)
Keywords: Cc:

Description

The current access to parameters in the projPJ is via the pj_get_def() function, which returns a string. The caller then has to parse the string for the contents (which are hopefully there) it is interested in. In high performance situations, this is not optimal, particularly since the value is just sitting in the projPJ hidden away.

I have particular need to get at the major axis and eccentricity squared of the spheroid, but in general I imagine users are interested in all manner of parameters that are stored as doubles.

Attachments

proj_spheroid1.patch Download (0.9 KB) - added by pramsey 16 months ago.
Simple patch

Change History

Changed 16 months ago by pramsey

And unfortunately it looks like even the string returns by pj_get_def() won't do for my needs (getting the minor axis and eccentricity squared), as the spheroid information is just given using shorthands. For EPSG:4267, for example,

proj_str = +proj=longlat +datum=NAD27 +no_defs +ellps=clrk66 +nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat

Without an API to get at this information I'll be reduced to copying the PJ struct into my code to allow Proj 4.8 support once projects.h has been removed.

Changed 16 months ago by pramsey

Simple patch

Changed 15 months ago by pramsey

Yes? no? maybe so? If this goes into proj before postgis 2.0 comes out, I can ensure postgis 2.0 can read from it when proj 4.8 is released.

Changed 15 months ago by warmerdam

  • status changed from new to closed
  • resolution set to fixed

Patch applied with the function name pj_get_spheroid_defn() (r2160).

Thanks!

Note: See TracTickets for help on using tickets.