Returns the region consisting of the union of this geometry and Geometry and the other, as a new OGRGeometry object. Returns the region consisting of the symmetric difference of this Returns the region consisting of the intersection of this geometry and Returns the region consisting of the difference of this geometry and The smallest convex polygon that contains this geometry, as a new The boundary of this geometry, as a new OGRGeometry object. Returns True if this geometry overlaps the other, otherwise returns Returns True if this geometry contains the other, otherwise returns Returns True if this geometry is contained within the other, otherwise returns Returns True if this geometry crosses the other, otherwise returns Returns True if this geometry touches the other, otherwise returns Not intersect) the other, otherwise returns False.
Returns True if this geometry is spatially disjoint to (i.e. Returns True if this geometry is equivalent to the other, otherwise returns Returns True if this geometry intersects the other, otherwise returns However, if the clone keyword is set to True then a transformedĬlone of this geometry is returned instead. Spatial reference WKT and PROJ.4 strings, or an integer SRID).īy default nothing is returned and the geometry is transformed in-place. Or any other input accepted by SpatialReference (including Take a CoordTransform object, a SpatialReference object, Transforms this geometry to a different spatial reference system. wkt 'LINEARRING (0 0,0 1,1 0,0 0)' transform( coord_trans, clone=False) ¶ > triangle = OGRGeometry ( 'LINEARRING (0 0,0 1,1 0)' ) > triangle. Returns the number of coordinated dimensions of the geometry, i.e. Interior ring at the specified index for a Polygon, or the geometryĪt the specified index in a Geometr圜ollection. Returns the point at the specified index for a LineString, the Polygon, or the geometries in a Geometr圜ollection. Iterates over the points in a LineString, the rings in a Number of rings in a Polygon, or the number of geometries in a Returns the number of points in a LineString, the classmethod from_bbox( bbox) ¶Ĭonstructs a Polygon from the given bounding-box (a 4-tuple). Reading vector data from Layer (which is in turn a part ofĪ DataSource). These objectsĪre also returned from the Feature.geom attribute, when Parameter, which may be a string containing WKT, HEX, GeoJSON, a bufferĬontaining WKB data, or an OGRGeomType object. These objects are instantiated directly from the given geom_input This object is a wrapper for the OGR Geometry class. > from import OGRGeometry > polygon = OGRGeometry ( 'POLYGON((0 0, 5 0, 5 5, 0 5))' ) class OGRGeometry( geom_input ) ¶ For information onĪccessing the layers of data themselves, see the next section: Or (equivalently) by using the len() function. Layers of data it contains by accessing the layer_count property, Once you’ve created your DataSource, you can find out how many Typically useful when you obtain DjangoUnicodeDecodeError exceptions Specify a non-standard encoding of the strings in the source. The optional encoding parameter allows you to Instance gives the OGR name of the underlying data source that it is For more information, see the OGR Vector Formatsĭocumentation. The constructor for DataSource only requires one parameter: the path ofĪlso supports a variety of more complex data sources, includingĭatabases, that may be accessed by passing a special name string instead Points, polygons, etc.), as well as the names and types of anyĪdditional fields ( Field) of data that may be associated withĮach feature in that layer. Information about the type of features contained in that layer (e.g.
Object, contains some number of geographic features ( Feature), Eachĭata source is represented by a DataSource object which contains Supports reading data from a variety of OGR-supported geospatial fileįormats and data sources using a simple, consistent interface. DataSource is a wrapper for the OGR data source object that