Class EsriFileCsvParser
java.lang.Object
nl.tudelft.simulation.dsol.animation.gis.esri.EsriFileCsvParser
This class parses a CSV file that defines which elements of shape file(s) need to be drawn and what format to use.
Copyright (c) 2020-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information DSOL Manual. The DSOL project is distributed under a three-clause BSD-style license, which can be found at DSOL License.
The dsol-animation-gis project is based on the gisbeans project that has been part of DSOL since 2002, originally by Peter Jacobs and Paul Jacobs.
- Author:
- Alexander Verbraeck
-
Method Summary
Modifier and TypeMethodDescriptionstatic GisMapInterface
parseMapFile
(URL csvUrl, String mapName) Parses a CSV file with information about the map and layers.static GisMapInterface
parseMapFile
(URL csvUrl, String mapName, CoordinateTransform coordinateTransform) Parses a CSV file with information about the map and layers.static GisMapInterface
parseMapFile
(URL csvUrl, String mapName, CoordinateTransform coordinateTransform, char fieldSeparator, char quoteCharacter) Parses a CSV file with information about the map and layers.
-
Method Details
-
parseMapFile
Parses a CSV file with information about the map and layers.- Parameters:
csvUrl
- URL; the url of the CSV file.mapName
- String; the human readable name of the map- Returns:
- MapInterface the parsed map file.
- Throws:
IOException
- on failure
-
parseMapFile
public static GisMapInterface parseMapFile(URL csvUrl, String mapName, CoordinateTransform coordinateTransform) throws IOException Parses a CSV file with information about the map and layers.- Parameters:
csvUrl
- URL; the url of the CSV file.mapName
- String; the human readable name of the mapcoordinateTransform
- CoordinateTransform; the transformation of (x, y) coordinates to (x', y') coordinates.- Returns:
- MapInterface the parsed map file.
- Throws:
IOException
- on failure
-
parseMapFile
public static GisMapInterface parseMapFile(URL csvUrl, String mapName, CoordinateTransform coordinateTransform, char fieldSeparator, char quoteCharacter) throws IOException Parses a CSV file with information about the map and layers. FieldSeparateor can be, for instance \t for a tab character, and the quote character can be the double quote, the single quote, or something else.- Parameters:
csvUrl
- URL; the url of the CSV file.mapName
- String; the human readable name of the mapcoordinateTransform
- CoordinateTransform; the transformation of (x, y) coordinates to (x', y') coordinates.fieldSeparator
- char; field separator, e.g., comma for csv files and tab for tsv filesquoteCharacter
- char; e.g., single or double quote- Returns:
- MapInterface the parsed map file.
- Throws:
IOException
- on failure reading the CSV file, the shape files, or making the layersIllegalArgumentException
- when one of the outline or fill colors can not be parsedNumberFormatException
- when one of colors contains an illegal number
-