Opened 5 years ago

Closed 3 years ago

#6852 closed enhancement (wontfix)

OGRSpatialReference::importFromXML() doesn't support GML 3.2 SRS definitions

Reported by: bphamhuu Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: OGR_SRS Version: 1.11.4
Severity: normal Keywords: GML 3.2.1, GML EPSG, read GML
Cc:

Description

I'm using gdal java to build an web application and I need to convert the GML 3.2.1 from opengis.net to wkt or proj4.

my current GDAL version:
GDAL 1.11.4, released 2016/01/25

Here is simple Java code which could read the GML (not from opengis.net)

SpatialReference targetSpatialReference = new SpatialReference();
sourceSpatialReference.ImportFromXML(xml);

with xml is GML from: http://spatialreference.org/ref/epsg/4326/gml/

Can I ask why gdal could read this GML which is not valid GML 3.2.1 Schema http://schemas.opengis.net/gml/3.2.1/,

but not this GML http://www.opengis.net/def/crs/EPSG/0/4326 which is valid ?

Change History (6)

comment:1 Changed 5 years ago by Even Rouault

Component: JavaBindingsOGR_SRS
Milestone: 1.11.6
Owner: changed from Even Rouault to warmerdam
Priority: highnormal
Summary: GDAL reads GML from opengis.net and translates to wkt ?OGRSpatialReference::importFromXML() doesn't support GML 3.2 SRS definitions

comment:2 Changed 5 years ago by Jukka Rahkonen

Component: OGR_SRSJavaBindings
Milestone: 1.11.6
Owner: changed from warmerdam to Even Rouault
Priority: normalhigh
Summary: OGRSpatialReference::importFromXML() doesn't support GML 3.2 SRS definitionsGDAL reads GML from opengis.net and translates to wkt ?

With this GDAL version:

GDAL 2.2.0dev, released 2016/99/99

I am getting a result that looks correct to me:

gdalsrsinfo http://www.opengis.net/def/crs/EPSG/0/4326

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

OGC WKT :
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AXIS["Latitude",NORTH],
    AXIS["Longitude",EAST],
    AUTHORITY["EPSG","4326"]]


Last edited 5 years ago by Jukka Rahkonen (previous) (diff)

comment:3 Changed 5 years ago by Even Rouault

Component: JavaBindingsOGR_SRS
Milestone: 1.11.6
Owner: changed from Even Rouault to warmerdam
Priority: highnormal
Summary: GDAL reads GML from opengis.net and translates to wkt ?OGRSpatialReference::importFromXML() doesn't support GML 3.2 SRS definitions

@jukka gdalsrsinfo http://www.opengis.net/def/crs/EPSG/0/4326 doesn't read the GML document at this address. This kind of URL is hardcoded to be resolved locally as EPSG:XXXX

comment:4 Changed 5 years ago by bphamhuu

It would be good as it could be fixed in GDAL 1.11.x version as I don't want to build GDAL manually and only want to install the compiled GDAL from the Linux repository.

I hope your test in GDAL 2.2 could work with CRS not from ESPG as well, e.g: http://access.planetserver.eu:8081/def/crs/PS/0/Mars-equidistant which is a clone of CRS resolver from OGC: opengis.net/def and added a new GML CRS for Mars planet.

So, what I want for this ticket is GDAL could read the GML from any CRS definitions which follow the OGC GML 3.2.1 schema and then convert them to WKT, as someone could define arbitrary CRS beside the EPSG CRSs.

comment:5 Changed 5 years ago by Even Rouault

Note: http://access.planetserver.eu:8081/def/crs/PS/0/Mars-equidistant happens to be the output of GDAL, but the XML exporter is pretty limited currently and only supports a few projection methods. So the definition of this link lacks the projection part and cannot be read back...

comment:6 Changed 3 years ago by Even Rouault

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub?. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.