geodata
add_info(metadata, info)
¶
Add the :py:func:ogrinfo
output to the metadata returned by
:py:func:download_extract
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metadata
|
dict
|
Metadata returned by :py:func: |
required |
info
|
dict
|
:py:func: |
required |
Source code in bag3d/common/utils/geodata.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
|
attributes_dict(attributes_str)
¶
[ { "name": attribute name, "type": value type, "constraints" value constraints }, ... ]
Source code in bag3d/common/utils/geodata.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
|
bbox_from_wkt(wkt)
¶
Returns the BBOX of a WKT Polygon.
Source code in bag3d/common/utils/geodata.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
ogr2postgres(context, dataset, extract_path, feature_type, xsd, new_table)
¶
ogr2ogr a layer from zipped data extract from GML into Postgres.
It was developed for loading the TOP10NL and BGT extracts that are downloaded from the PDOK API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
context
|
OpExecutionContext
|
Op execution context from Dagster. |
required |
dataset
|
str
|
Name of the dataset ('top10nl', 'bgt'). |
required |
extract_path
|
Path
|
Local path to the zipped extract. |
required |
feature_type
|
str
|
The feature layer to load from the |
required |
xsd
|
str
|
Path (URL) to the XSD file. |
required |
new_table
|
PostgresTableIdentifier
|
The name of the new Postgres table to load the data into. |
required |
Returns:
Runs :py:func:postgrestable_metadata
on return and returns a dict of metadata
of the new_table
loaded with data.
Source code in bag3d/common/utils/geodata.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
|
ogrinfo(context, dataset, extract_path, feature_types, xsd)
¶
Runs ogrinfo on the zipped extract.
Source code in bag3d/common/utils/geodata.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
parse_ogrinfo(ogrinfo_stdout, feature_type)
¶
Parses the stdout of ogrinfo into a dictionary.
Source code in bag3d/common/utils/geodata.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
parse_ogrinfo_attributes(attributes_str)
¶
Parses the attributes list of the ogrinfo stdout into a :py:class:TableSchema
Source code in bag3d/common/utils/geodata.py
101 102 103 104 105 |
|
pdal_info(pdal, file_path, with_all=False)
¶
Run 'pdal info' on a point cloud file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pdal
|
AppImage
|
The pdal AppImage executable. |
required |
file_path
|
Path
|
Path to the point cloud file. |
required |
with_all
|
bool
|
If true, run |
False
|
Returns: A tuple of (pdal's return code, parsed pdal info output)
Source code in bag3d/common/utils/geodata.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
|