Class ShapeFileReader

java.lang.Object
org.opentrafficsim.demo.geometry.shape.ShapeFileReader
All Implemented Interfaces:
UNITS

public final class ShapeFileReader
extends java.lang.Object
implements UNITS

Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

$LastChangedDate: 2019-11-14 14:36:06 +0100 (Thu, 14 Nov 2019) $, @version $Revision: 5717 $, by $Author: averbraeck $, initial version Sep 11, 2014

Author:
Alexander Verbraeck, Guus Tamminga
  • Method Details

    • readNodes

      public static java.util.Map<java.lang.String,​OTSRoadNode> readNodes​(Network network, java.lang.String shapeFileName, java.lang.String numberType, boolean returnCentroid, boolean allCentroids) throws java.io.IOException
      Parameters:
      network - Network; Network, the network
      shapeFileName - String; the nodes shapefile to read
      numberType - String; ???
      returnCentroid - boolean; if true only loop through the centroid/zones (in case of mixed nodes and centroids)
      allCentroids - boolean; if true: the file contains centroids (a centroid file)
      Returns:
      map of (shape file) nodes with nodenr as the key
      Throws:
      java.io.IOException - on error
    • inspectNodeCentroid

      public static boolean inspectNodeCentroid​(java.lang.String number)
      Parameters:
      number - String; number string
      Returns:
      boolean: true if the number refers to a Centroid; false otherwise
    • readLinks

      public static void readLinks​(OTSRoadNetwork network, java.lang.String shapeFileName, java.util.Map<java.lang.String,​Link> links, java.util.Map<java.lang.String,​OTSRoadNode> nodes, OTSSimulatorInterface simulator) throws java.io.IOException
      Parameters:
      network - OTSRoadNetwork; the network
      shapeFileName - String; the nodes shapefile to read
      links - Map<String,Link>; : returns the file with real links
      nodes - Map<String,OTSNode>; the map of nodes to retrieve start and end node
      simulator - OTSSimulatorInterface; simulator for the animation registration
      Throws:
      java.io.IOException - on error
    • shapeFileInfo

      public static void shapeFileInfo​(java.lang.String shapeFileName) throws java.io.IOException
      Parameters:
      shapeFileName - String; the areas shapefile to read
      Throws:
      java.io.IOException - on error
    • removeQuotes

      public static java.lang.String removeQuotes​(java.lang.String name)
      Parameters:
      name - String; the name with quotes
      Returns:
      name without quotes