Checks that the geospatial bounds is well formed OGC WKT
499061
def verify_geospatial_bounds(self, ds):
        """"""
        var = getattr(ds, 'geospatial_bounds', None)
        check = var is not None
        if not check:
            return ratable_result(False,
                                  "Global Attributes", # grouped with Globals
                                  ["geospatial_bounds not present"])

        try:
            # TODO: verify that WKT is valid given CRS (defaults to EPSG:4326
            #       in ACDD.
            from_wkt(ds.geospatial_bounds)
        except AttributeError:
            return ratable_result(False,
                                  "Global Attributes", # grouped with Globals
                                  ['Could not parse WKT, possible bad value for WKT'])
        # parsed OK
        else:
            return ratable_result(True, "Global Attributes", tuple())
772262
def _validate_planar_fault_geometry(self, node, _float_re):
        
        valid_spacing = node["spacing"]
        for key in ["topLeft", "topRight", "bottomLeft", "bottomRight"]:
            lon = getattr(node, key)["lon"]
            lat = getattr(node, key)["lat"]
            depth = getattr(node, key)["depth"]
            valid_lon = (lon >= -180.0) and (lon <= 180.0)
            valid_lat = (lat >= -90.0) and (lat <= 90.0)
            valid_depth = (depth >= 0.0)
            is_valid = valid_lon and valid_lat and valid_depth
            if not is_valid or not valid_spacing:
                raise LogicTreeError(
                    node, self.filename,
                    "'planarFaultGeometry' node is not valid")
913005
function polygonClosed(coordinates) {
  var a = coordinates[0],
      b = coordinates[coordinates.length - 1];
  return !(a[0] - b[0] || a[1] - b[1]);
}
1217028
def _calculate_bounds(self):
        """"""
        # get start datetime
        first = self.coll_handle.find_one(None, sort=[("ts", ASCENDING)])
        last = self.coll_handle.find_one(None, sort=[("ts", DESCENDING)])

        self._start = first['ts']
        if self._start.tzinfo is None:
            self._start = self._start.replace(tzinfo=tzutc())

        self._end = last['ts']
        if self._end.tzinfo is None:
            self._end = self._end.replace(tzinfo=tzutc())

        return True
651694
boolean isCloseTo(final GeoPoint pPoint, final double tolerance,
					  final Projection pProjection, final boolean pClosePath) {
		return getCloseTo(pPoint, tolerance, pProjection, pClosePath) != null;
	}
20220
function() {
        const allPathCoords = this._paths.reduce((acc, path) => acc.concat(path), []);
        return L.latLngBounds(allPathCoords);
    }
37756
def _confirm_resolution(self, implemented_res):
        '''  '''

        assert self.ppd in implemented_res, \
            ' Resolution %d ppd not implemented yet\n.\
            Consider using one of the implemented resolutions %s'\
            % (self.ppd, ', '.join([f + ' ppd' for f in map(str, implemented_res)]))

        if self.ppd == 256:
            assert (np.abs(self.latM) < 60) and (np.abs(self.latm) < 60),\
                'This resolution is available in\n \
                in cylindrical geometry only for -60<latitude<60 '
537952
def get_geoms_for_bounds(self, bounds):
        

        params = {'service'      : 'WFS',
                  'request'      : 'GetFeature',
                  'typeName'     : self._feature_name,
                  'outputFormat' : 'json',
                  'version'      : '1.0.0',
                  'bbox'         : ','.join((str(b) for b in wkt.loads(bounds).bounds))}

        raw_geojson_response = requests.get(self._wfs_server, params=params)
        raw_geojson_response.raise_for_status()
        geojson = raw_geojson_response.json()

        return [g['geometry'] for g in geojson['features']]
374954
def compute_bounds(feed: "Feed") -> Tuple:
    
    lons, lats = feed.stops["stop_lon"], feed.stops["stop_lat"]
    return lons.min(), lats.min(), lons.max(), lats.max()
1074181
def check_bounds(self):
        """"""
        if not (self.camera_bounds == None):
            if self.__pan.X < self.camera_bounds.Left:
                self.__pan[0] = self.camera_bounds.Left

            if self.__pan.X > self.camera_bounds.Right:
                self.__pan[0] = self.camera_bounds.Right

            if self.__pan.Y < self.camera_bounds.Top:
                self.__pan[1] = self.camera_bounds.Top

            if self.__pan.Y > self.camera_bounds.Bottom:
                self.__pan[1] = self.camera_bounds.Bottom
