Skip to content

Point (2D) Expands to Point Z on Intersection with LineString ZM #1367

@jlhumber

Description

@jlhumber

Hi geos team,

When working with a 2D point (just XY) and intersecting with a LineStringZM (or PolygonZM), the resulting Point is a Point Z whereas we were expecting it to expand out to a Point ZM like is done with other geometries, for example this is the happy path for a LineStringZM intersected with a LineString

from shapely import from_wkt
linezm = from_wkt('LineString (0 0 100 200, 10 0 300 400)')
line = from_wkt('LineString (2 0, 8 0)')
linezm.intersection(line)
# <LINESTRING ZM (2 0 140 240, 8 0 260 360)>

The above shows that the outcome includes ZM, in the case of a Point however this is what we see:

from shapely import from_wkt
linezm = from_wkt('LineString (0 0 100 200, 10 0 300 400)')
p = from_wkt('Point (2 0)')
p.intersection(linezm)
# <POINT Z (2 0 100)>

No measure dimension on the Point, Point Z is used for intersection there also is no M value added to the result, only when a Point ZM is used will the result include M when used on a LineString ZM (or Polygon ZM)

Note also the interpolated value for Z is different than that interpolated for a LineString (this will be reported in another issue).

ref: shapely/shapely#2404

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions