/* Convert bivariate ASCII NAD27 to NAD83 tables to NTv2 binary structure */ #include #include #include #include #include /* defines and typededs from proj_internal.h of PROJ */ #if INT_MAX == 2147483647 typedef int pj_int32; #elif LONG_MAX == 2147483647 typedef long pj_int32; #else #warning It seems no 32-bit integer type is available #endif #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #define MIN(a,b) ((aphi * (3600.0 / (M_PI/180.0))); row_buf[i*4+1] = (float) (cvs->lam * (3600.0 / (M_PI/180.0))); /* We leave the accuracy values as zero */ } if( !IS_LSB ) swap_words( row_buf, 4, ct.lim.lam * 4 ); if( fwrite( row_buf, sizeof(float), ct.lim.lam*4, fp ) != (size_t)( 4 * ct.lim.lam ) ) { perror( "write()" ); exit( 2 ); } } } fclose( fp ); exit(0); /* normal completion */ } fprintf( stderr, "Unsupported format, nothing written.\n" ); exit( 3 ); }