java.lang.Object
org.apache.sedona.core.formatMapper.shapefileParser.ShapefileReader

public class ShapefileReader extends Object
  • Constructor Details

    • ShapefileReader

      public ShapefileReader()
  • Method Details

    • readToGeometryRDD

      public static SpatialRDD<org.locationtech.jts.geom.Geometry> readToGeometryRDD(org.apache.spark.api.java.JavaSparkContext sc, String inputPath)
      read shapefile in inputPath with default GeometryFactory and return an RDD of Geometry.
      Parameters:
      sc -
      inputPath -
      Returns:
    • readToGeometryRDD

      public static SpatialRDD<org.locationtech.jts.geom.Geometry> readToGeometryRDD(org.apache.spark.api.java.JavaSparkContext sc, String inputPath, org.locationtech.jts.geom.GeometryFactory geometryFactory)
      read shapefile in inputPath with customized GeometryFactory and return an RDD of Geometry.
      Parameters:
      sc -
      inputPath -
      geometryFactory -
      Returns:
    • readBoundBox

      public static BoundBox readBoundBox(org.apache.spark.api.java.JavaSparkContext sc, String inputPath)
      read and merge bound boxes of all shapefiles user input, if there is no, leave BoundBox null;
    • readFieldNames

      public static List<String> readFieldNames(org.apache.spark.api.java.JavaSparkContext sc, String inputPath) throws IOException
      Parameters:
      sc - Spark Context
      inputPath - folder which contains shape file with dbf metadata file
      Returns:
      List of Strings if dbf file was found; return null if no dbf file
      Throws:
      IOException
    • readToPolygonRDD

      public static PolygonRDD readToPolygonRDD(org.apache.spark.api.java.JavaSparkContext sc, String inputPath)
      read shapefile and return as an PolygonRDD
      Parameters:
      sc -
      inputPath -
      Returns:
    • readToPolygonRDD

      public static PolygonRDD readToPolygonRDD(org.apache.spark.api.java.JavaSparkContext sc, String inputPath, org.locationtech.jts.geom.GeometryFactory geometryFactory)
      read shapefile with customized GeometryFactory and return as an PolygonRDD
      Parameters:
      sc -
      inputPath -
      geometryFactory -
      Returns:
    • geometryToPolygon

      public static PolygonRDD geometryToPolygon(SpatialRDD geometryRDD)
      convert geometry rdd to
      Parameters:
      geometryRDD -
      Returns:
    • readToPointRDD

      public static PointRDD readToPointRDD(org.apache.spark.api.java.JavaSparkContext sc, String inputPath)
      read shapefile and return as an PointRDD
      Parameters:
      sc -
      inputPath -
      Returns:
    • readToPointRDD

      public static PointRDD readToPointRDD(org.apache.spark.api.java.JavaSparkContext sc, String inputPath, org.locationtech.jts.geom.GeometryFactory geometryFactory)
      read shapefile with customized GeometryFactory and return as an PointRDD
      Parameters:
      sc -
      inputPath -
      geometryFactory -
      Returns:
    • geometryToPoint

      public static PointRDD geometryToPoint(SpatialRDD geometryRDD)
      convert geometry rdd to
      Parameters:
      geometryRDD -
      Returns:
    • readToLineStringRDD

      public static LineStringRDD readToLineStringRDD(org.apache.spark.api.java.JavaSparkContext sc, String inputPath)
      read shapefile and return as an LineStringRDD
      Parameters:
      sc -
      inputPath -
      Returns:
    • readToLineStringRDD

      public static LineStringRDD readToLineStringRDD(org.apache.spark.api.java.JavaSparkContext sc, String inputPath, org.locationtech.jts.geom.GeometryFactory geometryFactory)
      read shapefile with customized GeometryFactory and return as an LineStringRDD
      Parameters:
      sc -
      inputPath -
      geometryFactory -
      Returns:
    • geometryToLineString

      public static LineStringRDD geometryToLineString(SpatialRDD geometryRDD)
      convert geometry rdd to
      Parameters:
      geometryRDD -
      Returns: