From: Curt M. <we...@us...> - 2003-06-18 18:12:04
|
Update of /cvsroot/xastir/xastir/src In directory sc8-pr-cvs1:/tmp/cvs-serv4176 Modified Files: maps.c Log Message: Tweaks by Derrick J Brashear, KB3EGH, to handle non-USGS geotiff images properly. Index: maps.c =================================================================== RCS file: /cvsroot/xastir/xastir/src/maps.c,v retrieving revision 1.294 retrieving revision 1.295 diff -C2 -d -r1.294 -r1.295 *** maps.c 18 Jun 2003 01:29:18 -0000 1.294 --- maps.c 18 Jun 2003 18:12:01 -0000 1.295 *************** *** 8704,8708 **** if (!have_fgd) // Not a USGS map or perhaps a newer spec { ! crop_it = 0; /* Do NOT crop this map image */ /* --- 8704,8708 ---- if (!have_fgd) // Not a USGS map or perhaps a newer spec { ! crop_it = 1; /* crop this map image */ /* *************** *** 8801,8823 **** f_SE_x_bounding = (float)xxx; f_SE_y_bounding = (float)yyy; } ! // Handle special USGS geoTIFF case here. We only have ! // four boundaries because the edges are aligned with ! // lat/long. ! else // have_fgd ! { ! f_NW_x_bounding = f_west_bounding; ! f_NW_y_bounding = f_north_bounding; ! f_SW_x_bounding = f_west_bounding; ! f_SW_y_bounding = f_south_bounding; ! f_NE_x_bounding = f_east_bounding; ! f_NE_y_bounding = f_north_bounding; ! f_SE_x_bounding = f_east_bounding; ! f_SE_y_bounding = f_south_bounding; ! } --- 8801,8844 ---- f_SE_x_bounding = (float)xxx; f_SE_y_bounding = (float)yyy; + + if (f_NW_y_bounding > 0) { + yyy=((f_NW_y_bounding > f_NE_y_bounding) ? f_NE_y_bounding + : f_NW_y_bounding); + xxx=((f_SW_y_bounding < f_SE_y_bounding) ? f_SE_y_bounding + : f_SW_y_bounding); + } else { + yyy=((f_NW_y_bounding < f_NE_y_bounding) ? f_NE_y_bounding + : f_NW_y_bounding); + xxx=((f_SW_y_bounding > f_SE_y_bounding) ? f_SE_y_bounding + : f_SW_y_bounding); + } + f_north_bounding = (float)yyy; + f_south_bounding = (float)xxx; + if (f_NE_x_bounding > 0) { + xxx=((f_NE_x_bounding < f_SE_x_bounding) ? f_SE_x_bounding + : f_NE_x_bounding); + yyy=((f_NW_x_bounding > f_SW_x_bounding) ? f_SW_x_bounding + : f_NW_x_bounding); + } else { + xxx=((f_NE_x_bounding > f_SE_x_bounding) ? f_SE_x_bounding + : f_NE_x_bounding); + yyy=((f_NW_x_bounding < f_SW_x_bounding) ? f_SW_x_bounding + : f_NW_x_bounding); + } + f_west_bounding = (float)yyy; + f_east_bounding = (float)xxx; } ! f_NW_x_bounding = f_west_bounding; ! f_NW_y_bounding = f_north_bounding; ! f_SW_x_bounding = f_west_bounding; ! f_SW_y_bounding = f_south_bounding; ! f_NE_x_bounding = f_east_bounding; ! f_NE_y_bounding = f_north_bounding; ! f_SE_x_bounding = f_east_bounding; ! f_SE_y_bounding = f_south_bounding; |