gdal_cr
Version, currently master branch1 version
- master branchlatestMar 11, 2020
github.com/ricardog/gdal_cr
A very thin crystal wrapper for GDAL
Installation
# Add this to your shard.yml
dependencies:
gdal_cr:
github: ricardog/gdal_cr
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.33.0- License
- MIT
- Author
- Ricardo E. Gonzalez
Dependencies
This version declares no dependencies.
README
gdal.cr
This is a very thin crystal wrapper for GDAL.
This library provides a very thin wrapper for GDAL. It does not provide any abstraction on top of the C API so you end up writing C code in crystal, i.e. you need to do all the memory management (see the GDAL API documentation for more info).
The GDAL library error handling mechanism by default logs stuff to stdout. You can silence these messages by setting GDAL::CPL.silence_failures to true (see sample.cr). I also provide a couple of functions to wrap calls to GDAL that turn errors into exceptions.
See sample.cr for a couple of use cases.
Installation
-
Install the GDAL libraries (and optionally binaries). The build require that
gdal-configbe in your path. On Ubuntu you can runsudo apt-get install libgdal-dev gdal-bin gdal-data -
Add the dependency to your
shard.yml:dependencies: gdal.cr: github: ricardog/gdal.cr -
Run
shards install
Usage
require "gdal.cr"
See sample.cr for some example of how to interface with the GDAL API.
Development
I use vagrant to create and run docker containers for development and testing but YMMV. If vagrant doesn't work for you, you can run docker directly. I develop on Ubuntu-based containers, c.f. Dockerfile.
- Create and start a container.
vagrant up
The container run the play server (on port 8080). Go to
http://${DOCKER_HOST}:8080/ to see the playgorund.
- Run a shell in the docker container
vagrant docker-exec -it -- /bin/bash
- RUn the compiler in the container
cd gdal.cr
crystal src/sample.cr
Contributing
- Fork it (https://github.com/your-github-user/gdal.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Ricardo E. Gonzalez - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Mar 11, 2020
- Crystal
0.33.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/ricardog/gdal_cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 16, 2026
- Synced
- Aug 16, 2026
- Versions
- 1