Ejemplo n.º 1
0
    def update_chartCatalog(self):
        catalog = RncChartCatalog()
        catalog.title = 'Netherlands Inland & Surroundings GPX waypoints ' + \
            'with buoys, berths, bridges and locks etc. to import as layer (manually).'

        for chart in self.charts_info:
            time = datetime.datetime.fromisoformat(chart.updated)
            if chart.get_fileExtension() == '.gpx':
                fn = chart.get_baseFilename() + '.zip'
            else:
                fn = chart.filename
            self.add_chart(catalog, chart.description, time, fn, chart.sort)
        self.store_catalog(catalog)
Ejemplo n.º 2
0
#!/usr/bin/python
"""Script to process the Atom feed of the German IENC charts list and convert it to the XML catalog format
Part of the ChartCatalogs project
Copyright (c) 2019 Pavel Kalian
Licensed under GPLv2 or, at yoir will later version
"""

import sys
from ChartCatalogs import Chart, RncChartCatalog
from datetime import datetime
import xml.etree.ElementTree as ET
import dateutil.parser

catalog = RncChartCatalog()
catalog.title = "DE IENC Charts"

xmldoc = ET.parse(sys.argv[1])

feed = xmldoc.getroot()

for entry in feed.findall('{http://www.w3.org/2005/Atom}entry'):
    chart = Chart()
    chart.chart_format = 'Sailing Chart, International Chart'
    chart.url = entry.find('{http://www.w3.org/2005/Atom}id').text
    chart.number = entry.find(
        '{http://www.w3.org/2005/Atom}link').attrib['title'][2:4]
    chart.title = entry.find('{http://www.w3.org/2005/Atom}title').text
    chart.zipfile_ts = dateutil.parser.parse(
        entry.find('{http://www.w3.org/2005/Atom}updated').text)
    catalog.add_chart(chart)
Ejemplo n.º 3
0
#!/usr/bin/python
"""Script to process the JSON feed of the Dutch IENC charts list and convert it to the XML catalog format
Part of the ChartCatalogs project
Copyright (c) 2019-2020 Marcel Verpaalen
Licensed under GPLv2 or, at your will later version
"""

import sys
from ChartCatalogs import Chart, RncChartCatalog
from datetime import datetime
import json

catalog = RncChartCatalog()
catalog.title = "Netherlands Inland ENC Charts"

with open(sys.argv[1]) as f:
    data = json.load(f)
    cnt = 0
    for tileset in data:
        chart = Chart()
        chart.chart_format = 'Sailing Chart, International Chart'
        chart.url = "https://vaarweginformatie.nl/fdd/main/wicket/resource/org.apache.wicket.Application/downloadfileResource?fileId=%s" % tileset[
            'fileId']
        chart.number = "%s" % cnt
        chart.title = "%s" % tileset['name']
        chart.zipfile_ts = datetime.fromtimestamp(tileset['date'] / 1000)
        chart.target_filename = "%s.zip" % tileset['name']
        catalog.add_chart(chart)
        cnt = cnt + 1

catalog.print_xml(True)
Ejemplo n.º 4
0
#!/usr/bin/python
"""Script to process the NOAA JSON MBtiles catalog and convert it to the XML catalog format
Part of the ChartCatalogs project
Copyright (c) 2019 Pavel Kalian
Licensed under GPLv2 or, at yoir will later version
"""

import sys
from ChartCatalogs import Chart, RncChartCatalog
from datetime import datetime
import dateutil.parser
import json

catalog = RncChartCatalog()
catalog.title = 'NOAA Raster Charts MBTiles'

with open(sys.argv[1]) as f:
    data = json.load(f)
    for tileset in data['quilted_tilesets']:
        chart = Chart()
        chart.chart_format = 'Sailing Chart, International Chart'
        chart.url = "https:%s" % data['quilted_tilesets'][tileset]['url']
        chart.number = data['quilted_tilesets'][tileset]['name'][-2:]
        chart.title = "%s [%i MB]" % (
            data['quilted_tilesets'][tileset]['description'],
            data['quilted_tilesets'][tileset]['size'])
        chart.zipfile_ts = dateutil.parser.parse(
            data['quilted_tilesets'][tileset]['updated'])
        catalog.add_chart(chart)

catalog.print_xml(True)