Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 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: UI/UX:

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

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by psmith

Patch to add line_merge to geos geometries, with test case

comment:1 Changed 5 years ago by jbronn

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to jbronn
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by jbronn

  • 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 Changed 5 years ago by jbronn

  • Resolution set to fixed
  • Status changed from assigned to closed

(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 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.