LineString array method (property) returns different data type without and with NumPy installed
|Reported by:||mal||Owned by:||sir-sigurd|
|Severity:||Normal||Keywords:||GIS, NumPy, LineString|
|Cc:||deprince@…, Ubercore||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||yes|
|Needs tests:||no||Patch needs improvement:||yes|
Apparently LineString (and probably other geometry types) return data in different types depending on whether NumPy is installed.
Simple test case (reproducible in Django 1.3, 1.3.1 and 1.4.1).
Clean virtual env with only Django installed (and ipython).
First - no NumPy installed.
In : from django.contrib.gis.geos import LineString In : line = LineString((0, 0), (3, 3)) In : line.array Out: [(0.0, 0.0), (3.0, 3.0)]
Now - install NumPy and try again.
In : from django.contrib.gis.geos import LineString In : line = LineString((0, 0), (3, 3)) In : line.array Out: array([[ 0., 0.], [ 3., 3.]])
[(0.0, 0.0), (3.0, 3.0)] =! array( 0., 0.],[ 3., 3.?)
This is rather serious issue.
Change History (16)
comment:1 in reply to: ↑ description ; follow-up: ↓ 2 Changed 4 years ago by claudep
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:8 Changed 4 years ago by Ubercore
- Cc Ubercore added
- Triage Stage changed from Accepted to Design decision needed
comment:10 Changed 4 years ago by Ubercore
- Has patch set
- Status changed from new to assigned
- Triage Stage changed from Design decision needed to Accepted
comment:15 Changed 4 years ago by ptone
- Needs documentation set
- Patch needs improvement set
- Type changed from Bug to Cleanup/optimization