3.09 Meridian

This commit is contained in:
alex
2018-02-10 09:28:27 +00:00
parent b01b30bba0
commit 6558dea865
7 changed files with 99 additions and 40 deletions

View File

@@ -53,7 +53,6 @@ int tile_load_lidar(tile_t *tile, char *filename){
tile->filename = strdup(filename);
/* Perform xur calcs */
// Degrees with GDAL option: -co "FORCE_CELLSIZE=YES"
tile->xur = tile->xll+(tile->cellsize*tile->width);
tile->yur = tile->yll+(tile->cellsize*tile->height);
@@ -62,15 +61,15 @@ int tile_load_lidar(tile_t *tile, char *filename){
if (tile->xll < westoffset)
westoffset = tile->xll;
// if (debug)
// fprintf(stderr,"%d, %d, %.7f, %.7f, %.7f, %.7f, %.7f\n",width,height,xll,yll,cellsize,yur,xur);
if (debug)
fprintf(stderr,"%d, %d, %.7f, %.7f, %.7f, %.7f, %.7f\n",tile->width,tile->height,tile->xll,tile->yll,tile->cellsize,tile->yur,tile->xur);
// Greenwich straddling hack
// if (tile->xll <= 0 && tile->xur > 0) {
// tile->xll = (tile->xur - tile->xll); // full width
// tile->xur = 0.0; // budge it along so it's west of greenwich
// delta = eastoffset; // add to Tx longitude later
// } else {
/* if (tile->xll <= 0 && tile->xur > 0) {
tile->xll = (tile->xur - tile->xll); // full width
tile->xur = 0.0; // budge it along so it's west of greenwich
delta = eastoffset; // add to Tx longitude later
} else {*/
// Transform WGS84 longitudes into 'west' values as society finishes east of Greenwich ;)
if (tile->xll >= 0)
tile->xll = 360-tile->xll;
@@ -121,6 +120,7 @@ int tile_load_lidar(tile_t *tile, char *filename){
// Round to nearest 0.5
tile->resolution = tile->precise_resolution < 0.5f ? 0.5f : ceil((tile->precise_resolution * 2)+0.5) / 2;
// Positive westing
tile->width_deg = tile->max_west - tile->min_west >= 0 ? tile->max_west - tile->min_west : tile->max_west + (360 - tile->min_west);
tile->height_deg = tile->max_north - tile->min_north;