chartcatalogs / catalogs

Catalogs of freely available electronic nautical navigation charts in XML format
http://chartcatalogs.github.io/
Creative Commons Zero v1.0 Universal
23 stars 30 forks source link

(Re)moved IENC charts #33

Open nohal opened 1 year ago

nohal commented 1 year ago

Investigate what happened to the chart sources:

marcelrv commented 1 year ago

For the The Netherlands (Geertruidenberg, Waspik) the issue is that the files are downloaded by default with '.zip' extension. However, for these 2 places it is not actually a zip file containing the ENC but instead it is the file directly.

To fix we would need the script to be more clever in finding the proper filetype https://github.com/chartcatalogs/scripts/blob/master/nl_ienc.py#L26

but it is a bit tricky as it is not directly visible in the source: https://vaarweginformatie.nl/frp/api/webcontent/downloads?pageId=infra/enc

[{"name":"Zeeland Compleet Week 13 - 2023 - 40MB","version":1,"author":"RWS Zeeland","date":1679994067723,"fileId":3476189474,"externalUrl":null},
{"name":"Waddenzee Compleet Week 12 – 2023 – 43 MB","version":1,"author":"RWS CIV IGA DOA","date":1679914094922,"fileId":3474383083,"externalUrl":null},
{"name":"Port of Rotterdam 2022-12-14","version":1,"author":"Port of Rotterdam","date":1675154649018,"fileId":3410002695,"externalUrl":null},
{"name":"Nederland (excl Zeeland) 2023-01-18- 45MB","version":1,"author":"RWS CIV","date":1674058075107,"fileId":3395631778,"externalUrl":null},
{"name":"IENC Haven Geertruidenberg","version":1,"author":"Gemeente Geertruidenberg","date":1487752185369,"fileId":161337079,"externalUrl":null},
{"name":"IENC Haven Waspik","version":1,"author":"Gemeente Waalwijk","date":1464762736859,"fileId":113616371,"externalUrl":null}]
marcelrv commented 1 year ago

this would be the way to get the filename

from urllib.request import urlopen url = "https://www.vaarweginformatie.nl/fdd/main/wicket/resource/org.apache.wicket.Application/downloadfileResource?fileId=3474383083" response = urlopen(url) filename = response.headers.get_filename() print(filename)