vector
This module contains a set of functions to deal with OGR geometries
get_bbox_wgs84(vector_file)
¶
Returns the bounding box in WGS84 CRS from a vector data
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector_file |
str
|
vector data filename |
required |
Returns:
| Type | Description |
|---|---|
BoundingBox
|
bounding box in WGS84 CRS (BoundingBox instance) |
Source code in scenes/vector.py
ogr_open(vector_file)
¶
Return the vector dataset from a vector file. If the vector is empty, None is returned.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector_file |
str
|
input vector file |
required |
Returns:
| Type | Description |
|---|---|
DataSource
|
ogr ds, or None (if error) |
Source code in scenes/vector.py
poly_union(layer)
¶
Compute the union all the geometrical features of layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer |
Layer
|
The layer |
required |
Returns:
| Type | Description |
|---|---|
Geometry
|
the union of the layer's polygons (as a geometry) |
Source code in scenes/vector.py
reproject_ogr_layer(layer, epsg=4326)
¶
Reproject the input polygon
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer |
Layer
|
OGR layer |
required |
epsg |
int
|
EPSG number (int) |
4326
|
Returns:
| Type | Description |
|---|---|
Geometry
|
New polygon projected in the specified CRS |