[postgis-tickets] [PostGIS] #3768: Geometry becomes invalid after a simple shift (black magic)

PostGIS trac at osgeo.org
Tue Jun 6 07:51:15 PDT 2017


#3768: Geometry becomes invalid after a simple shift (black magic)
--------------------------+------------------------------
  Reporter:  tobiasreber  |      Owner:  pramsey
      Type:  defect       |     Status:  new
  Priority:  medium       |  Milestone:  PostGIS 2.0.8
 Component:  postgis      |    Version:  2.1.x
Resolution:               |   Keywords:  invalid Geometry
--------------------------+------------------------------

Comment (by pramsey):

 Your "valid" polygon is very very very nearly invalid to start with (see
 the attached image). It **almost** has a couple self intersections. When
 you translate the geometry, you are not doing it in the real number space
 (contrary to your intuition) you're doing it within the grid of
 representable numbers provided by IEEE floating point representation. As a
 result, in addition to your large global shift, you'll see the relative
 position of the points will shift, very very slightly. Since your geometry
 is already just a hair away from being invalid, those small IEEE
 representation shifts are enough to flip if into an invalid state. You
 might want to just remove all "polygons" that have basically zero area
 before processing.

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3768#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list