[gdal-dev] Problem with newer GDAL versions reading remote atom service

Pedro Venâncio pedrongvenancio at gmail.com
Sat Jan 4 07:06:29 PST 2020


Hi,

There is something wrong when reading remote Atom services with newer GDAL
versions.

For instance, this Atom service:
http://mapas.dgterritorio.pt/inspire/atom/CDG_COS2018v1_Continente_Atom.xml

*Windows - OSGeo4W - GDAL 3.0.2:*

C:\>gdalinfo --version
GDAL 3.0.2, released 2019/10/28

C:\>ogrinfo -ro
http://mapas.dgterritorio.pt/inspire/atom/CDG_COS2018v1_Continente_Atom.xml
georss
ERROR 1: JSON parsing error: unexpected character (at offset 0)
ERROR 1: JSON parsing error: unexpected character (at offset 0)
ERROR 1: JSON parsing error: unexpected character (at offset 0)
ERROR 1: JSON parsing error: unexpected character (at offset 1)
ERROR 1: JSON parsing error: continue (at offset 2)
(...)
ERROR 1: JSON parsing error: unexpected character (at offset 2)
ERROR 1: JSON parsing error: unexpected character (at offset 2)
ERROR 1: JSON parsing error: unexpected character (at offset 2)
ERROR 1: JSON parsing error: unexpected character (at offset 1)
ERROR 1: JSON parsing error: unexpected character (at offset 0)
INFO: Open of `
http://mapas.dgterritorio.pt/inspire/atom/CDG_COS2018v1_Continente_Atom.xml'
      using driver `GeoJSONSeq' successful.
FAILURE: Couldn't fetch requested layer georss!



*Linux - GDAL 2.4.2:*

pedro at HP-OMEN:~$ gdalinfo --version
GDAL 2.4.2, released 2019/06/28

pedro at HP-OMEN:~$ ogrinfo -ro
http://mapas.dgterritorio.pt/inspire/atom/CDG_COS2018v1_Continente_Atom.xml
georss
ERROR 1: JSON parsing error: unexpected character (at offset 0)
ERROR 1: JSON parsing error: unexpected character (at offset 0)
ERROR 1: JSON parsing error: unexpected character (at offset 0)
ERROR 1: JSON parsing error: unexpected character (at offset 1)
ERROR 1: JSON parsing error: continue (at offset 2)
(...)
ERROR 1: JSON parsing error: unexpected character (at offset 2)
ERROR 1: JSON parsing error: unexpected character (at offset 1)
ERROR 1: JSON parsing error: unexpected character (at offset 0)
INFO: Open of `
http://mapas.dgterritorio.pt/inspire/atom/CDG_COS2018v1_Continente_Atom.xml'
      using driver `GeoJSONSeq' successful.
FAILURE: Couldn't fetch requested layer georss!


It seems that GDAL is trying to use a wrong driver, GeoJSONSeq instead of
GeoRSS.

This does not happen in GDAL 2.2.2.

*Linux - GDAL 2.2.2*

pedro at omen ~ $ gdalinfo --version
GDAL 2.2.2, released 2017/09/15

pedro at omen ~ $ ogrinfo -ro
http://mapas.dgterritorio.pt/inspire/atom/CDG_COS2018v1_Continente_Atom.xml
georss
INFO: Open of `
http://mapas.dgterritorio.pt/inspire/atom/CDG_COS2018v1_Continente_Atom.xml'
      using driver `GeoRSS' successful.

Layer name: georss
Geometry: Unknown (any)
Feature Count: 23
Layer SRS WKT:
(unknown)
title: String (0.0)
link_rel: String (0.0)
link_href: String (0.0)
link_type: String (0.0)
link_hreflang: String (0.0)
link_title: String (0.0)
id: String (0.0)
updated: DateTime (0.0)
category_term: String (0.0)
category_label: String (0.0)
OGRFeature(georss):0
  title (String) = COS2018v1.0 - PT11A_Area_Metropolitana_Porto
  link_rel (String) = alternate
  link_href (String) =
http://mapas.dgterritorio.pt/DGT-ATOM-download/COS_Final/COS2018v1.0-NUT3/COS2018-V1-PT11A_Area_Metropolitana_Porto.zip
  link_type (String) = application/x-shapefile
  link_hreflang (String) = pt
  link_title (String) = COS2018v1.0 - PT11A_Area_Metropolitana_Porto
  id (String) = urn:uuid:1e44b3bb-299a-4f73-a736-e4868d74df90
  updated (DateTime) = 2019/12/27 11:45:03+00
  category_term (String) = http://www.opengis.net/def/crs/EPSG/0/3763
  category_label (String) = ETRS89/PT-TM06

OGRFeature(georss):1
  title (String) = COS2018v1.0 - PT11B_Alto_Tamega
  link_rel (String) = alternate
  link_href (String) =
