#435 closed defect (fixed)
2d/3d overlay fails elevating all vertices
Reported by: | strk | Owned by: | strk |
---|---|---|---|
Priority: | major | Milestone: | 3.3.0 |
Component: | Default | Version: | main |
Severity: | Content | Keywords: | |
Cc: |
Description
Intersection between these two lines
LINESTRING(0 0,0 10,10 10,10 0) LINESTRING(10 10 4,10 0 5,0 0 5)
Results in a collection of a 3d point and a 2d line.
ElevationMatrix should instead be engaged to elevate everything.
Change History (8)
comment:1 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 13 years ago
comment:3 by , 13 years ago
Ok, problem is CoordinateSequence::getDimension which is using a cached 'dimension' member and not updating it after filtering.
Should be fixable by either avoiding the cache or properly maintaining it.
The caching code was introduced here:
commit ecffbba56f92f454dcdd8d5542c890439718a676 Author: warmerdam <warmerdam@5242fede-7e19-0410-aef8-94bd7d2200fb> Date: Mon May 31 16:25:57 2010 +0000 Attempt to make geometry dimension perform more smoothly. Modified CoordinateArraySequence to default to unknown dimension (0), which is determined at the point getDimension() is called by examination of the first coordinate Z (ISNAN test). The WKTWriter has also been altered to write 0.0 instead of nan, and to avoid writing "Z" for EMPTY geometries.(#348) git-svn-id: http://svn.osgeo.org/geos/trunk@2998 5242fede-7e19-0410-aef8-94bd7d2200fb
@FrankW : willing to take a look yourself ?
comment:4 by , 13 years ago
Clearing the cache in CoordinateArraySequence::apply_rw seems to fix it effectively.
comment:5 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
r3278 fixes by clearning the "dimension" cache in ::apply_rw
comment:6 by , 13 years ago
I dubt the cache makes sense, btw, as the way dimension is computed is by looking at a single Coordinate anyway, which doesn't take all that time...
comment:7 by , 13 years ago
The dimension variable is used primarily so that at creation time the dimension can be set explicitly. For instance, it should be legal to have a geometry with all zero "Z" values but still having dimension 3 *or* 2.
I think it would be more appropriate for apply_rw() to reset a dimension of 2 to 3 if any of the filtered vertices have a non-NAN, non-zero Z coordinate after processing.
ElevationMatrix is doing the right thing. I suspect the problem depends on a geometry's getCoordinateDimension