752 double minx, miny, maxx, maxy;
753 double latmax, latmin, lonmax, lonmin;
754 double lonwidth, latwidth;
755 double latmaxadjust, lonmaxadjust, latminadjust, lonminadjust;
764 if ( minx == maxx && miny == maxy )
780 lonwidth = lonmax - lonmin;
781 latwidth = latmax - latmin;
782 latmaxadjust = lonmaxadjust = latminadjust = lonminadjust = 0.0;
784 if ( minx > lonmin + lonwidth / 2.0 )
786 lonminadjust = lonwidth / 2.0;
788 else if ( maxx < lonmax - lonwidth / 2.0 )
790 lonmaxadjust = -1 * lonwidth / 2.0;
792 if ( lonminadjust || lonmaxadjust )
794 lonmin += lonminadjust;
795 lonmax += lonmaxadjust;
805 if ( miny > latmin + latwidth / 2.0 )
807 latminadjust = latwidth / 2.0;
809 else if (maxy < latmax - latwidth / 2.0 )
811 latmaxadjust = -1 * latwidth / 2.0;
814 if ( latminadjust || latmaxadjust )
816 latmin += latminadjust;
817 latmax += latmaxadjust;
829 bounds->
xmin = lonmin;
830 bounds->
xmax = lonmax;
831 bounds->
ymin = latmin;
832 bounds->
ymax = latmax;
836 return precision / 5;