[gdal-dev] GMLAS tries to read spatialreference.org through http

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Tue Jun 4 04:44:11 PDT 2019


Hi,

The reason for my problem was that I had set only env variable http_proxy. Request to http://spatialreference.org returns http 301 Moved Permanently and forwards into https://spatialreference.org/ref/epsg/28992/ . For accessing the https address I have to set also https_proxy. A better alternative is to set GDAL_HTTP_PROXY instead. Behavior of the different proxy settings is best defined in the GitHub issue https://github.com/OSGeo/gdal/issues/878

But now I don't understand why these two gdalsrsinfo request give different results if both http and https are pointing to the same resource:

gdalsrsinfo http://spatialreference.org/ref/epsg/28992/

PROJ.4 : +proj=sterea +lat_0=52.1561605555556 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs

OGC WKT2:2018 :
PROJCRS["Amersfoort / RD New",
    BASEGEOGCRS["Amersfoort",
        DATUM["Amersfoort",
            ELLIPSOID["Bessel 1841",6377397.155,299.1528128,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]]],
    CONVERSION["unnamed",
        METHOD["Oblique Stereographic",
            ID["EPSG",9809]],
        PARAMETER["Latitude of natural origin",52.1561605555556,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",5.38763888888889,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["Scale factor at natural origin",0.9999079,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["False easting",155000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",463000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["x",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["y",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    ID["EPSG",28992]]


gdalsrsinfo https://spatialreference.org/ref/epsg/28992/

PROJ.4 : +proj=longlat +datum=WGS84 +no_defs

OGC WKT2:2018 :
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    ID["EPSG",4326]]

-Jukka-

-----Alkuperäinen viesti-----
Lähettäjä: Even Rouault <even.rouault at spatialys.com> 
Lähetetty: tiistai 4. kesäkuuta 2019 11.03
Vastaanottaja: gdal-dev at lists.osgeo.org
Kopio: Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi>
Aihe: Re: [gdal-dev] GMLAS tries to read spatialreference.org through http

On mardi 4 juin 2019 06:15:54 CEST Rahkonen Jukka (MML) wrote:
> I am getting lots of warning like this from the GMLAS driver:

> HTTP: Fetch(http://spatialreference.org/ref/epsg/28992/)
> HTTP: These HTTP headers were set: Accept: application/x-ogcwkt ERROR 
> 1: Connection timed out after 10563 milliseconds Warning 1: 
> Reprojection fom http://spatialreference.org/ref/epsg/28992/ to >
> urn:x-ogc:def:crs:EPSG:28992 failed

> I guess that the code should be changed to try https instead.

Doesn't look like it is needed. The following works:

gdalsrsinfo http://spatialreference.org/ref/epsg/28992/

and does the redirection to https

Maybe you hit a temporary issue with the server ?

> The typo "fom" comes also from the driver.

Fixed

--
Spatialys - Geospatial professional services http://www.spatialys.com


More information about the gdal-dev mailing list