210262
private static boolean polygonContainsPoint_(Polygon polygon_a,
			Point point_b, double tolerance, ProgressTracker progress_tracker) {
		Point2D pt_b = point_b.getXY();
		return polygonContainsPointImpl_(polygon_a, pt_b, tolerance,
				progress_tracker);
	}
722005
@Pure
	private static boolean isOutsideNodeBuildingBounds(AbstractGISTreeSetNode<?, ?> node,
			Rectangle2afp<?, ?, ?, ?, ?, ?> location) {
		final Rectangle2d b2 = getNormalizedNodeBuildingBounds(node, location);
		if (b2 == null) {
			return false;
		}
		return Rectangle2afp.classifiesRectangleRectangle(
				b2.getMinX(), b2.getMinY(), b2.getMaxX(), b2.getMaxY(),
				location.getMinX(), location.getMinY(), location.getMaxX(), location.getMaxY()) != IntersectionType.INSIDE;
	}
1212752
private boolean ensure2dLayout(IAtomContainer container) throws CDKException {
        if (!GeometryUtil.has2DCoordinates(container)) {
            StructureDiagramGenerator sdg = new StructureDiagramGenerator();
            sdg.generateCoordinates(container);
            return true;
        }
        return false;
    }
376041
public static boolean shouldClosePath(VectorTile.Tile.GeomType geomType) {
        final boolean closeReq;

        switch(geomType) {
            case POLYGON:
                closeReq = true;
                break;
            default:
                closeReq = false;
                break;
        }

        return closeReq;
    }
650968
private static boolean polygonContainsEnvelope_(Polygon polygon_a,
			Envelope envelope_b, double tolerance,
			ProgressTracker progress_tracker) {
		// Quick envelope rejection test

		Envelope2D env_a = new Envelope2D(), env_b = new Envelope2D();
		polygon_a.queryEnvelope2D(env_a);
		envelope_b.queryEnvelope2D(env_b);

		if (!envelopeInfContainsEnvelope_(env_a, env_b, tolerance))
			return false;

		// Quick rasterize test to see whether the the geometries are disjoint,
		// or if one is contained in the other.
		int relation = tryRasterizedContainsOrDisjoint_(polygon_a, envelope_b,
				tolerance, false);

		if (relation == Relation.disjoint || relation == Relation.within)
			return false;

		if (relation == Relation.contains)
			return true;

		if (env_b.getWidth() <= tolerance && env_b.getHeight() <= tolerance) {// treat
																				// as
																				// point
			Point2D pt_b = envelope_b.getCenterXY();
			return polygonContainsPointImpl_(polygon_a, pt_b, tolerance,
					progress_tracker);
		}

		if (env_b.getWidth() <= tolerance || env_b.getHeight() <= tolerance) {// treat
																				// as
																				// polyline
			Polyline polyline_b = new Polyline();
			Point p = new Point();
			envelope_b.queryCornerByVal(0, p);
			polyline_b.startPath(p);
			envelope_b.queryCornerByVal(2, p);
			polyline_b.lineTo(p);
			return polygonContainsPolylineImpl_(polygon_a, polyline_b,
					tolerance, null);
		}

		// treat as polygon
		Polygon polygon_b = new Polygon();
		polygon_b.addEnvelope(envelope_b, false);
		return polygonContainsPolygonImpl_(polygon_a, polygon_b, tolerance,
				null);
	}
423471
def bounds(ctx, tile):
    """"""
    click.echo(
        '%s %s %s %s' % TilePyramid(
            ctx.obj['grid'],
            tile_size=ctx.obj['tile_size'],
            metatiling=ctx.obj['metatiling']
        ).tile(*tile).bounds(pixelbuffer=ctx.obj['pixelbuffer'])
    )
898696
private static Set<GeoPosition> getMapGeoBounds(JXMapViewer mapViewer)
    {
        Set<GeoPosition> set = new HashSet<GeoPosition>();
        TileFactory tileFactory = mapViewer.getTileFactory();
        int zoom = mapViewer.getZoom();
        Rectangle2D bounds = mapViewer.getViewportBounds();
        Point2D pt = new Point2D.Double(bounds.getX(), bounds.getY());
        set.add(tileFactory.pixelToGeo(pt, zoom));
        pt = new Point2D.Double(bounds.getX() + bounds.getWidth(), bounds.getY() + bounds.getHeight());
        set.add(tileFactory.pixelToGeo(pt, zoom));
        return set;
    }