Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SEDONA-105] Add ST_PointOnSurface function #606

Merged
merged 13 commits into from
Apr 13, 2022
Merged

Conversation

hemenduroy
Copy link
Contributor

Is this PR related to a proposed Issue?

SEDONA-105

What changes were proposed in this PR?

Added ST_PointOnSurface

How was this patch tested?

Added unit tests for Scala, Python and Java. Tested the website using mkdocs.

Did this PR include necessary documentation updates?

Yes. Added descriptions on the websites and in the source code.

@hemenduroy hemenduroy changed the title Hemendu Roy [SEDONA-105] Add ST_PointOnSurface function #606 Apr 13, 2022
@hemenduroy hemenduroy changed the title [SEDONA-105] Add ST_PointOnSurface function #606 [SEDONA-105] Add ST_PointOnSurface function Apr 13, 2022
@hemenduroy
Copy link
Contributor Author

Fixed merge conflicts and unit test issues

@jiayuasu
Copy link
Member

@hemenduroy Please fix the python test case. The error is

AssertionError: assert 'POINT (0 5)' == 'POINT(0 5)'
E             - POINT(0 5)
E             + POINT (0 5)

@hemenduroy
Copy link
Contributor Author

@jiayuasu I was not aware Python unit tests had to be run separately. Fixed it and ran the tests locally now. I'm now getting an error in a file that I have not modified. I suspect it may have to do with my environment but I'm not sure. (Scala 2.13.0, Python 3.8.10, Spark 3.2.1)

 _____________ TestCrsTransformation.test_polygon_distance_join_with_crs_transformation ______________

self = <tests.utils.test_crs_transformation.TestCrsTransformation object at 0x7f726e45d3d0>

    def test_polygon_distance_join_with_crs_transformation(self):
        query_rdd = PolygonRDD(
            self.sc,
            input_location_query_polygon, splitter, True,
            num_partitions, StorageLevel.MEMORY_ONLY, "epsg:4326", "epsg:3857"
        )
        window_rdd = CircleRDD(query_rdd, 0.1)
    
        object_rdd = PolygonRDD(
            self.sc, input_location_query_polygon, splitter, True, num_partitions, StorageLevel.MEMORY_ONLY,
            "epsg:4326", "epsg:3857")
    
        object_rdd.rawJvmSpatialRDD.jsrdd.repartition(4)
        object_rdd.spatialPartitioning(GridType.KDBTREE)
        object_rdd.buildIndex(IndexType.RTREE, True)
        window_rdd.spatialPartitioning(object_rdd.getPartitioner())
    
        results = JoinQuery.DistanceJoinQuery(object_rdd, window_rdd, True, False).collect()
        assert 5467 == results.__len__()
    
        for data in results:
            for polygon_data in data[1]:
>               assert Circle(data[0].geom, 0.1).covers(polygon_data.geom)
E               assert False
E                +  where False = <bound method Circle.covers of <sedona.core.geom.circle.Circle object at 0x7f726dd79910>>(<shapely.geometry.polygon.Polygon object at 0x7f726e1a59d0>)
E                +    where <bound method Circle.covers of <sedona.core.geom.circle.Circle object at 0x7f726dd79910>> = <sedona.core.geom.circle.Circle object at 0x7f726dd79910>.covers
E                +      where <sedona.core.geom.circle.Circle object at 0x7f726dd79910> = Circle(<shapely.geometry.polygon.Polygon object at 0x7f726e1a57f0>, 0.1)
E                +        where <shapely.geometry.polygon.Polygon object at 0x7f726e1a57f0> = Geometry: Polygon userData: .geom
E                +    and   <shapely.geometry.polygon.Polygon object at 0x7f726e1a59d0> = Geometry: Polygon userData: .geom

tests/utils/test_crs_transformation.py:185: AssertionError

====================================== short test summary info ======================================
FAILED tests/utils/test_crs_transformation.py::TestCrsTransformation::test_polygon_distance_join_with_crs_transformation
================ 1 failed, 416 passed, 2 skipped, 197 warnings in 461.38s (0:07:41) =================

@jiayuasu jiayuasu merged commit c59ab62 into apache:master Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants