RasterIO.jl

200 views
Skip to first unread message

Marcio Sales

unread,
Sep 2, 2015, 12:03:28 AM9/2/15
to julia-users
Hello all
As a statistician and GIS practitioner, of course I'm interested in that package. I've made a fork and started to play with the GDal functions, and now I'm in condition to start contributing. As a start, I've made a function to reproject a raster, with a choice to save a new file to disk or just return the result as a new Raster object.

I have a question about the Raster object though. It has a Data field that I'm not sure if it loads the raster to the memory or just keeps a reference to the values.

I would prefer to keep just the reference and then tried to redefine the raster type to have a gdaldataset field that keeps the handle to the dataset. This way, I could write other functions to fetch data and keep just the data I need in memory.

However, as this reference is returned by a C function, I wonder what happens to it when I delete or replace the value of the raster object created. Is the reference destroyed automatically? I tried to use the finalize function but it didnt work.

Also, is there a way to write a function that mimics matrix indexing, like making raster[i,j] invoke a GDAL function to fetch the values at i,j?

Also, two suggestion to the owners:
a) a constructor to Raster(filename) instead of the openraster function (if this is possible)
b) what about naming the package "JDAL.jl"?

Yeesian Ng

unread,
Sep 2, 2015, 3:02:11 AM9/2/15
to julia-users
Hey Marcio,

There is a JuliaGeo organization, and we'll be happy to have you help out!

From what I see, the data field of the Raster object loads the raster to memory, rather than keeping a reference to the values. This is up for debate though, and maintaining a handle to the underlying raster might be a more viable approach (which is the approach taken in LibGEOS.jl and Proj4.jl).

To mimic matrix indexing, you implement the getindex method (read the section on Arrays in the julia manual). And no, you do have to manually make calls to destroy the raster objects you maintain a handle to; they probably have it documented in their C API, the gc does not do that for you.

There is also a julia-geo mailing list, where we'll be happy to entertain discussions on packages for geospatial libraries in julia. Shall we migrate this discussion there?

Marcio Sales

unread,
Sep 2, 2015, 7:17:31 AM9/2/15
to julia-users
Hello Yeesian
Thank you for your answer. Yes, I would be glad to join the organization. How do I do it?
Also, feel free to include this in the mailing list, and lets continue this discussion there.

Yeesian Ng

unread,
Sep 2, 2015, 1:51:58 PM9/2/15
to julia-users
I have opened a thread for discussion regarding broader changes/involvement in the JuliaGeo organization: https://groups.google.com/d/msg/julia-geo/yfkJwtMG4fM/SrzqyaviAQAJ

For discussions specific to RasterIO.jl (renaming, reference-versus-copy), I suggest opening an issue over at https://github.com/wkearn/RasterIO.jl/issues?

Marcio Sales

unread,
Sep 2, 2015, 9:08:48 PM9/2/15
to julia-users
Great. I just posted a new issue to start the discussions.
Reply all
Reply to author
Forward
0 new messages