gdaltips

390 posts

gdaltips banner
gdaltips

gdaltips

@gdaltips

The Geospatial Data Abstraction Library (GDAL) is a computer software library for reading and writing raster and vector geospatial data formats. #tips #tricks

Katılım Aralık 2020
167 Takip Edilen1.8K Takipçiler
gdaltips retweetledi
Ujaval Gandhi
Ujaval Gandhi@spatialthoughts·
My "Mastering #GDAL Tools" course is now available on YouTube! This course is the result of my 20 years of experience processing large volumes of imagery and building data pipelines. Check out the playlist at youtube.com/playlist?list=… . More in the thread below (1/n)
Ujaval Gandhi tweet media
English
3
83
307
18.8K
gdaltips retweetledi
gdal org
gdal org@GdalOrg·
GDAL 3.6.1 is released: lists.osgeo.org/pipermail/gdal… . Users of 3.6.0 *should* migrate to 3.6.1 to avoid a potential corruption of the spatial index of GeoPackage files generated by 3.6.0
English
0
18
43
0
gdaltips
gdaltips@gdaltips·
You can also reach to feature of certain index using standard @Python list indexing
gdaltips tweet media
English
0
1
4
0
gdaltips
gdaltips@gdaltips·
oh ... outputdir/output-file-{X}-{Y}.gpkg is better ogr2ogr will not create just files in the output directory sorry for that
English
0
0
5
0
gdaltips
gdaltips@gdaltips·
Just needed to cut big vector dataset into smaller chunks. With some 🐍 code and dirty ogr2ogr call from the subprocess module, you can put together several ogr2ogr -clipsrc 0 0 100 100 output_dir input_file.gpkg -nlt MULTILINESTRING Change the -clipsrc values and repeat
English
2
0
8
0
gdaltips
gdaltips@gdaltips·
You can also loop through all features using simple `for` loop. #fiona converts input featurs in to the @GeoJSON structure, so accessing it's properties is easy feature["properties"]["name"]
gdaltips tweet media
English
0
0
8
0
gdaltips
gdaltips@gdaltips·
The data source behaves like list of features. You need just number of features? Simply use `len()` function
gdaltips tweet media
English
0
0
5
0
gdaltips
gdaltips@gdaltips·
All important datasource attributes are stored in `meta` attributes - including name, file name, coordinate reference system and attribute schema. (used along with json.dumps( ...., indent=4) for better readability)
gdaltips tweet mediagdaltips tweet media
English
0
0
4
0
gdaltips
gdaltips@gdaltips·
I love the way, #fiona is done: you just `fiona.open()` the dataset and can use the code block to close it automatically. if you `dir()` the data source, you can see all the object attributes. with fiona.open("dataset.gpkg") as ds: print(dir(ds))
English
1
0
6
0