Class ShapefileReader
java.lang.Object
org.apache.sedona.core.formatMapper.shapefileParser.ShapefileReader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LineStringRDDgeometryToLineString(SpatialRDD geometryRDD) convert geometry rdd tostatic PointRDDgeometryToPoint(SpatialRDD geometryRDD) convert geometry rdd tostatic PolygonRDDgeometryToPolygon(SpatialRDD geometryRDD) convert geometry rdd tostatic BoundBoxreadBoundBox(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(org.apache.spark.api.java.JavaSparkContext sc, String inputPath) 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.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.static LineStringRDDreadToLineStringRDD(org.apache.spark.api.java.JavaSparkContext sc, String inputPath) read shapefile and return as an LineStringRDDstatic LineStringRDDreadToLineStringRDD(org.apache.spark.api.java.JavaSparkContext sc, String inputPath, org.locationtech.jts.geom.GeometryFactory geometryFactory) read shapefile with customized GeometryFactory and return as an LineStringRDDstatic PointRDDreadToPointRDD(org.apache.spark.api.java.JavaSparkContext sc, String inputPath) read shapefile and return as an PointRDDstatic PointRDDreadToPointRDD(org.apache.spark.api.java.JavaSparkContext sc, String inputPath, org.locationtech.jts.geom.GeometryFactory geometryFactory) read shapefile with customized GeometryFactory and return as an PointRDDstatic PolygonRDDreadToPolygonRDD(org.apache.spark.api.java.JavaSparkContext sc, String inputPath) read shapefile and return as an PolygonRDDstatic PolygonRDDreadToPolygonRDD(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
-
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 ContextinputPath- 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
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
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
convert geometry rdd to- Parameters:
geometryRDD-- Returns:
-