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

Joined December 2020
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=PL… . More in the thread below (1/n)
3
82
1
303
18,824
gdaltips retweeted
GDAL 3.6.1 is released: lists.osgeo.org/pipermail/gd… . 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
You have a look at this great tutorial about @gdalorg tools courses.spatialthoughts.com/… Put together by @spatialthoughts Ujaval Gandhi
Big push for the #MapServer !
Oh so close now! Proud to help announce the massive MapServer 8.0.0-rc2 release today. Announcement: mapserver.org/development/an… #foss4g #ribbon #sharing
1
11
You can also reach to feature of certain index using standard @Python list indexing
1
3
gdaltips retweeted
GDAL 3.5.2 release candidate available for your testing: lists.osgeo.org/pipermail/gd…
2
14
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
2
7
oh ... outputdir/output-file-{X}-{Y}.gpkg is better ogr2ogr will not create just files in the output directory sorry for that
4
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"]
7
The data source behaves like list of features. You need just number of features? Simply use `len()` function
4
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))
1
5
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)
1
3
Big thanks for promoting @python and #geospatial 🐍🗺️
4
7
State of PDAL talk from FOSS4G2022 - Slides: tinyurl.com/pdal2022
17
35
gdaltips retweeted
Slides of "State of GDAL" talk given last week at #FOSS4G2022 available at download.osgeo.org/gdal/pres…
19
46
You can use @gdalorg @python bindings, but writing code using #GDAL is like writing C++ code using pythonish syntax - not very python. But there is #fiona library for basic vector file manipulation. pip install fiona docs: fiona.readthedocs.io/en/stab… file: file.io/kab3EwQOQ88R
9
Let's do some Python: @GdalOrg is great for not only the command line tools, but also for it's Python bingins. You can found great examples in the pcjericks.github.io/py-gdalo… But it can be done more pythonish way, using some libraries provided by @sgillies
3
2
17