The Geospatial Data Abstraction Library (GDAL) is a computer software library for reading and writing raster and vector geospatial data formats. #tips#tricks
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 https://t.co/B54RUesTWo . More in the thread below (1/n)
GDAL 3.6.1 is released: https://t.co/oLWhbDjbgI . 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
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
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"]
Hey @STACspec curious folks! @petegadomski is adding STAC output of the @GdalOrg `gdalinfo -json` command https://t.co/IHZ8b8WfY2 which was an idea hatched at #FOSS4G2022 because good things happen when people meet in person 🙂
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)
I love the way, #fiona is done: you just `https://t.co/EddGcQhGML()` 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 https://t.co/EddGcQhGML("dataset.gpkg") as ds:
print(dir(ds))
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: https://t.co/3cCQWkhjcF
file: https://t.co/V4Rp9GDzBM