WktReader extends RddReader { public static SpatialRDD<Geometry> readToGeometryRDD(JavaSparkContext sc, String inputPath, int wktColumn, boolean allowInvalidGeometries, boolean skipSyntacticallyInvalidGeometries) { JavaRDD rawTextRDD = sc.textFile(inputPath); FormatMapper<Geometry> formatMapper = new FormatMapper<Geometry>(wktColumn, -1, FileDataSplitter.WKT, true, null); formatMapper.allowTopologicallyInvalidGeometries = allowInvalidGeometries; formatMapper.skipSyntacticallyInvalidGeometries = skipSyntacticallyInvalidGeometries; return createSpatialRDD(rawTextRDD, formatMapper); }  static SpatialRDD<Geometry> readToGeometryRDD(JavaSparkContext sc, String inputPath, int wktColumn, boolean allowInvalidGeometries, boolean skipSyntacticallyInvalidGeometries); static SpatialRDD<Geometry> readToGeometryRDD(JavaRDD rawTextRDD, int wktColumn, boolean allowInvalidGeometries, boolean skipSyntacticallyInvalidGeometries);  }
@Test public void testReadToGeometryRDD() throws IOException { SpatialRDD wktRDD = WktReader.readToGeometryRDD(sc, wktGeometries, 0, true, false); assertEquals(wktRDD.rawSpatialRDD.count(), 103); }