Skip to content

Commit 7edf3e2

Browse files
Update README.md (#127)
1 parent 4e35a31 commit 7edf3e2

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,21 @@ julia> ga_band = GeoArrays.read(fn, masked=false, band=2)
8080
8181
In case there is missing data, the type will be a `Union{Missing, T}`. To convert to a GeoArray without `missing`, you can call `coalesce(ga, value_to_replace_missing)`.
8282
83+
### Reading NetCDFs
84+
GeoArrays uses ArchGDAL.readraster to open geo raster datasets, and therefor supports reading formats other than geotiffs
85+
86+
To read a netcdf, the file name must include the prefix `NETCDF:` and the suffix `:var`, where var is the name of the NetCDF variable to be opened
87+
88+
```julia
89+
# Get file
90+
julia> fn = download("https://github.com/OSGeo/gdal/raw/master/autotest/gdrivers/data/netcdf/sentinel5p_fake.nc")
91+
92+
# variable to read 
93+
julia> var = "my_var";
94+
julia> ga_nc = GeoArrays.read("NETCDF:$fn:$var", masked=false)
95+
61x89x1 ArchGDAL.RasterDataset{Float32, ArchGDAL.IDataset} with AffineMap([1.0 0.0; 0.0 1.0], [0.0, 0.0]) and undefined CRS
96+
```
97+
8398
### Using coordinates
8499
`GeoArray`s have geographical coordinates for all array elements (pixels). They can be retrieved with the `GeoArrays.coords` function.
85100
@@ -215,5 +230,5 @@ You can sample the values along a line in a GeoArray with `profile(ga, linestrin
215230
216231
217232
## Alternatives
218-
GeoArrays.jl was written to quickly save a geospatial Array to disk. Its functionality mimics `rasterio` in Python. If one requires more features---such as rasterization or zonal stats---which also work on NetCDF files, [Rasters.jl](https://github.com/rafaqz/Rasters.jl/) is a good alternative. Its functionality is more like `(rio)xarray` in Python.
233+
GeoArrays.jl was written to quickly save a geospatial Array to disk. Its functionality mimics `rasterio` in Python. If one requires more features---such as rasterization or zonal stats---which also work on NetCDF files, [Rasters.jl](https://github.com/rafaqz/Rasters.jl/) is a good alternative. Its functionality is more like `(rio)xarray` in Python. [NCDatasets](https://github.com/Alexander-Barth/NCDatasets.jl) is a great Julia package if working exclusively with NetCDF files.
219234

0 commit comments

Comments
 (0)