All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.powsybl.iidm.geodata.odre.OdreGeoDataCsvLoader Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2024, RTE (http://www.rte-france.com)
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 * SPDX-License-Identifier: MPL-2.0
 */
package com.powsybl.iidm.geodata.odre;

import com.powsybl.iidm.geodata.utils.InputUtils;
import com.powsybl.iidm.network.extensions.Coordinate;

import java.io.IOException;
import java.io.Reader;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;

/**
 * @author Hugo Kulesza {@literal }
 */
public class OdreGeoDataCsvLoader {

    protected OdreGeoDataCsvLoader() {
    }

    public static Map getSubstationsCoordinates(Path path, OdreConfig odreConfig) throws IOException {
        try (Reader reader = InputUtils.toReader(path)) {
            return GeographicDataParser.parseSubstations(reader, odreConfig);
        }
    }

    public static Map> getLinesCoordinates(Path aerialLinesFilePath, Path undergroundLinesFilePath, OdreConfig odreConfig) throws IOException {
        try (Reader aerialReader = InputUtils.toReader(aerialLinesFilePath);
             Reader undergroundReader = InputUtils.toReader(undergroundLinesFilePath)) {

            return GeographicDataParser.parseLines(aerialReader, undergroundReader, odreConfig);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy