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

cURL: added curl cookiefile and cookiejar variables (fixes #1000) #1133

Merged
merged 2 commits into from Dec 5, 2018

Conversation

scottyhq
Copy link
Contributor

@scottyhq scottyhq commented Dec 5, 2018

What does this PR do?

Enable the cookie engine in gdal /vsicurl. In particular, allows users to specific the following environment variables, which permit command line interaction with NASA imagery on remote servers using single sign on authentication (https://urs.earthdata.nasa.gov).
GDAL_HTTP_COOKIEJAR
GDAL_HTTP_COOKIEFILE

see example and output in comment below

What are related issues/pull requests?

#1000

Tasklist

  • Review
  • Adjust for comments
  • All CI builds and checks have passed

Environment

  • OS: Ubuntu 18.04.1 LTS
  • Compiler: gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0

Committer: Scott Henderson (scottyhq@gmail.com)
@scottyhq
Copy link
Contributor Author

scottyhq commented Dec 5, 2018

I've verified the changes work with the following command. Note that you also need NASA credentials stored in a .netrc file (https://wiki.earthdata.nasa.gov/display/EL/How+To+Access+Data+With+cURL+And+Wget)

GDAL_HTTP_COOKIEJAR=.urs_cookies GDAL_HTTP_COOKIEFILE=.urs_cookies gdalinfo /vsizip//vsicurl/https://datapool.asf.alaska.edu/RTC_LOW_RES/A3/AP_27018_FBS_F0910_RT2.zip/AP_27018_FBS_F0910_RT2/AP_27018_FBS_F0910_RT2.geo.jpg

Driver: JPEG/JPEG JFIF
Files: /vsizip//vsicurl/https://datapool.asf.alaska.edu/RTC_LOW_RES/A3/AP_27018_FBS_F0910_RT2.zip/AP_27018_FBS_F0910_RT2/AP_27018_FBS_F0910_RT2.geo.jpg
       /vsizip//vsicurl/https://datapool.asf.alaska.edu/RTC_LOW_RES/A3/AP_27018_FBS_F0910_RT2.zip/AP_27018_FBS_F0910_RT2/AP_27018_FBS_F0910_RT2.geo.jpg.aux.xml
       /vsizip//vsicurl/https://datapool.asf.alaska.edu/RTC_LOW_RES/A3/AP_27018_FBS_F0910_RT2.zip/AP_27018_FBS_F0910_RT2/AP_27018_FBS_F0910_RT2.geo.wld
Size is 999, 870
Coordinate System is:
PROJCS["WGS 84 / UTM zone 10N",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.2572201434283,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-123],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","32610"]]
Origin = (423370.406250000000000,5131723.000000000000000)
Pixel Size = (79.110000610000000,-79.110000610000000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
Corner Coordinates:
Upper Left  (  423370.406, 5131723.000) (123d59'44.36"W, 46d20' 5.09"N)
Lower Left  (  423370.406, 5062897.299) (123d59' 4.55"W, 45d42'55.40"N)
Upper Right (  502401.297, 5131723.000) (122d58' 7.67"W, 46d20'20.68"N)
Lower Right (  502401.297, 5062897.299) (122d58' 8.92"W, 45d43'10.66"N)
Center      (  462885.852, 5097310.150) (123d28'46.40"W, 46d 1'42.09"N)
Band 1 Block=999x1 Type=Byte, ColorInterp=Gray
  NoData Value=0
  Overviews: 500x435, 250x218
  Image Structure Metadata:
    COMPRESSION=JPEG

@rouault
Copy link
Member

rouault commented Dec 5, 2018

Could you document those options in the Doxygen section of CPLHTTPFetch() (in the same file )?

@rouault rouault merged commit 6958e32 into OSGeo:master Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants