Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#10222 closed (fixed)

[patch] Add line_merge to GEOS geometries under django.contrib.gis

Reported by: psmith Owned by: jbronn
Component: GIS Version: 1.0
Severity: Keywords: geos linemerge
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by jbronn)

In the C API of GEOS, GEOSLineMerge returns a new geometry that is the result of having merged contiguous line strings in a geometry collection or multi-line string geometry.


>>> geomcoll = fromstr('MULTILINESTRING((1 1, 3 3), (3 3, 4 2))')
>>> print geomcoll.line_merge()
LINESTRING(1 1, 3 3, 4 2)

Attachments (1)

linemerge.patch (4.1 KB) - added by psmith 11 years ago.
Patch to add line_merge to geos geometries, with test case

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by psmith

Attachment: linemerge.patch added

Patch to add line_merge to geos geometries, with test case

comment:1 Changed 11 years ago by jbronn

milestone: 1.1
Owner: changed from nobody to jbronn
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:2 Changed 11 years ago by jbronn

Description: modified (diff)

Now in the gis-1.1 mercurial repo, see

It is now a merged property that is only available on LineString and MultiLineString instances.

comment:3 Changed 11 years ago by jbronn

Resolution: fixed
Status: assignedclosed

(In [10131]) Refactored the GEOS interface. Improvements include:

  • Geometries now allow list-like manipulation, e.g., can add, insert, delete vertexes (or other geometries in collections) like Python lists. Thanks, Aryeh Leib Taurog.
  • Added support for GEOS prepared geometries via prepared property. Prepared geometries significantly speed up certain operations.
  • Added support for GEOS cascaded union as MultiPolygon.cascaded_union property.
  • Added support for GEOS line merge as merged property on LineString, and MultiLineString geometries. Thanks, Paul Smith.
  • No longer use the deprecated C API for serialization to/from WKB and WKT. Now use the GEOS I/O classes, which are now exposed as WKTReader, WKTWriter, WKBReader, and WKBWriter (which supports 3D and SRID inclusion)
  • Moved each type of geometry to their own module, eliminating the cluttered
  • Internally, all C API methods are explicitly called from a module rather than a star import.

Fixed #9557, #9877, #10222

comment:3 Changed 9 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top