http://mapas.dgterritorio.pt/DGT-ATOM-download/COS_Final/COS2018v1.0-NUT3/COS2018-V1-PT11B_Alto_Tamega.zip
  link_type (String) = application/x-shapefile
  link_hreflang (String) = pt
  link_title (String) = COS2018v1.0 - PT11B_Alto_Tamega
  id (String) = urn:uuid:4a2a4849-0585-4167-8285-c434c827b03f
  updated (DateTime) = 2019/12/27 11:45:03+00
  category_term (String) = http://www.opengis.net/def/crs/EPSG/0/3763
  category_label (String) = ETRS89/PT-TM06

OGRFeature(georss):2
  title (String) = COS2018v1.0 - PT11C_Tamega_e_Sousa
  link_rel (String) = alternate
  link_href (String) =
http://mapas.dgterritorio.pt/DGT-ATOM-download/COS_Final/COS2018v1.0-NUT3/COS2018-V1-PT11C_Tamega_e_Sousa.zip
  link_type (String) = application/x-shapefile
  link_hreflang (String) = pt


However, if the XML file is already downloaded and read locally from GDAL,
it works as expected in newer versions:

pedro at HP-OMEN:~$ gdalinfo --version
GDAL 2.4.2, released 2019/06/28

pedro at HP-OMEN:~$ wget
http://mapas.dgterritorio.pt/inspire/atom/CDG_COS2018v1_Continente_Atom.xml

--2020-01-04 14:49:24--
http://mapas.dgterritorio.pt/inspire/atom/CDG_COS2018v1_Continente_Atom.xml
Resolving mapas.dgterritorio.pt (mapas.dgterritorio.pt)... 193.137.94.66
Connecting to mapas.dgterritorio.pt
(mapas.dgterritorio.pt)|193.137.94.66|:80...
connected.
HTTP request sent, awaiting response... 200 OK
Length: 17211 (17K) [application/xml]
Saving to: ‘CDG_COS2018v1_Continente_Atom.xml’
CDG_COS2018v1_Continente_Atom
100%[=================================================>]  16.81K  --.-KB/s
   in 0.02s
2020-01-04 14:49:24 (752 KB/s) - ‘CDG_COS2018v1_Continente_Atom.xml’ saved
[17211/17211]


pedro at HP-OMEN:~$ ogrinfo -ro CDG_COS2018v1_Continente_Atom.xml georss
INFO: Open of `CDG_COS2018v1_Continente_Atom.xml'
      using driver `GeoRSS' successful.

Layer name: georss
Geometry: Unknown (any)
Feature Count: 23
Layer SRS WKT:
(unknown)
title: String (0.0)
link_rel: String (0.0)
link_href: String (0.0)
link_type: String (0.0)
link_hreflang: String (0.0)
link_title: String (0.0)
id: String (0.0)
updated: DateTime (0.0)
category_term: String (0.0)
category_label: String (0.0)
OGRFeature(georss):0
  title (String) = COS2018v1.0 - PT11A_Area_Metropolitana_Porto
  link_rel (String) = alternate
  link_href (String) =
http://mapas.dgterritorio.pt/DGT-ATOM-download/COS_Final/COS2018v1.0-NUT3/COS2018-V1-PT11A_Area_Metropolitana_Porto.zip
  link_type (String) = application/x-shapefile
  link_hreflang (String) = pt
  link_title (String) = COS2018v1.0 - PT11A_Area_Metropolitana_Porto
  id (String) = urn:uuid:1e44b3bb-299a-4f73-a736-e4868d74df90
  updated (DateTime) = 2019/12/27 11:45:03+00
  category_term (String) = http://www.opengis.net/def/crs/EPSG/0/3763
  category_label (String) = ETRS89/PT-TM06

OGRFeature(georss):1
  title (String) = COS2018v1.0 - PT11B_Alto_Tamega
  link_rel (String) = alternate
  link_href (String) =
http://mapas.dgterritorio.pt/DGT-ATOM-download/COS_Final/COS2018v1.0-NUT3/COS2018-V1-PT11B_Alto_Tamega.zip
  link_type (String) = application/x-shapefile
  link_hreflang (String) = pt
  link_title (String) = COS2018v1.0 - PT11B_Alto_Tamega
  id (String) = urn:uuid:4a2a4849-0585-4167-8285-c434c827b03f
  updated (DateTime) = 2019/12/27 11:45:03+00
  category_term (String) = http://www.opengis.net/def/crs/EPSG/0/3763
  category_label (String) = ETRS89/PT-TM06

OGRFeature(georss):2
  title (String) = COS2018v1.0 - PT11C_Tamega_e_Sousa
  link_rel (String) = alternate
(...)


What can be causing this behavior?

Thank you very much!

Best regards,
Pedro Venâncio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200104/0c221aa2/attachment-0001.html>


More information about the gdal-dev mailing list