762 double minx, miny, maxx, maxy;
763 double latmax, latmin, lonmax, lonmin;
764 double lonwidth, latwidth;
765 double latmaxadjust, lonmaxadjust, latminadjust, lonminadjust;
774 if ( minx == maxx && miny == maxy )
790 lonwidth = lonmax - lonmin;
791 latwidth = latmax - latmin;
792 latmaxadjust = lonmaxadjust = latminadjust = lonminadjust = 0.0;
794 if ( minx > lonmin + lonwidth / 2.0 )
796 lonminadjust = lonwidth / 2.0;
798 else if ( maxx < lonmax - lonwidth / 2.0 )
800 lonmaxadjust = -1 * lonwidth / 2.0;
802 if ( lonminadjust || lonmaxadjust )
804 lonmin += lonminadjust;
805 lonmax += lonmaxadjust;
815 if ( miny > latmin + latwidth / 2.0 )
817 latminadjust = latwidth / 2.0;
819 else if (maxy < latmax - latwidth / 2.0 )
821 latmaxadjust = -1 * latwidth / 2.0;
824 if ( latminadjust || latmaxadjust )
826 latmin += latminadjust;
827 latmax += latmaxadjust;
839 bounds->
xmin = lonmin;
840 bounds->
xmax = lonmax;
841 bounds->
ymin = latmin;
842 bounds->
ymax = latmax;