private void computeLowerAndUpperBoundingBoxIfNotSet(){
  if (lowerBoundingBox != null && upperBoundingBox != null) {
    return;
  }
  final int numDimensions=datatypeConfig.getNumDimensions();
  final List<GeoSpatialDatatypeFieldConfiguration> fields=datatypeConfig.getFields();
  int latIdx=-1;
  int lonIdx=-1;
  for (int i=0; i < numDimensions; i++) {
    final GeoSpatialDatatypeFieldConfiguration field=fields.get(i);
switch (field.getServiceMapping()) {
case LATITUDE:
{
        if (latIdx != -1)         throw new AssertionError("Multiple latitude mappings for datatype in query.");
        latIdx=i;
        break;
      }
case LONGITUDE:
{
      if (lonIdx != -1)       throw new AssertionError("Multiple longitude mappings for datatype in query..");
      lonIdx=i;
      break;
    }
default :
  break;
}
}
if (latIdx != -1 && lonIdx != -1) {
switch (searchFunction) {
case IN_CIRCLE:
{
  final CoordinateDD centerPointDD=spatialCircleCenter.asCoordinateDD();
  lowerBoundingBox=CoordinateUtility.boundingBoxSouthWest(centerPointDD,spatialCircleRadius,spatialUnit);
  upperBoundingBox=CoordinateUtility.boundingBoxNorthEast(centerPointDD,spatialCircleRadius,spatialUnit);
  break;
}
case IN_RECTANGLE:
{
lowerBoundingBox=spatialRectangleSouthWest.asCoordinateDD();
upperBoundingBox=spatialRectangleNorthEast.asCoordinateDD();
break;
}
default :
throw new IllegalArgumentException("Search function (geo:search) must be defined.");
}
}
}

private void computeLowerAndUpperBoundingBoxIfNotSet ( ) { if ( lowerBoundingBox != null && upperBoundingBox != null ) { return ; } final int numDimensions = datatypeConfig . getNumDimensions ( ) ; final List < GeoSpatialDatatypeFieldConfiguration > fields = datatypeConfig . getFields ( ) ; int latIdx = - 1 ; int lonIdx = - 1 ; for ( int i = 0 ; i < numDimensions ; i ++ ) { final GeoSpatialDatatypeFieldConfiguration field = fields . get ( i ) ; switch ( field . getServiceMapping ( ) ) { case LATITUDE : { if ( latIdx != - 1 ) throw new AssertionError ( "Multiple latitude mappings for datatype in query." ) ; latIdx = i ; break ; } case LONGITUDE : { if ( lonIdx != - 1 ) throw new AssertionError ( "Multiple longitude mappings for datatype in query.." ) ; lonIdx = i ; break ; } default : break ; } } if ( latIdx != - 1 && lonIdx != - 1 ) { switch ( searchFunction ) { case IN_CIRCLE : { final CoordinateDD centerPointDD = spatialCircleCenter . asCoordinateDD ( ) ; lowerBoundingBox = CoordinateUtility . boundingBoxSouthWest ( centerPointDD , spatialCircleRadius , spatialUnit ) ; upperBoundingBox = CoordinateUtility . boundingBoxNorthEast ( centerPointDD , spatialCircleRadius , spatialUnit ) ; break ; } case IN_RECTANGLE : { lowerBoundingBox = spatialRectangleSouthWest . asCoordinateDD ( ) ; upperBoundingBox = spatialRectangleNorthEast . asCoordinateDD ( ) ; break ; } default : throw new IllegalArgumentException ( "Search function (geo:search) must be defined." ) ; } } }
set the query ' s internal bounding box , if required . the bounding box that we compute does not necessarily represent a valid query , i . e . the query in the general case requires normalization in order to give valid z - order search strings later on .
