Ticket #1111 (closed feature: fixed)

Opened 6 years ago

Last modified 5 years ago

Empty geometry IE error + fix

Reported by: rdewit Owned by:
Priority: minor Milestone: 2.6 Release
Component: Renderer Version: 2.5
Keywords: Cc:
State: Complete

Description

Creating an empty geometry is fine in Firefox (SVG), but fails in IE (VML). It goes wrong in VML.js in setNodeDimension. This method tries to create a bbox, then tests for its existence, but not if there is something in there. This very simple patch at least prevents OL from giving an error. The discussion in the mailing list about whether or not to fail safely or not should result in a decision what to do with this (hopefully).

Attachments

renderer_vml_empty_geometry_fix.diff Download (466 bytes) - added by rdewit 6 years ago.
renderer_ignore_empty_geom.diff Download (481 bytes) - added by rdewit 5 years ago.
Do not call drawGeometry when the geometry is not defined or incorrect

Change History

Changed 6 years ago by rdewit

Changed 6 years ago by camerons

  • owner set to tschaub
  • component changed from Renderer.VML to Geometry.Point

Chris has noted on IRC that he doesn't think VML.setNodeDimension() is the right place to catch this error and after digging around I agree.

The problem is that a point geometry is created which has an x,y point of (null, null). This eventually causes an exception in the VML renderer.

I propose we fix in Geometry/Point.initialize(x,y) where we should throw an exception if x or y is null.

Reason: 1. Exceptions are already raised by Format/KML.js if it needs to create a (null,null) point, so I believe we have a precedence for handling errors by raising exceptions.

2. Our error was caused because Format/GML.js allows the creation of (null,null) points, probably from an empty <Point></Point> tag.

3. I don't expect to break any legacy code by forcing Geometry to have valid values because old code would have caused exceptions in VML.js as we discovered.

Changed 5 years ago by crschmidt

  • state set to Needs Discussion

I think that Tim's desire on this is to be able to have null geometries, because at times, you don't have a geometry yet when you create your point -- it is assigned later. Bumping to needs discussion so we can get some feedback on this.

At this point, I'm in favor of simply making the SVG renderer agree with the VML renderer -- which means neither bombs on null geoms. Unless there's a strong motivation to *not* do this, I think this should go in regardless of whether we prevent empty geometries or not.

Changed 5 years ago by crschmidt

  • state changed from Needs Discussion to Needs More Work

Renderers MUST ignore empty geometries. IF they get something which has a null x or y, they MUST not bomb out, and should simply not draw the geometry.

If the empty geometry is in the middle of a set of geometries -- like an empty point in a linestring -- the renderer MUST skip the point and move on to the next one.

For any more clarifications on this, please ask. This patch is the wrong place to solve the problem still, but I think this leads the direction for a new patch.

Changed 5 years ago by rdewit

  • owner tschaub deleted
  • state changed from Needs More Work to Review
  • component changed from Geometry.Point to Renderer

Is the patch mentioned above getting closer to what we want?

Changed 5 years ago by rdewit

Do not call drawGeometry when the geometry is not defined or incorrect

Changed 5 years ago by rdewit

  • state changed from Review to Needs Discussion

The patch 'renderer_ignore_empty_geom.diff' only tackles null geometries. As crschmidt pointed out, this doesn't prevent issues with incorrect points in lines or polygons.

Changed 5 years ago by crschmidt

  • state changed from Needs Discussion to Commit

For now, until we can actually craft one of these in context, I think that this is fine. We can reopen this ticket, and keep in mind that if the renderer bombs because of a bogus geometry, we should fix it.

Changed 5 years ago by crschmidt

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [6023]) Don't render features with no geometry. This gives us similar behavior in IE and FF. There is probably more to this, but we can solve those issues as they come up: going with this one as is for now. (Closes #1111)

Note: See TracTickets for help on using tickets.