Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update README on using the utilities #86

Closed
visr opened this issue Mar 9, 2020 · 8 comments · Fixed by #119
Closed

update README on using the utilities #86

visr opened this issue Mar 9, 2020 · 8 comments · Fixed by #119

Comments

@visr
Copy link
Member

visr commented Mar 9, 2020

This section should be updated now that since #82 we use Artifacts and no longer have a deps.jl:
https://github.com/JuliaGeo/GDAL.jl/tree/v1.1.4#using-the-gdal-and-ogr-utilities

edit: I removed the incorrect information for now, but it would be great to update it and put it back

visr added a commit that referenced this issue Sep 19, 2020
Better to have no information instead of incorrect information. #86 should update this and restore the section.
@visr
Copy link
Member Author

visr commented Jan 3, 2021

Here is a quick example on how to run gdalinfo, lifted from the tests:

GDAL.gdalinfo_path() do gdinfo
    run(`$gdinfo path/to/file`)
end

@lazarusA
Copy link

I was looking for a simpler solution, but this works!, I was expecting to see this info when I load the file via

ArchGDAL.read("filetif")

Here is a quick example on how to run gdalinfo, lifted from the tests:

GDAL.gdalinfo_path() do gdinfo
    run(`$gdinfo path/to/file`)
end

@visr
Copy link
Member Author

visr commented Apr 14, 2021

Hmm yeah I believe it shows a bit of the same information. But all of gdalinfo would perhaps be a bit verbose.

Note the in ArchGDAL you can also use ArchGDAL.gdalinfo:

https://github.com/yeesian/ArchGDAL.jl/blob/0e42c2be8a2ff8fb6ce3808035beebcddde07122/test/test_gdalutilities.jl#L14-L19

@lazarusA
Copy link

yes, actually I tried that first, but didn't work [probably I did something wrong]

ArchGDAL.gdalinfo("file.tif")

MethodError: no method matching gdalinfo(::String)
Closest candidates are:
  gdalinfo(::ArchGDAL.Dataset) at /Users/lalonso/.julia/packages/ArchGDAL/CUiBS/src/utilities.jl:14
  gdalinfo(::ArchGDAL.Dataset, ::Any)

@visr
Copy link
Member Author

visr commented Apr 14, 2021

@lazarusA
Copy link

yes, I did that also, same error.

@visr
Copy link
Member Author

visr commented Apr 14, 2021

Hmm this works for me:

julia> ArchGDAL.read("test/data/utmsmall.tif") do ds
           println(ArchGDAL.gdalinfo(ds))
       end
Driver: GTiff/GeoTIFF
Files: test/data/utmsmall.tif
Size is 100, 100
Coordinate System is:
PROJCRS["NAD27 / UTM zone 11N",
    BASEGEOGCRS["NAD27",
        DATUM["North American Datum 1927",
            ELLIPSOID["Clarke 1866",6378206.4,294.978698213898,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4267]],
    CONVERSION["Transverse Mercator",
        METHOD["Transverse Mercator",
            ID["EPSG",9807]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",-117,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["Scale factor at natural origin",0.9996,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["False easting",500000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["easting",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["northing",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    ID["EPSG",26711]]
Data axis to CRS axis mapping: 1,2
Origin = (440720.000000000000000,3751320.000000000000000)
Pixel Size = (60.000000000000000,-60.000000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  440720.000, 3751320.000) (117d38'28.21"W, 33d54' 8.47"N)
Lower Left  (  440720.000, 3745320.000) (117d38'26.75"W, 33d50'53.66"N)
Upper Right (  446720.000, 3751320.000) (117d34'34.59"W, 33d54' 9.62"N)
Lower Right (  446720.000, 3745320.000) (117d34'33.28"W, 33d50'54.82"N)
Center      (  443720.000, 3748320.000) (117d36'30.71"W, 33d52'31.66"N)
Band 1 Block=100x81 Type=Byte, ColorInterp=Gray

Though if it's not working, probably best to open an issue at ArchGDAL.jl.

@lazarusA
Copy link

now it works 🍡 , I restarted my session. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants