Opened 16 years ago

Closed 16 years ago

Last modified 13 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.

Example:

>>> 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 16 years ago.
Patch to add line_merge to geos geometries, with test case

Download all attachments as: .zip

Change History (5)

by psmith, 16 years ago

Attachment: linemerge.patch added

Patch to add line_merge to geos geometries, with test case

comment:1 by jbronn, 16 years ago

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

comment:2 by jbronn, 16 years ago

Description: modified (diff)

Now in the gis-1.1 mercurial repo, see http://geodjango.org/hg/gis-1.1/rev/87b34dce202d.

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

comment:3 by jbronn, 16 years ago

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 geometries.py.
  • Internally, all C API methods are explicitly called from a module rather than a star import.

Fixed #9557, #9877, #10222

comment:3 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

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