nl_tokens: Create an expanded bounding box to handle features outside the tile that overlap
pl_tokens: public BoundingBox expandBoundingBox ( BoundingBox webMercatorBoundingBox , BoundingBox tileWebMercatorBoundingBox ) { // Create an expanded bounding box to handle features outside the tile // that overlap double minLongitude = TileBoundingBoxUtils . getLongitudeFromPixel ( tileWidth , webMercatorBoundingBox , tileWebMercatorBoundingBox , 0 - widthOverlap ) ; double maxLongitude = TileBoundingBoxUtils . getLongitudeFromPixel ( tileWidth , webMercatorBoundingBox , tileWebMercatorBoundingBox , tileWidth + widthOverlap ) ; double maxLatitude = TileBoundingBoxUtils . getLatitudeFromPixel ( tileHeight , webMercatorBoundingBox , tileWebMercatorBoundingBox , 0 - heightOverlap ) ; double minLatitude = TileBoundingBoxUtils . getLatitudeFromPixel ( tileHeight , webMercatorBoundingBox , tileWebMercatorBoundingBox , tileHeight + heightOverlap ) ; // Choose the most expanded longitudes and latitudes minLongitude = Math . <mask> ( minLongitude , webMercatorBoundingBox . getMinLongitude ( ) ) ; maxLongitude = Math . max ( maxLongitude , webMercatorBoundingBox . getMaxLongitude ( ) ) ; minLatitude = Math . min ( minLatitude , webMercatorBoundingBox . getMinLatitude ( ) ) ; maxLatitude = Math . max ( maxLatitude , webMercatorBoundingBox . getMaxLatitude ( ) ) ; // Bound with the web mercator limits minLongitude = Math . max ( minLongitude , - 1 * ProjectionConstants . WEB_MERCATOR_HALF_WORLD_WIDTH ) ; maxLongitude = Math . min ( maxLongitude , ProjectionConstants . WEB_MERCATOR_HALF_WORLD_WIDTH ) ; minLatitude = Math . max ( minLatitude , - 1 * ProjectionConstants . WEB_MERCATOR_HALF_WORLD_WIDTH ) ; maxLatitude = Math . min ( maxLatitude , ProjectionConstants . WEB_MERCATOR_HALF_WORLD_WIDTH ) ; BoundingBox expandedBoundingBox = new BoundingBox ( minLongitude , minLatitude , maxLongitude , maxLatitude ) ; return expandedBoundingBox ; }