public static GeoWaveIndexedRDD loadIndexedRDD( final SparkContext sc, final GeoWaveRDD inputRDD, final NumericIndexStrategy indexStrategy) throws IOException { if ((inputRDD == null) || !inputRDD.isLoaded()) { return null; } // Index strategy can be expensive so we will broadcast it and store it Broadcast<NumericIndexStrategy> broadcastStrategy = null; if (indexStrategy != null) { broadcastStrategy = (Broadcast<NumericIndexStrategy>) RDDUtils.broadcastIndexStrategy(sc, indexStrategy); } final GeoWaveIndexedRDD returnRDD = new GeoWaveIndexedRDD(inputRDD, broadcastStrategy); return returnRDD; }
/** * Translate a set of objects in a JavaRDD to SimpleFeatures and push to GeoWave * * @throws IOException */ public static void writeRDDToGeoWave( SparkContext sc, Index index, DataStorePluginOptions outputStoreOptions, FeatureDataAdapter adapter, GeoWaveRDD inputRDD) throws IOException { if (!inputRDD.isLoaded()) { LOGGER.error("Must provide a loaded RDD."); return; } writeToGeoWave(sc, index, outputStoreOptions, adapter, inputRDD.getRawRDD().values()); }
public static void writeRDDToGeoWave( SparkContext sc, Index[] indices, DataStorePluginOptions outputStoreOptions, FeatureDataAdapter adapter, GeoWaveRDD inputRDD) throws IOException { if (!inputRDD.isLoaded()) { LOGGER.error("Must provide a loaded RDD."); return; } for (int iStrategy = 0; iStrategy < indices.length; iStrategy += 1) { writeToGeoWave( sc, indices[iStrategy], outputStoreOptions, adapter, inputRDD.getRawRDD().values()); } }
public static JavaRDD<Point> rddFeatureCentroids(GeoWaveRDD inputRDD) { if (!inputRDD.isLoaded()) { LOGGER.error("Must provide a loaded RDD."); return null; } JavaRDD<Point> centroids = inputRDD.getRawRDD().values().map(feature -> { Geometry geom = (Geometry) feature.getDefaultGeometry(); return geom.getCentroid(); }); return centroids; }
public JavaPairRDD<ByteArray, Tuple2<GeoWaveInputKey, SimpleFeature>> getIndexedFeatureRDD( final double bufferAmount) { verifyParameters(); if (!geowaveRDD.isLoaded()) { LOGGER.error("Must provide a loaded RDD."); return null;
final String timeField, final ScaledTemporalRange scaledRange) { if (!inputRDD.isLoaded()) { LOGGER.error("Must provide a loaded RDD."); return null;
verifyParameters(); if (!geowaveRDD.isLoaded()) { LOGGER.error("Must provide a loaded RDD."); return null;