Skip to content

What is the best way to calculate st_contains(linestring/multiLinestring, linestring/multiLinestring) like BigQuery does? #448

@shinyano

Description

@shinyano

In BigQuery,

select st_contains(
    st_geogfromtext('linestring(0 0, 10 0, 10 10, 0 10, 0 0)'), 
    st_geogfromtext('multilinestring((0 0, 10 0, 10 5),(0 10, 0 0))')
) as `contains`;

returns true.

As you can see, a multiLinestring can be contained by a linestring as long as all edges of it are covered by the edges of linestring.

And in S2, S2Polyline::contains() and S2BooleanOperation::Contains() on lines always return false regardless of S2BooleanOperation::PolylineModel. So what is the best way to calculate contains like BQ does?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions