Ticket #400 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

ST_Split

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 2.0.0
Component: postgis Version:
Keywords: Cc:

Description

Split polygon by line, line by line, line by point. Returns components as either a set or collection.

Change History

Changed 5 years ago by strk

Changed 4 years ago by strk

Alright, here's the contract:

- Will split a poly by a line, a line by a line and a line by a point - Will always return a COLLECTION of at most 2 elements: first element is what is left after the cut, second element is what was cut - When you cut a line using a point, what's left is the initial portion of the line (from start to point) - When you cut a poly or a line using a line what's left is arbitrarly taken as the cut-part which goes to the *left* of the cut line. This is for assonance with the word "left"

For now there's no support for multi-part geometries requiring cutting, but given this contract it might not be too hard to support (every non-cut geometry would go to the "left" part).

Changed 4 years ago by strk

  • status changed from new to assigned

Again, trying to have trac keep my formatting :/

- Will split a poly by a line, a line by a line and a line by a point
- Will always return a COLLECTION of at most 2 elements: first element is what is left after the cut, second element is what was cut
- When you cut a line using a point, what's left is the initial portion of the line (from start to point)
- When you cut a poly or a line using a line what's left is arbitrarly taken as the cut-part which goes to the *left* of the cut line. This is for assonance with the word "left" 

Changed 4 years ago by strk

Come again (sorry, but can't sleep till I succeed in getting it formatted right)

  • Will split a poly by a line, a line by a line and a line by a point
  • Will always return a COLLECTION of at most 2 elements: first element is what is left after the cut, second element is what was cut
  • When you cut a line using a point, what's left is the initial portion of the line (from start to point)
  • When you cut a poly or a line using a line what's left is arbitrarly taken as the cut-part which goes to the *left* of the cut line. This is for assonance with the word "left"

Thanks paul if this works :)

Changed 4 years ago by strk

  • summary changed from ST_SplitGeometry to ST_Split

Contract changed. We always return a collection but of as many elements as required to represent all components of output.

Currently line-by-point, line-by-line and poly-by-line splitting are supported and the function name is ST_Split.

Unsupported are all MULTI* and GEOMETRYCOLLECTION, but I'd like to add support for them too. The use case I have in mind is in conjunction to the ST_WrapX function proposed in ticket #454 (still not convinced about that function name:)

Changed 4 years ago by strk

  • status changed from assigned to closed
  • resolution set to fixed

As of r5444 multi* and collections are also supported. Documentation and testcases are in place.

Note: See TracTickets for help on using tickets.