[Proj] Any access to geodetic[sic] functions ??

Christopher Barker Chris.Barker at noaa.gov
Wed Nov 12 15:12:56 EST 2008


Gerald I. Evenden wrote:
> On Wednesday 12 November 2008 12:11:48 pm Christopher Barker wrote:

>> That would be great -- I think having this bundled up in a library with
>> a decent API would be very useful to the community. 

> Excuse me for being an old clod but I would like a better understanding of 
> what 'API' is.  Yes, I read Wikipedia's description but based upon my 
> understanding of that material I have nothing to do with anything related 
> with the concept.

Wikipedia's description matches what I had in mind.

> On the non-program level, I try to write software that is reasonably flexible 
> and useable in a variety of C applications

That would be a decent API.

> But I only involve myself with a single language, C,

That would be what Wikipedia calls a "Language-dependent API", but C is 
pretty universal, so a good C lib can be used from virtually any 
language, with appropriate wrappers. Personally, I'd like to use Python.

> But by 
> the Wikipedia standards I see nothing of universal application in it.

I'm not sure what you mean by Universal application.


> Early on I made an erroneous assumption that "interface" was related to human 
> interface and that an API  was a program that provided an interface between 
> computer coded material (like libproj4) and humans.  proj or lproj are 
> examples where the human is allowed to prepare material to be computed by a 
> library procedure and see human readable results.

Well, I think the idea is that API is what computer programs see. 
Personally, I think virtually all software should be built as 
collections of libraries with decent APIs. In your example libproj 
provides an API that can be used by a variety of programs. The command 
line proj program is only one of such programs.

> The reason I bring this up is that I am not sure I understand what is 
> requested here and what, if any, relationship the concept of API has to proj 
> distributions and geodesic software.  If one wants the geodesic programs or 
> procedures they are readily available from NGS.

 From the web site, I only saw binaries of programs, no source code, and 
nothing that I would call a library.

In fact, there isn't a lot to this, so it's not such a big deal, but 
what I'd like is a library of geodesic procedures that could be called 
directly from C/C++ programs, and wrapped so that they can be called 
from other languages.

So, the following questions need to be answered:

What computations can you do?
What data is required to do them (dimensions of the ellipsoid, etc).
What input is required?
What output is provided?
What data structures are used to pass the data in/out?
What are the call signatures of the functions?
If C++, then what is the class structure?

It's not really much for a few functions...

Why I suppose I call this an API is provided by Wikipedia:

"""
The software that provides the functionality described by an API is said 
to be an implementation of the API. The API itself is abstract, in that 
it specifies an interface and the behavior of the identifiers specified 
in that interface; it does not specify how the behavior may be implemented.
"""

In this case, for instance, one could implement the simple sphere code 
or the fancier ellipsoidal code, and the API would be the same (with 
exception of having more parameters to set to define the ellipsoid), so 
that it could be called in exactly the same way from user code.

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the Proj mailing list