[Proj] Proj binary input and output

Gerald I. Evenden gerald.evenden at verizon.net
Fri Aug 19 13:54:50 PDT 2005


In your example the input should be a (double)longitude followed by a
(double)
latitude (both in local binary).

An example I often use in checking projections is where the data is
passed
by binary through a pipe:

proj +proj=test [+other_opts] -o | proj +proj=test [+other_opts] -I -i

where the sysin input to the first program is ASCII, the output piped to
the second is
binary and input to the second which sysout's ASCII.

Note that proj uses

fread(&data, sizeof(UV), 1, fid)

for binary input and equivalent fwrite for binary output where

typedef struct { double u, v; } UV;

Unless order flipping options are used, u=longitude and v=latitude.

On Fri, 2005-08-19 at 10:39 -0700, pw wrote:

> Hello,
> 
> The documentation for proj states binary input is
> expected to be system byte order and double.
> 
> I am getting invalid results with binary
> input, yet if I manually enter lonlats asking
> for binary output I get the expected output.
> 
> Right my data is double precision floating point (64bit)
> organized as a series of lonlats (x then y).
> 
> Byte order appears to be OK since the program chokes if I
> reverse the byte order.
> 
> What format does my binary input file (binary_file.bin)
> need to be in for the following  conversion?
> 
> proj +proj=utm +zone=18 +ellps=WGS84 -i binary_file.bin

	...
-- 
_____________________________________________________________
Jerry and the Low Riders: Daisy Mae and Joshua
"The most certain test by which we judge whether a country is
really free is the amount of security enjoyed by minorities"
---Lord Acton, 1907 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20050819/e85a68e0/attachment.html>


More information about the Proj mailing list