Garrard AppsOnline
Garrard AppsOnline
Garrard AppsOnline
MANNING
appendix C
OGR
C.1 Summary
DATASOURCE CLASS DRIVER CLASS
CopyLayer() CopyDataSource()
CreateLayer() CreateDataSource()
DeleteLayer() DeleteDataSource()
Dereference() Deregister()
Destroy() GetName()
ExecuteSQL() Open()
GetDriver() Register()
GetLayer() TestCapability()
GetLayerByIndex() name
GetLayerByName() FEATURE CLASS
GetLayerCount() Clone()
GetName() Dereference()
GetRefCount() Destroy()
GetStyleTable() DumpReadable()
GetSummaryRefCount() Equal()
Reference() ExportToJson()
Release() GetDefnRef()
ReleaseResultSet() GetFID()
SetStyleTable() GetField()
SyncToDisk() GetFieldAsDateTime()
TestCapability() GetFieldAsDouble()
TestCapability() GetFieldAsDoubleList()
name GetFieldAsInteger()
1
2 APPENDIX C OGR
GetFieldAsIntegerList() GetGeomFieldDefn()
GetFieldAsString() GetGeomFieldIndex()
GetFieldAsStringList() GetGeomType()
GetFieldCount() GetName()
GetFieldDefnRef() GetReferenceCount()
GetFieldIndex() IsGeometryIgnored()
GetFieldType() IsSame()
GetGeomFieldCount() IsStyleIgnored()
GetGeomFieldDefnRef() SetGeomType()
GetGeomFieldIndex() SetGeometryIgnored()
GetGeomFieldRef() SetStyleIgnored()
GetGeometryRef() SetStyleIgnored()
GetStyleString() FIELDDEFN CLASS
IsFieldSet() Destroy()
Reference() GetFieldTypeName()
SetFID() GetJustify()
SetField() GetName()
SetField2() GetNameRef()
SetFieldBinaryFromHexString() GetPrecision()
SetFieldDoubleList() GetType()
SetFieldIntegerList() GetTypeName()
SetFieldStringList() GetWidth()
SetFrom() IsIgnored()
SetFromWithMap() SetIgnored()
SetGeomField() SetJustify()
SetGeomFieldDirectly() SetName()
SetGeometry() SetPrecision()
SetGeometryDirectly() SetType()
SetStyleString() SetWidth()
UnsetField() SetWidth()
geometry() justify
items() name
keys() precision
FEATUREDEFN CLASS type
AddFieldDefn() width
AddGeomFieldDefn() GEOMFIELDDEFN CLASS
DeleteGeomFieldDefn() GetName()
Destroy() GetNameRef()
GetFieldCount() GetSpatialRef()
GetFieldDefn() GetType()
GetFieldIndex() IsIgnored()
GetGeomFieldCount() SetIgnored()
Summary 3
SetName() GetGeometryRef()
SetSpatialRef() GetGeometryType()
SetType() GetPoint()
SetType() GetPointCount()
name GetPoint_2D()
srs GetPoints()
type GetSpatialReference()
GEOMETRY CLASS GetX()
AddGeometry() GetY()
AddGeometryDirectly() GetZ()
AddPoint() Intersect()
AddPoint_2D() Intersection()
Area() Intersects()
AssignSpatialReference() IsEmpty()
Boundary() IsRing()
Buffer() IsSimple()
Centroid() IsValid()
Clone() Length()
CloseRings() Overlaps()
Contains() PointOnSurface()
ConvexHull() Segmentize()
Crosses() SetCoordinateDimension()
Destroy() SetPoint()
Difference() SetPoint_2D()
Disjoint() Simplify()
Distance() SimplifyPreserveTopology()
Empty() SymDifference()
Equal() SymmetricDifference()
Equals() Touches()
ExportToGML() Transform()
ExportToJson() TransformTo()
ExportToKML() Union()
ExportToWkb() UnionCascaded()
ExportToWkt() Within()
FlattenTo2D() WkbSize()
GetArea() WkbSize()
GetBoundary() next()
GetCoordinateDimension() LAYER CLASS
GetDimension() AlterFieldDefn()
GetEnvelope() Clip()
GetEnvelope3D() CommitTransaction()
GetGeometryCount() CreateFeature()
GetGeometryName() CreateField()
4 APPENDIX C OGR
CreateFields() Update()
CreateGeomField() next()
DeleteFeature() schema
DeleteField() STYLETABLE CLASS
Dereference() AddStyle()
Erase() Find()
FindFieldIndex() GetLastStyleName()
GetExtent() GetNextStyle()
GetFIDColumn() LoadStyleTable()
GetFeature() ResetStyleStringReading()
GetFeatureCount() SaveStyleTable()
GetFeaturesRead() SaveStyleTable()
GetGeomType()
MODULE FUNCTIONS
GetGeometryColumn()
ApproximateArcAngles()
GetLayerDefn()
BuildPolygonFromEdges()
GetName()
CreateGeometryFromGML()
GetNextFeature()
CreateGeometryFromJson()
GetRefCount()
CreateGeometryFromWkb()
GetSpatialFilter()
CreateGeometryFromWkt()
GetSpatialRef()
GetStyleTable() DontUseExceptions()
Identity() ForceToLineString()
Intersection() ForceToMultiLineString()
Reference() ForceToMultiPoint()
ReorderField() ForceToMultiPolygon()
ReorderFields() ForceToPolygon()
ResetReading() GeneralCmdLineProcessor()
RollbackTransaction() GeometryTypeToName()
SetAttributeFilter() GetDriver()
SetFeature() GetDriverByName()
SetIgnoredFields() GetDriverCount()
SetNextByIndex() GetFieldTypeName()
SetSpatialFilter() GetOpenDS()
SetSpatialFilterRect() GetOpenDSCount()
SetStyleTable() GetUseExceptions()
StartTransaction() Open()
SymDifference() OpenShared()
SyncToDisk() RegisterAll()
TestCapability() SetGenerate_DB2_V72_BYTE_ORDER()
Union() TermProgress_nocb()
Update() UseExceptions()
DataSource class 5
DeleteLayer(value)
Deletes the layer given an index or layer name.
Dereference()
For backward compatibility only.
Destroy()
Once called, self has effectively been destroyed. Do not access. For backward com-
patibility only.
6 APPENDIX C OGR
GetLayer(iLayer=0)
Returns the layer given an index or a name.
Reference()
For backward compatibility only.
Release()
Once called, self has effectively been destroyed. Do not access. For backward com-
patibility only.
ReleaseResultSet(Layer layer)
Releases results of OGR_DS_ExecuteSQL().
This function should only be used to deallocate OGRLayers resulting from an
OGR_DS_ExecuteSQL() call on the same OGRDataSource. Failure to deallocate a
results set before destroying the OGRDataSource may cause errors.
■ layer: Handle to the result of a previous OGR_DS_ExecuteSQL() call
SetStyleTable(StyleTable table)
One of the following data source capability names can be passed into this function,
and a True or False value will be returned indicating whether or not the capability is
available for this object.
ODsCCreateLayer: True if this data source can create new layers
The #define macro forms of the capability names should be used in preference to
the strings themselves to avoid misspelling.
■ cap: The capability to test
Returns True if capability available otherwise False.
It’s important to call OGR_DS_Destroy() when the data source is no longer used to
ensure that all data has been properly flushed to disk.
■ utf8_path: The name for the new data source. UTF-8 encoded.
■ options: A list of name=value option strings. Options are driver specific, and
driver information can be found at http://www.gdal.org/ogr/ogr_formats
.html.
Returns None is returned on failure, or a new OGRDataSource handle on success.
Deregister()
Register()
Dereference()
Destroy()
Once called, self has effectively been destroyed. Do not access. For backward com-
patibility only.
DumpReadable()
Dumps this feature in a human readable form.
This dumps the attributes, and geometry; however, it doesn’t definition informa-
tion (other than field types and names), nor does it report the geometry spatial refer-
ence system.
■ fpOut: The stream to write to, such as strout
ExportToJson(as_object=False, options=None)
Exports a GeoJSON object which represents the Feature. The as_object parameter
determines whether the returned value should be a Python object instead of a string.
Defaults to False. The options parameter is passed to Geometry.ExportToJson()
Feature class 11
GetField(fld_index)
GetFieldAsDateTime(int id)
Fetches field value as date and time.
Currently this method only works for OFTDate, OFTTime, and OFTDateTime fields.
■ id: The field to fetch, from 0 to GetFieldCount()-1
■ pnYear: (including century)
■ pnMonth: (1-12)
■ pnDay: (1-31)
■ pnHour: (0-23)
■ pnMinute: (0-59)
■ pnSecond: (0-59)
■ pnTZFlag: (0=unknown, 1=localtime, 100=GMT, see data model for details)
Returns True on success or False on failure.
GetFieldAsDoubleList(int id)
Fetches field value as a list of doubles.
Currently this function only works for OFTRealList fields.
■ id: The field to fetch, from 0 to GetFieldCount()-1
■ pnCount: An integer to put the list count (number of doubles) into
Returns the field value. This list is internal, and shouldn’t be modified, or freed. Its
lifetime may be brief. If *pnCount is zero on return, the returned pointer may be
None or non-None.
12 APPENDIX C OGR
GetFieldAsIntegerList(int id)
Fetches field value as a list of integers.
Currently this function only works for OFTIntegerList fields.
■ id: The field to fetch, from 0 to GetFieldCount()-1
■ pnCount: An integer to put the list count (number of integers) into
Returns the field value. This list is internal, and shouldn’t be modified, or freed. Its
lifetime may be brief. If *pnCount is zero on return, the returned pointer may be
None or non-None.
Returns a handle to the field definition (from the OGRFeatureDefn). This is an inter-
nal reference, and shouldn’t be deleted or modified.
Reference()
For specific types of features this operation may fail on illegal features ids. Gener-
ally, it always succeeds. Feature ids should be greater than or equal to zero, with the
exception of OGRNullFID (-1) indicating that the feature id is unknown.
■ fid: The new feature identifier value to assign
Returns On success OGRERR_NONE, or on failure of another value.
SetField(string name, int year, int month, int day, int hour, int minute, int second, int
tzflag)
SetField2(fld_index, value)
Returns OGRERR_NONE if the operation succeeds, even if several values aren’t trans-
ferred; otherwise, an error code.
SetStyleString(string the_string)
■ the_string: The style string to apply to this feature, cannot be None
16 APPENDIX C OGR
UnsetField(string name)
Clears a field, marking it as unset.
■ name: The field to unset
AddGeomFieldDefn(GeomFieldDefn defn)
Destroy()
Once called, self has effectively been destroyed. Don’t access. For backward com-
patibility only.
SetGeomType(OGRwkbGeometryType geom_type)
Assigns the base geometry type for the passed layer (the same as the feature
definition).
All geometry objects using this type must be of the defined type or a derived type.
The default upon creation is wkbUnknown, which allows for any geometry type. The
geometry type should generally not be changed after any OGRFeatures have been cre-
ated against this definition.
■ geom_type: The new type to assign
SetGeometryIgnored(int bIgnored)
Sets whether the geometry can be omitted when fetching features.
■ bIgnored: Ignore state
SetStyleIgnored(int bIgnored)
Sets whether the style can be omitted when fetching features.
■ bIgnored: Ignore state
18 APPENDIX C OGR
SetStyleIgnored(int bIgnored)
Sets whether the style can be omitted when fetching features.
■ bIgnored: Ignore state
SetIgnored(int bIgnored)
Sets whether this field should be omitted when fetching features.
■ bIgnored: Ignore state
FieldDefn class 19
SetJustify(OGRJustification justify)
Sets the justification for this field.
■ justify: The new justification
SetName(string name)
Resets the name of this field.
■ name: The new name to apply
SetPrecision(int precision)
Sets the formatting precision for this field in characters.
This should normally be zero for fields of types other than OFTReal.
■ precision: The new precision
SetType(OGRFieldType type)
Sets the type of this field. This should never be done to an OGRFieldDefn that is
already part of an OGRFeatureDefn.
■ type: The new field type
SetWidth(int width)
Sets the formatting width for this field in characters.
■ width: The new width
SetWidth(int width)
Sets the formatting width for this field in characters.
■ width: The new width
PROPERTIES
justify
Gets the justification for this field.
name
GetName(self) -> char
precision
Gets the formatting precision for this field. This should normally be zero for fields
of types other than OFTReal.
type
Fetches type of this field.
width
Gets the formatting width for this field.
20 APPENDIX C OGR
SetIgnored(int bIgnored)
SetName(string name)
SetSpatialRef(SpatialReference srs)
SetType(OGRwkbGeometryType type)
SetType(OGRwkbGeometryType type)
PROPERTIES
name
GetName(self) -> char
srs
GetSpatialRef(self) -> SpatialReference
type
GetType(self) -> OGRwkbGeometryType
AddPoint_2D(double x, double y)
AssignSpatialReference(SpatialReference reference)
Assigns spatial reference to this object.
Any existing spatial reference is replaced, but under no circumstances does this
result in the object being reprojected. It’s changing the interpretation of the existing
geometry. Note that assigning a spatial reference increments the reference count on
the OGRSpatialReference, but doesn’t copy it.
This is similar to the SFCOM IGeometry::put_SpatialReference() method.
■ reference: Handle on the new spatial reference system to apply
The centroid location is applied to the passed in OGRPoint object. The centroid
isn’t necessarily within the geometry.
This method relates to the SFCOM ISurface::get_Centroid() method; however, the
current implementation based on GEOS can operate on other geometry types such as
multipoint and linestring, and geometrycollections such as multipolygons. OGC SF
SQL 1.1 defines the operation for surfaces (polygons). SQL/MM-Part 3 defines the
operation for surfaces and multisurfaces (multipolygons).
This function is built on the GEOS library; check it for the definition of the geome-
try operation. If OGR is built without the GEOS library, this function will always fail,
issuing a CPLE_NotSupported error.
Returns OGRERR_NONE on success or OGRERR_FAILURE on error.
CloseRings()
Forces rings to be closed.
If this geometry, or any contained geometries has polygon rings that aren’t closed,
they will be closed by adding the starting point at the end.
Destroy()
Empty()
Clears geometry information. This restores the geometry to its initial state after
construction and before assignment of actual geometry.
This function relates to the SFCOM IGeometry::Empty() method.
FlattenTo2D()
Converts geometry to strictly 2D. In a sense this converts all Z coordinates to 0.0.
GetEnvelope()
Computes and returns the bounding envelope for this geometry in the passed
psEnvelope structure.
■ psEnvelope: The structure in which to place the results
GetEnvelope3D()
Computes and returns the bounding envelope (3D) for this geometry in the passed
psEnvelope structure.
■ psEnvelope: The structure in which to place the results
Returns OGR 1.9.0
GetPoint(int iPoint = 0)
GetPoint_2D(int iPoint = 0)
GetPoints(int nCoordDimension = 0)
Segmentize(double dfMaxLength)
Modifies the geometry such that it has no segment longer then the given distance.
Interpolated points will have Z and M values (if needed) set to 0. Distance computa-
tion is performed in 2D only.
■ dfMaxLength: The maximum distance between 2 points after segmentization
28 APPENDIX C OGR
SetCoordinateDimension(int dimension)
Sets the coordinate dimension.
This method sets the explicit coordinate dimension. Setting the coordinate dimen-
sion of a geometry to 2 should zero-out any existing Z values. Setting the dimension of
a geometry collection will not necessarily affect the children geometries.
■ dimension: New coordinate dimension value, either 2 or 3
This function is built on the GEOS library; check it for the definition of the geome-
try operation. If OGR is built without the GEOS library, this function will always fail,
issuing a CPLE_NotSupported error.
■ other: The other geometry
Returns a new geometry representing the union or None if an error occurs.
next()
Layer class 31
CreateFields(fields)
Creates a list of fields on the Layer.
Dereference()
For backward compatibility only.
The returned feature becomes the responsibility of the caller to delete with
OGR_F_Destroy(). It’s critical that all features associated with an OGRLayer (more spe-
cifically an OGRFeatureDefn) be deleted before that layer/data source is deleted.
This function implements sequential access to the features of a layer. The
OGR_L_ResetReading() function can be used to start at the beginning again.
Returns a handle to a feature or None if no more features are available.
Reference()
For backward compatibility only.
ResetReading()
Resets feature reading to start on the first feature.
This affects GetNextFeature().
active, or the rollback fails, will return OGRERR_FAILURE. Data sources that don’t sup-
port transactions will always return OGRERR_NONE.
Returns OGRERR_NONE on success.
SetStyleTable(StyleTable table)
next()
PROPERTIES
schema
ResetStyleStringReading()
Module functions 41
DontUseExceptions()
RegisterAll()
UseExceptions()
wkb25Bit wkbMultiPolygon
wkb25DBit wkbMultiPolygon25D
wkbGeometryCollection wkbNDR
wkbGeometryCollection25D wkbNone
wkbLineString wkbPoint
wkbLineString25D wkbPoint25D
wkbLinearRing wkbPolygon
wkbMultiLineString wkbPolygon25D
wkbMultiLineString25D wkbUnknown
wkbMultiPoint wkbXDR
wkbMultiPoint25D
44 APPENDIX C OGR
appendix D
OSR
45
46 APPENDIX D OSR
IsProjected() SetLocalCS()
IsSame() SetMC()
IsSameGeogCS() SetMercator()
IsSameVertCS() SetMollweide()
IsVertical() SetNZMG()
MorphFromESRI() SetNormProjParm()
MorphToESRI() SetOS()
SetACEA() SetOrthographic()
SetAE() SetPS()
SetAngularUnits() SetPolyconic()
SetAttrValue() SetProjCS()
SetAuthority() SetProjParm()
SetBonne() SetProjection()
SetCEA() SetRobinson()
SetCS() SetSOC()
SetCompoundCS() SetSinusoidal()
SetEC() SetStatePlane()
SetEckertIV() SetStereographic()
SetEckertVI() SetTM()
SetEquirectangular() SetTMG()
SetEquirectangular2() SetTMSO()
SetFromUserInput() SetTMVariant()
SetGEOS() SetTOWGS84()
SetGH() SetTargetLinearUnits()
SetGS() SetUTM()
SetGaussSchreiberTMercator() SetVDG()
SetGeocCS() SetVertCS()
SetGeogCS() SetWellKnownGeogCS()
SetGnomonic() StripCTParms()
SetHOM() Validate()
SetHOM2PNO() Validate()
SetIGH() MODULE FUNCTIONS
SetKrovak() CreateCoordinateTransformation()
SetLAEA() DontUseExceptions()
SetLCC() GetsProjectionMethods()
SetLCC1SP() GetsUseExceptions()
SetLCCB() GetsUserInputAsWKT()
SetLinearUnits() GetsWellKnownGeogCSAsWKT()
SetLinearUnitsAndUpdateParameters() UseExceptions()
SpatialReference class 47
TransformPoints(int nCount)
TransformPoints(int nCount)
Currently this returns TRUE for all geographic coordinate systems with an EPSG
code set, and AXIS values set defining it as lat, long. Note that coordinate systems with
an EPSG code and no axis settings will be assumed to not be lat/long.
FALSE will be returned for all coordinate systems that are not geographic, or that
don’t have an EPSG code set.
Returns TRUE or FALSE.
Returns value code from authority node, or NULL on failure. The value returned is
internal and should not be freed or modified.
Returns TRUE if this spatial reference is local—that is, if the root is a LOCAL_CS
node.
SetACEA(double stdp1, double stdp2, double clat, double clong, double fe, double
fn) -> OGRErr
SetAE(double clat, double clong, double fe, double fn) -> OGRErr
This method creates a UNIT subnode with the specified values as a child of the
GEOGCS node.
This method does the same as the C function OSRSetAngularUnits().
■ pszUnitsName: The unit’s name to be used. Several preferred unit names can
be found in ogr_srs_api.h, such as SRS_UA_DEGREE.
■ dfInRadians: The value to multiple by an angle in the indicated units to trans-
form to radians. Several standard conversion factors can be found in
ogr_srs_api.h.
Returns OGRERR_NONE on success.
SetBonne(double stdp, double cm, double fe, double fn) -> OGRErr
SetCEA(double stdp1, double cm, double fe, double fn) -> OGRErr
SetCS(double clat, double clong, double fe, double fn) -> OGRErr
SetEC(double stdp1, double stdp2, double clat, double clong, double fe, double fn) ->
OGRErr
SetEquirectangular(double clat, double clong, double fe, double fn) -> OGRErr
SetGEOS(double cm, double satelliteheight, double fe, double fn) -> OGRErr
SetGnomonic(double clat, double clong, double fe, double fn) -> OGRErr
SetHOM(double clat, double clong, double azimuth, double recttoskew, double scale,
double fe, double fn) -> OGRErr
Sets a Hotine Oblique Mercator projection using azimuth angle.
This projection corresponds to EPSG projection method 9812, also sometimes
known as Hotine Oblique Mercator (variant A).
This method does the same thing as the C function OSRSetHOM().
■ dfCenterLat: Latitude of the projection origin
■ dfCenterLong: Longitude of the projection origin
■ dfAzimuth: Azimuth, measured clockwise from North, of the projection center-
line
■ dfRectToSkew: Angle from rectified to skew grid
■ dfScale: Scale factor applies to the projection origin
■ dfFalseEasting: False easting
■ dfFalseNorthing: False northing
Returns OGRERR_NONE on success.
SetLAEA(double clat, double clong, double fe, double fn) -> OGRErr
58 APPENDIX D OSR
SetLCC(double stdp1, double stdp2, double clat, double clong, double fe, double fn)
-> OGRErr
SetLCC1SP(double clat, double clong, double scale, double fe, double fn) -> OGRErr
SetLCCB(double stdp1, double stdp2, double clat, double clong, double fe, double
fn) -> OGRErr
SetMC(double clat, double clong, double fe, double fn) -> OGRErr
SetMercator(double clat, double clong, double scale, double fe, double fn) ->
OGRErr
SetNZMG(double clat, double clong, double fe, double fn) -> OGRErr
SetOS(double dfOriginLat, double dfCMeridian, double scale, double fe, double fn)
-> OGRErr
SetOrthographic(double clat, double clong, double fe, double fn) -> OGRErr
SetPS(double clat, double clong, double scale, double fe, double fn) -> OGRErr
SetPolyconic(double clat, double clong, double fe, double fn) -> OGRErr
SetSOC(double latitudeoforigin, double cm, double fe, double fn) -> OGRErr
SetStatePlane(int zone, int is_nad83 = 1, string unitsname = "", double units = 0.0) ->
OGRErr
State plane.
Sets state plane projection definition.
This will attempt to generate a complete definition of a state plane zone based on
generating the entire SRS from the EPSG tables. If the EPSG tables are unavailable, it
will produce a stubbed LOCAL_CS definition and return OGRERR_FAILURE.
■ nZone: State plane zone number, in the USGS numbering scheme (as distinct
from the Arc/Info and Erdas numbering scheme).
■ bNAD83: TRUE if the NAD83 zone definition should be used, or FALSE if the
NAD27 zone definition should be used.
■ pszOverrideUnitName: Linear unit name to apply overriding the legal defini-
tion for this zone.
■ dfOverrideUnit: Linear unit conversion factor to apply overriding the legal def-
inition for this zone.
Returns OGRERR_NONE on success or OGRERR_FAILURE on failure, mostly likely due
to the EPSG tables not being accessible.
SetStereographic(double clat, double clong, double scale, double fe, double fn) ->
OGRErr
SetTM(double clat, double clong, double scale, double fe, double fn) -> OGRErr
SetTMG(double clat, double clong, double fe, double fn) -> OGRErr
SetTMSO(double clat, double clong, double scale, double fe, double fn) -> OGRErr
SpatialReference class 61
SetTOWGS84(double p1, double p2, double p3, double p4 = 0.0, double p5 = 0.0,
double p6 = 0.0, double p7 = 0.0) -> OGRErr
Sets the Bursa-Wolf conversion to WGS84.
This will create the TOWGS84 node as a child of the DATUM. It will fail if there’s no
existing DATUM node. Unlike most OGRSpatialReference methods, it will insert itself
in the appropriate order, and will replace an existing TOWGS84 node if one exists.
The parameters have the same meaning as EPSG transformation 9606 (Position
Vector 7-param. transformation).
■ dfDX: X child in meters
■ dfDY: Y child in meters
■ dfDZ: Z child in meters
■ dfEX: X rotation in arc seconds (optional, defaults to zero)
■ dfEY: Y rotation in arc seconds (optional, defaults to zero)
■ dfEZ: Z rotation in arc seconds (optional, defaults to zero)
■ dfPPM: Scaling factor (parts per million)
Returns OGRERR_NONE on success.
This will generate a projection definition with the full set of transverse mercator
projection parameters for the given UTM zone. If no PROJCS[] description is set yet,
one will be set to look like “UTM Zone %d, {Northern, Southern} Hemisphere.”
■ nZone: UTM zone
■ bNorth: TRUE for northern hemisphere or FALSE for southern hemisphere
Returns OGRERR_NONE on success.
DontUseExceptions()
GetsProjectionMethods(...)
UseExceptions()
SRS_PP_AZIMUTH
SRS_PP_CENTRAL_MERIDIAN
SRS_PP_False_EASTING
SRS_PP_False_NORTHING
SRS_PP_FIPSZONE
SRS_PP_LANDSAT_NUMBER
SRS_PP_LATITUDE_OF_1ST_POINT
SRS_PP_LATITUDE_OF_2ND_POINT
SRS_PP_LATITUDE_OF_CENTER
SRS_PP_LATITUDE_OF_ORIGIN
SRS_PP_LATITUDE_OF_POINT_1
SRS_PP_LATITUDE_OF_POINT_2
SRS_PP_LATITUDE_OF_POINT_3
SRS_PP_LONGITUDE_OF_1ST_POINT
SRS_PP_LONGITUDE_OF_2ND_POINT
SRS_PP_LONGITUDE_OF_CENTER
SRS_PP_LONGITUDE_OF_ORIGIN
SRS_PP_LONGITUDE_OF_POINT_1
SRS_PP_LONGITUDE_OF_POINT_2
SRS_PP_LONGITUDE_OF_POINT_3
SRS_PP_PATH_NUMBER
SRS_PP_PERSPECTIVE_POINT_HEIGHT
SRS_PP_PSEUDO_STD_PARALLEL_1
SRS_PP_RECTIFIED_GRID_ANGLE
SRS_PP_SATELLITE_HEIGHT
SRS_PP_SCALE_FACTOR
SRS_PP_STANDARD_PARALLEL_1
SRS_PP_STANDARD_PARALLEL_2
SRS_PP_ZONE
SRS_PT_ALBERS_CONIC_EQUAL_AREA
SRS_PT_AZIMUTHAL_EQUIDISTANT
SRS_PT_BONNE
SRS_PT_CASSINI_SOLDNER
SRS_PT_CYLINDRICAL_EQUAL_AREA
SRS_PT_ECKERT_I
SRS_PT_ECKERT_II
SRS_PT_ECKERT_III
SRS_PT_ECKERT_IV
SRS_PT_ECKERT_V
SRS_PT_ECKERT_VI
SRS_PT_EQUIDISTANT_CONIC
SRS_PT_EQUIRECTANGULAR
Module data 65
SRS_PT_GALL_STEREOGRAPHIC
SRS_PT_GAUSSSCHREIBERTMERCATOR
SRS_PT_GEOSTATIONARY_SATELLITE
SRS_PT_GNOMONIC
SRS_PT_GOODE_HOMOLOSINE
SRS_PT_HOTINE_OBLIQUE_MERCATOR
SRS_PT_HOTINE_OBLIQUE_MERCATOR_AZIMUTH_CENTER
SRS_PT_HOTINE_OBLIQUE_MERCATOR_TWO_POINT_NATURAL_ORIGIN
SRS_PT_IGH
SRS_PT_IMW_POLYCONIC
SRS_PT_KROVAK
SRS_PT_LABORDE_OBLIQUE_MERCATOR
SRS_PT_LAMBERT_AZIMUTHAL_EQUAL_AREA
SRS_PT_LAMBERT_CONFORMAL_CONIC_1SP
SRS_PT_LAMBERT_CONFORMAL_CONIC_2SP
SRS_PT_LAMBERT_CONFORMAL_CONIC_2SP_BELGIUM
SRS_PT_MERCATOR_1SP
SRS_PT_MERCATOR_2SP
SRS_PT_MILLER_CYLINDRICAL
SRS_PT_MOLLWEIDE
SRS_PT_NEW_ZEALAND_MAP_GRID
SRS_PT_OBLIQUE_STEREOGRAPHIC
SRS_PT_ORTHOGRAPHIC
SRS_PT_POLAR_STEREOGRAPHIC
SRS_PT_POLYCONIC
SRS_PT_ROBINSON
SRS_PT_SINUSOIDAL
SRS_PT_STEREOGRAPHIC
SRS_PT_SWISS_OBLIQUE_CYLINDRICAL
SRS_PT_TRANSVERSE_MERCATOR
SRS_PT_TRANSVERSE_MERCATOR_MI_21
SRS_PT_TRANSVERSE_MERCATOR_MI_22
SRS_PT_TRANSVERSE_MERCATOR_MI_23
SRS_PT_TRANSVERSE_MERCATOR_MI_24
SRS_PT_TRANSVERSE_MERCATOR_MI_25
SRS_PT_TRANSVERSE_MERCATOR_SOUTH_ORIENTED
SRS_PT_TUNISIA_MINING_GRID
SRS_PT_TWO_POINT_EQUIDISTANT
SRS_PT_VANDERGRINTEN
SRS_PT_WAGNER_I
SRS_PT_WAGNER_II
SRS_PT_WAGNER_III
66 APPENDIX D OSR
SRS_PT_WAGNER_IV
SRS_PT_WAGNER_V
SRS_PT_WAGNER_VI
SRS_PT_WAGNER_VII
SRS_UA_DEGREE
SRS_UA_DEGREE_CONV
SRS_UA_RADIAN
SRS_UL_CENTIMETER
SRS_UL_CENTIMETER_CONV
SRS_UL_CHAIN
SRS_UL_CHAIN_CONV
SRS_UL_DECIMETER
SRS_UL_DECIMETER_CONV
SRS_UL_FOOT
SRS_UL_FOOT_CONV
SRS_UL_INDIAN_CHAIN
SRS_UL_INDIAN_CHAIN_CONV
SRS_UL_INDIAN_FOOT
SRS_UL_INDIAN_FOOT_CONV
SRS_UL_INDIAN_YARD
SRS_UL_INDIAN_YARD_CONV
SRS_UL_INTL_CHAIN
SRS_UL_INTL_CHAIN_CONV
SRS_UL_INTL_FATHOM
SRS_UL_INTL_FATHOM_CONV
SRS_UL_INTL_FOOT
SRS_UL_INTL_FOOT_CONV
SRS_UL_INTL_INCH
SRS_UL_INTL_INCH_CONV
SRS_UL_INTL_LINK
SRS_UL_INTL_LINK_CONV
SRS_UL_INTL_NAUT_MILE
SRS_UL_INTL_NAUT_MILE_CONV
SRS_UL_INTL_STAT_MILE
SRS_UL_INTL_STAT_MILE_CONV
SRS_UL_INTL_YARD
SRS_UL_INTL_YARD_CONV
SRS_UL_KILOMETER
SRS_UL_KILOMETER_CONV
SRS_UL_LINK
SRS_UL_LINK_CONV
SRS_UL_LINK_Clarke
Module data 67
SRS_UL_LINK_Clarke_CONV
SRS_UL_METER
SRS_UL_MILLIMETER
SRS_UL_MILLIMETER_CONV
SRS_UL_NAUTICAL_MILE
SRS_UL_NAUTICAL_MILE_CONV
SRS_UL_ROD
SRS_UL_ROD_CONV
SRS_UL_US_CHAIN
SRS_UL_US_CHAIN_CONV
SRS_UL_US_FOOT
SRS_UL_US_FOOT_CONV
SRS_UL_US_INCH
SRS_UL_US_INCH_CONV
SRS_UL_US_STAT_MILE
SRS_UL_US_STAT_MILE_CONV
SRS_UL_US_YARD
SRS_UL_US_YARD_CONV
SRS_WGS84_INVFLATTENING
SRS_WGS84_SEMIMAJOR
SRS_WKT_WGS84
wkbMultiPolygon
wkbMultiPolygon25D
wkbNDR
wkbNone
wkbPoint
wkbPoint25D
wkbPolygon
wkbPolygon25D
wkbUnknown
wkbXDR
68 APPENDIX D OSR
appendix E
GDAL
69
70 APPENDIX E GDAL
SetColorTable() GetGeoTransform()
SetDefaultHistogram() GetProjection()
SetDefaultRAT() GetProjectionRef()
SetNoDataValue() GetRasterBand()
SetOffset() GetSubDatasets()
SetRasterCategoryNames() GetTiledVirtualMem()
SetRasterColorInterpretation() GetTiledVirtualMemArray()
SetRasterColorTable() GetVirtualMem()
SetScale() GetVirtualMemArray()
SetStatistics() ReadAsArray()
SetUnitType() ReadRaster()
WriteArray() ReadRaster1()
WriteRaster() SetGCPs()
DataType SetGeoTransform()
XSize SetProjection()
YSize WriteRaster()
COLORENTRY CLASS WriteRaster()
c1 RasterCount
c2 RasterXSize
c3 RasterYSize
c4 DRIVER CLASS
BeginAsyncReader() serialize()
BuildOverviews() GCPLine
CreateMaskBand() GCPPixel
EndAsyncReader() GCPX
FlushCache() GCPY
GetDriver() GCPZ
GetFileList() Id
GetGCPCount() Info
GetGCPProjection() MAJOROBJECT CLASS
GetGCPs() GetDescription()
Summary 71
GDAL_GCP_get_GCPLine() Mkdir()
GDAL_GCP_get_GCPPixel() Open()
GDAL_GCP_get_GCPX() OpenShared()
GDAL_GCP_get_GCPY() PackedDMSToDec()
GDAL_GCP_get_GCPZ() ParseXMLString()
GDAL_GCP_get_Id() Polygonize()
GDAL_GCP_get_Info() PopErrorHandler()
GDAL_GCP_set_GCPLine() PopFinderLocation()
GDAL_GCP_set_GCPPixel() PushErrorHandler()
GDAL_GCP_set_GCPX() PushFinderLocation()
GDAL_GCP_set_GCPY() RGBFile2PCTFile()
GDAL_GCP_set_GCPZ() RasterizeLayer()
GDAL_GCP_set_Id() ReadDir()
GDAL_GCP_set_Info() ReadDirRecursive()
GOA2GetAccessToken() RegenerateOverview()
GOA2GetAuthorizationURL() RegenerateOverviews()
GOA2GetRefreshToken() Rename()
GeneralCmdLineProcessor() ReprojectImage()
GetCacheMax() Rmdir()
GetCacheUsed() SerializeXMLTree()
GetColorInterpretationName() SetCacheMax()
GetConfigOption() SetConfigOption()
GetDataTypeByName() SetErrorHandler()
GetDataTypeName() SieveFilter()
GetDataTypeSize() TermProgress_nocb()
GetDriver() Unlink()
GetDriverByName() UseExceptions()
GetDriverCount() VSIFCloseL()
GetLastErrorMsg() VSIFOpenL()
GetLastErrorNo() VSIFReadL()
GetLastErrorType() VSIFSeekL()
GetPaletteInterpretationName() VSIFTellL()
GetUseExceptions() VSIFTruncateL()
HasThreadSupport() VSIFWriteL()
IdentifyDriver() VSIStatL()
InvGeoTransform() VersionInfo()
AsyncReader class 73
UnlockBuffer()
Unlocks image buffer.
Releases a lock on the image buffer previously taken with LockBuffer().
UnlockBuffer()
Unlocks image buffer.
Releases a lock on the image buffer previously taken with LockBuffer().
ComputeBandStats(int samplestep = 1)
ComputeRasterMinMax(int approx_ok = 0)
Computes the min/max values for a band.
If approximate is OK, then the band’s GetMinimum()/GetMaximum() will be
trusted. If it doesn’t work, a subsample of blocks will be read to get an approximate
min/max. If the band has a nodata value, it will be excluded from the minimum and
maximum.
If bApprox is FALSE, then all pixels will be read and used to compute an exact
range.
■ bApproxOK: TRUE if an approximate (faster) answer is OK; otherwise, FALSE
■ adfMinMax: The array in which the minimum (adfMinMax[0]) and the maxi-
mum (adfMinMax[1]) are returned
Returns CE_None on success or CE_Failure on failure.
FlushCache()
Flushes raster data cache.
This call will recover memory used to cache data blocks for this raster band, and
ensure that new requests are referred to the underlying driver.
Returns CE_None on success.
This method returns the band that this GDALRasterBand object represents within
its dataset. This method may return a value of zero to indicate GDALRasterBand
objects without an apparently relationship to a dataset, such as GDALRasterBands serv-
ing as overviews.
Returns band number (1+) or zero if the band number isn’t known.
GetBlockSize()
Fetches the “natural” block size of this band.
GDAL contains a concept of the natural block size of rasters so that applications
can organize data access efficiently for certain file formats. The natural block size is
the block size that’s most efficient for accessing the format. For many formats, this
is simply a whole scan line in which case *pnXSize is set to GetXSize(), and *pnYSize
is set to 1.
However, for tiled images this will typically be the tile size.
Note that the X and Y block sizes don’t have to divide the image size evenly, mean-
ing that right and bottom edge blocks may be incomplete. See ReadBlock() for an
example of code dealing with these issues.
■ pnXSize: Integer to put the X block size into or NULL.
■ pnYSize: Integer to put the Y block size into or NULL.
GetHistogram(double min = -0.5, double max = 255.5, int buckets = 256, int
include_out_of_range = 0, int approx_ok = 1, GDALProgressFunc callback = 0, void
callback_data = None) -> CPLErr
Computes raster histogram.
Note that the bucket size is (dfMax-dfMin) / nBuckets.
For example, to compute a simple 256-entry histogram of 8-bit data, the following
would be suitable. The unusual bounds are to ensure that bucket boundaries don’t
fall right on integer values causing possible errors due to rounding after scaling.
Note that setting bApproxOK will generally result in a subsampling of the file, and
will utilize overviews if available. It should generally produce a representative histo-
gram for the data that’s suitable for use in generating histogram-based LUTs, for
instance. Generally, bApproxOK is much faster than an exactly computed histogram.
78 APPENDIX E GDAL
■ GMF_ALPHA(0x04): The mask band is actually an alpha band and may have val-
ues other than 0 and 255.
■ GMF_NODATA(0x08): Indicates the mask is actually being generated from no-
data values. (mutually exclusive of GMF_ALPHA)
The GDALRasterBand class includes a default implementation of GetMaskBand() that
returns one of four default implementations:
■ If a corresponding .msk file exists, it will be used for the mask band.
■ If the dataset has a NODATA_VALUES metadata item, an instance of the new
GDALNoDataValuesMaskBand class will be returned. GetMaskFlags() will
return GMF_NODATA | GMF_PER_DATASET. Since GDAL 1.6.0.
■ If there is no no-data value, but the dataset has an alpha band that seems to
apply to this band (specific rules yet to be determined) and that is of type
GDT_Byte, then that alpha band will be returned, and the flags
GMF_PER_DATASET and GMF_ALPHA will be returned in the flags.
■ If neither of the above applies, an instance of the new GDALAllValidRasterBand
class will be returned that has 255 values for all pixels. The null flags will return
GMF_ALL_VALID.
Since GDAL 1.5.0.
Returns a valid mask band.
See also http://trac.osgeo.org/gdal/wiki/rfc15_nodatabitmask.
GetMaximum()
Fetches the maximum value for this band.
For file formats that don’t know this intrinsically, the maximum supported value for
the data type will generally be returned.
■ pbSuccess: Pointer to a Boolean to use to indicate if the returned value is a tight
maximum or not. May be NULL (default).
Returns the maximum raster value (excluding no data pixels).
GetMinimum()
Fetches the minimum value for this band.
For file formats that don’t know this intrinsically, the minimum supported value for
the data type will generally be returned.
■ pbSuccess: Pointer to a Boolean to use to indicate if the returned value is a tight
minimum or not. May be NULL (default).
Returns the minimum raster value (excluding no data pixels).
GetNoDataValue()
Fetches the no-data value for this band.
If it doesn’t have out-of-data value, an out-of-range value will generally be returned.
The no-data value for a band is generally a special marker value used to mark pixels
80 APPENDIX E GDAL
that aren’t valid data. Such pixels should generally not be displayed, nor contribute to
analysis operations.
■ pbSuccess: Pointer to a Boolean to use to indicate if a value is associated with
this layer. May be NULL (default).
Returns the no-data value for this band.
GetOffset()
Fetches the raster value offset.
This value (in combination with the GetScale() value) is used to transform raw
pixel values into the units returned by GetUnits(). For example, this might be used to
store elevations in GUInt16 bands with a precision of 0.1, and starting from -100.
Units value = (raw value * scale) + offset
For file formats that don’t know this intrinsically, a value of zero is returned.
■ pbSuccess: Pointer to a Boolean to use to indicate if the returned value is mean-
ingful or not. May be NULL (default).
Returns the raster offset.
GetScale()
Fetches the raster value scale.
This value (in combination with the GetOffset() value) is used to transform raw
pixel values into the units returned by GetUnits(). For example, this might be used to
store elevations in GUInt16 bands with a precision of 0.1, and starting from -100.
Units value = (raw value * scale) + offset
For file formats that don’t know this intrinsically, a value of one is returned.
■ pbSuccess: Pointer to a Boolean to use to indicate if the returned value is mean-
ingful or not. May be NULL (default).
Band class 81
will be returned. The returned string should not be modified, nor freed by the calling
application.
Returns unit name string.
GetVirtualMem(GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize,
int nBufXSize, int nBufYSize, GDALDataType eBufType, size_t nCacheSize, size_t
nPageSizeHint, string options = None) -> VirtualMem
■ pnPixelSpace: Output parameter giving the byte offset from the start of one
pixel value in the buffer to the start of the next pixel value within a scan line.
■ pnLineSpace: Output parameter giving the byte offset from the start of one
scan line in the buffer to the start of the next.
■ papszOptions: NULL-terminated list of options. If a specialized implementation
exists, defining USE_DEFAULT_IMPLEMENTATION=YES will cause the default
implementation to be used. When requiring or falling back to the default
implementation, the following options are available: CACHE_SIZE (in bytes,
defaults to 40 MB), PAGE_SIZE_HINT (in bytes), SINGLE_THREAD (“FALSE” /
“TRUE”, defaults to FALSE).
Returns a virtual memory object that must be unreferenced by CPLVirtualMemFree(),
or NULL in case of failure.
Since GDAL 1.11.
GetVirtualMemAutoArray(eAccess=0, options=None)
Returns a NumPy array for the band, seen as a virtual memory mapping. An ele-
ment is accessed with array[y][x]. Any reference to the array must be dropped before
the last reference to the related dataset is also dropped.
■ pImage: The buffer into which the data will be read. The buffer must be large
enough to hold GetBlockXSize()*GetBlockYSize() words of type GetRaster-
DataType().
Returns CE_None on success or CE_Failure on an error.
ReadRaster1(int xoff, int yoff, int xsize, int ysize, int buf_xsize = None, int buf_ysize =
None, int buf_type = None, int buf_pixel_space = None, int buf_line_space = None)
-> CPLErr
Associates a default RAT with the band. If not implemented for the format, a
CPLE_NotSupported error will be issued. If successful, a copy of the RAT is made; the
original remains owned by the caller.
■ poRAT: The RAT to assign to the band.
Returns CE_None on success or CE_Failure if unsupported or otherwise failing.
SetStatistics(double min, double max, double mean, double stddev) -> CPLErr
Sets statistics on band.
This method can be used to store min/max/mean/standard deviation statistics on
a raster band.
The default implementation stores them as metadata, and will only work on formats
that can save arbitrary metadata. This method cannot detect whether metadata will be
properly saved and so may return CE_None even if the statistics will never be saved.
■ dfMin: Minimum pixel value
86 APPENDIX E GDAL
WriteRaster(int xoff, int yoff, int xsize, int ysize, GIntBig buf_len, int buf_xsize =
None, int buf_ysize = None, int buf_type = None, int buf_pixel_space = None, int
buf_line_space = None) -> CPLErr
PROPERTIES
DataType
Band_DataType_get(Band self) -> GDALDataType
XSize
Band_XSize_get(Band self) -> int
YSize
Band_YSize_get(Band self) -> int
c2
ColorEntry_c2_get(ColorEntry self) -> short
c3
ColorEntry_c3_get(ColorEntry self) -> short
c4
ColorEntry_c4_get(ColorEntry self) -> short
ColorTable class 87
EndAsyncReader(AsyncReader ario)
FlushCache()
GetGCPs()
GetSubDatasets()
GetVirtualMem(GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize,
int nBufXSize, int nBufYSize, GDALDataType eBufType, int band_list, int bIsBand-
Sequential, size_t nCacheSize, size_t nPageSizeHint, string options = None) -> Virtual-
Mem
ReadRaster1(int xoff, int yoff, int xsize, int ysize, int buf_xsize = None, int buf_ysize =
None, GDALDataType buf_type = None, int band_list = 0, int buf_pixel_space =
None, int buf_line_space = None, int buf_band_space = None) -> CPLErr
PROPERTIES
RasterCount
Dataset_RasterCount_get(Dataset self) -> int
RasterXSize
Dataset_RasterXSize_get(Dataset self) -> int
RasterYSize
Dataset_RasterYSize_get(Dataset self) -> int
Create(string utf8_path, int xsize, int ysize, int bands = 1, GDALDataType eType =
GDT_Byte, string options = None) -> Dataset
Creates a new dataset with this driver.
What argument values are legal for particular drivers is driver-specific, and you
have no way to query in advance to establish legal values.
That function will try to validate the creation option list passed to the driver with
the GDALValidateCreationOptions() method. This check can be disabled by defining
the configuration option GDAL_VALIDATE_CREATION_OPTIONS=NO.
After you have finished working with the returned dataset, it’s required to close it
with GDALClose(). This not only closes the file handle, but also ensures that all the
data and metadata has been written to the dataset (GDALFlushCache() isn’t sufficient
for that purpose).
In certain situations, the new dataset can be created in another process through
the GDAL API Proxy mechanism.
In GDAL 2, the arguments nXSize, nYSize, and nBands can be passed to zero when
creating a vector-only dataset for a compatible driver.
Equivalent of the C function GDALCreate().
■ pszFilename: The name of the dataset to create. UTF-8 encoded.
■ nXSize: Width of created raster in pixels.
■ nYSize: Height of created raster in pixels.
■ nBands: Number of bands.
■ eType: Type of raster.
■ papszOptions: List of driver-specific control parameters. The
APPEND_SUBDATASET=YES option can be specified to avoid prior destruction of
existing dataset.
Returns NULL on failure, or a new GDALDataset.
CreateCopy(string utf8_path, Dataset src, int strict = 1, string options = None, GDAL-
ProgressFunc callback = 0, void callback_data = None) -> Dataset
Creates a copy of a dataset.
This method will attempt to create a copy of a raster dataset with the indicated file-
name, and in this driver’s format. Band number, size, type, projection, geotransform,
and so forth are all to be copied from the provided template dataset.
Note that many sequential write-once formats (such as JPEG and PNG) don’t imple-
ment the Create() method but do implement this CreateCopy() method. If the driver
doesn’t implement CreateCopy() but does implement Create(), then the default
CreateCopy() mechanism built on calling Create() will be used.
It’s intended that CreateCopy() will often be used with a source dataset that’s a vir-
tual dataset allowing configuration of band types, and other information without
duplicating raster data (see the VRT driver). This is what’s done by the gdal_translate
utility, for example.
92 APPENDIX E GDAL
That function will try to validate the creation option list passed to the driver with
the GDALValidateCreationOptions() method. This check can be disabled by defining
the configuration option GDAL_VALIDATE_CREATION_OPTIONS=NO.
After you’ve finished working with the returned dataset, it’s required to close it
with GDALClose(). This not only closes the file handle, but also ensures that all the
data and metadata has been written to the dataset (GDALFlushCache() isn’t sufficient
for that purpose).
In certain situations, the new dataset can be created in another process through
the GDAL API proxy mechanism.
■ pszFilename: The name for the new dataset. UTF-8 encoded.
■ poSrcDS: The dataset being duplicated.
■ bStrict: TRUE if the copy must be strictly equivalent, or more normally FALSE
indicating that the copy may adapt as needed for the output format.
■ papszOptions: Additional format-dependent options controlling creation of the
output file. The APPEND_SUBDATASET=YES option can be specified to avoid
prior destruction of existing dataset.
■ pfnProgress: A function to be used to report progress of the copy.
■ pProgressData: Application data passed into progress function.
Returns a pointer to the newly created dataset (may be read-only access).
Deregister()
4PROPERTIES
4HelpTopic
Driver_HelpTopic_get(Driver self) -> char
LongName
Driver_LongName_get(Driver self) -> char
ShortName
Driver_ShortName_get(Driver self) -> char
PROPERTIES
GCPLine
GCP_GCPLine_get(GCP self) -> double
GCPPixel
GCP_GCPPixel_get(GCP self) -> double
GCPX
GCP_GCPX_get(GCP self) -> double
GCPY
GCP_GCPY_get(GCP self) -> double
GCPZ
GCP_GCPZ_get(GCP self) -> double
Id
GCP_Id_get(GCP self) -> char
Info
GCP_Info_get(GCP self) -> char
GetMetadata(domain='')
Fetches metadata.
The returned string list is owned by the object, and may change at any time. It’s
formatted as a “Name=value” list with the last pointer value being NULL. Use the CPL
StringList functions such as CSLFetchNameValue() to manipulate it.
Note that relatively few formats return any metadata at this time.
This method does the same thing as the C function GDALGetMetadata().
■ pszDomain: The domain of interest. Use "" or NULL for the default domain.
Returns NULL or a string list.
SetDescription(string pszNewDesc)
Sets object description.
The semantics of the description are specific to the derived type. For GDALDatasets,
it’s the dataset name. For GDALRasterBands, it’s a description (if supported) or "".
Normally application code should not set the “description” for GDALDatasets. It’s
handled internally.
SetRowCount(int nCount)
Sets row count.
98 APPENDIX E GDAL
Resizes the table to include the indicated number of rows. Newly created rows will
be initialized to their default values: "" for strings, and zero for numeric fields.
■ nNewCount: The new number of rows
PROPERTIES
mode
StatBuf_mode_get(StatBuf self) -> int
mtime
StatBuf_mtime_get(StatBuf self) -> GIntBig
size
StatBuf_size_get(StatBuf self) -> GIntBig
deprecation_warn(module)
DitherRGB2PCT(Band red, Band green, Band blue, Band target, ColorTable colors,
GDALProgressFunc callback = 0, void callback_data = None) -> int
DontUseExceptions()
ErrorReset()
100 APPENDIX E GDAL
FinderClean()
GDALDestroyDriverManager()
PopErrorHandler()
PopFinderLocation()
PushFinderLocation(char utf8_path)
RGBFile2PCTFile(src_filename, dst_filename)
SetCacheMax(GIntBig nBytes)
SieveFilter(Band srcBand, Band maskBand, Band dstBand, int threshold, int connect-
edness = 4, string options = None, GDALProgressFunc callback = 0, void
callback_data = None) -> int
104 APPENDIX E GDAL
UseExceptions()
VSIFCloseL(VSILFILE arg0)
DMD_SUBDATASETS GFU_AlphaMin
GARIO_COMPLETE GFU_Blue
GARIO_ERROR GFU_BlueMax
GARIO_PENDING GFU_BlueMin
GARIO_UPDATE GFU_Generic
GA_ReadOnly GFU_Green
GA_Update GFU_GreenMax
GCI_AlphaBand GFU_GreenMin
GCI_BlackBand GFU_Max
GCI_BlueBand GFU_MaxCount
GCI_CyanBand GFU_Min
GCI_GrayIndex GFU_MinMax
GCI_GreenBand GFU_Name
GCI_HueBand GFU_PixelCount
GCI_LightnessBand GFU_Red
GCI_MagentaBand GFU_RedMax
GCI_PaletteIndex GFU_RedMin
GCI_RedBand
GF_Read
GCI_SaturationBand
GF_Write
GCI_Undefined
GMF_ALL_VALID
GCI_YCbCr_CbBand
GMF_ALPHA
GCI_YCbCr_CrBand
GMF_NODATA
GCI_YCbCr_YBand
GMF_PER_DATASET
GCI_YellowBand
GPI_CMYK
GDT_Byte
GPI_Gray
GDT_CFloat32
GPI_HLS
GDT_CFloat64
GPI_RGB
GDT_CInt16
GDT_CInt32 GRA_Average
GDT_Float32 GRA_Bilinear
GDT_Float64 GRA_Cubic
GDT_Int16 GRA_CubicSpline
GDT_Int32 GRA_Lanczos
GDT_TypeCount GRA_Mode
GDT_UInt16 GRA_NearestNeighbour
GDT_UInt32 GTO_BIT
GDT_Unknown GTO_BSQ
GFT_Integer GTO_TIP
GFT_Real TermProgress
GFT_String VSI_STAT_EXISTS_FLAG
GFU_Alpha VSI_STAT_NATURE_FLAG
GFU_AlphaMax VSI_STAT_SIZE_FLAG
PYTHON/GIS
T
his book is about the science of reading, analyzing, and
presenting geospatial data programmatically, using
Python. Thanks to dozens of open source Python libraries
and tools, you can take on professional geoprocessing tasks
without investing in expensive proprietary packages like
“demonstrates
Marvelous resource that
the ultimate
ArcGIS and MapInfo. The book shows you how. power of geospatial
Geoprocessing with Python teaches you how to access available
datasets to make maps or perform your own analyses using
data processing!
”
—Dr. Rizwan Bulbul
Institute of Space Technology
free tools like the GDAL, NumPy, and matplotlib Python Pakistan
modules. Through lots of hands-on examples, you’ll master
core practices like handling multiple vector file formats,
editing geometries, applying spatial and attribute filters,
working with projections, and performing basic analyses on “inCode examples may be
Python, but concepts
vector data. The book also covers how to manipulate, work for all languages.
resample, and analyze raster data, such as aerial photographs
and digital elevation models.
Great book.
”
—Karsten Strøbæk
Microsoft, Western Europe
What’s Inside Consulting Services
● Geoprocessing from the ground up
●
●
Work with vector data
Read, write, process, and analyze raster data
“professionals
A must-have for
wishing
GIS