コード例 #1
0
    def SpatialRangeQuery(self, spatialRDD: SpatialRDD,
                          rangeQueryWindow: Envelope,
                          considerBoundaryIntersection: bool,
                          usingIndex: bool):
        """

        :param spatialRDD:
        :param rangeQueryWindow:
        :param considerBoundaryIntersection:
        :param usingIndex:
        :return:
        """

        jvm = spatialRDD._jvm
        sc = spatialRDD._sc

        jvm_envelope = rangeQueryWindow.create_jvm_instance(jvm)

        srdd = jvm.\
            RangeQuery.SpatialRangeQuery(
            spatialRDD._srdd,
            jvm_envelope,
            considerBoundaryIntersection,
            usingIndex
        )

        serlialized = jvm.GeoSerializerData.serializeToPython(srdd)

        return RDD(serlialized, sc, GeoSparkPickler())
コード例 #2
0
    def getRawSpatialRDD(self):
        """

        :return:
        """
        serialized_spatial_rdd = self._jvm.GeoSerializerData.serializeToPython(
            self._srdd.getRawSpatialRDD())
        return RDD(serialized_spatial_rdd, self._sc, GeoSparkPickler())
コード例 #3
0
ファイル: join_query.py プロジェクト: Imbruced/geo_pyspark
    def DistanceJoinQuery(cls, spatialRDD: SpatialRDD, queryRDD: SpatialRDD,
                          useIndex: bool,
                          considerBoundaryIntersection: bool) -> RDD:
        """

        :param spatialRDD:
        :param queryRDD:
        :param useIndex:
        :param considerBoundaryIntersection:
        :return:
        """

        jvm = spatialRDD._jvm
        sc = spatialRDD._sc
        srdd = jvm.JoinQuery.DistanceJoinQuery(spatialRDD._srdd,
                                               queryRDD._srdd, useIndex,
                                               considerBoundaryIntersection)
        serlialized = jvm.GeoSerializerData.serializeToPythonHashSet(srdd)

        return RDD(serlialized, sc, GeoSparkPickler())
コード例 #4
0
ファイル: join_query.py プロジェクト: Imbruced/geo_pyspark
    def spatialJoin(cls, queryWindowRDD: SpatialRDD, objectRDD: SpatialRDD,
                    joinParams: JoinParams) -> RDD:
        """

        :param queryWindowRDD:
        :param objectRDD:
        :param joinParams:
        :return:
        """

        jvm = queryWindowRDD._jvm
        sc = queryWindowRDD._sc

        jvm_join_params = joinParams.jvm_instance(jvm)

        srdd = jvm.JoinQuery.spatialJoin(queryWindowRDD._srdd, objectRDD._srdd,
                                         jvm_join_params)

        serlialized = jvm.GeoSerializerData.serializeToPython(srdd)

        return RDD(serlialized, sc, GeoSparkPickler())