Opened 6 weeks ago

Closed 6 weeks ago

Last modified 6 weeks ago

#7128 closed defect (fixed)

POINT EMPTY in a geometrycollection causes an error.

Reported by: cdestigter Owned by: warmerdam
Priority: normal Milestone: 2.1.5
Component: default Version: 2.1.0
Severity: normal Keywords:
Cc:

Description

This admittedly strange geometry is causing us grief:

>>> from osgeo import ogr
>>> ogr.CreateGeometryFromWkt('GEOMETRYCOLLECTION(POINT(1 2),POINT EMPTY)')
Traceback (most recent call last):
  File "<ipython-input-5-246577802f67>", line 1, in <module>
    ogr.CreateGeometryFromWkt('GEOMETRYCOLLECTION(POINT(1 2),POINT EMPTY)')
  File "/usr/lib/python2.7/dist-packages/osgeo/ogr.py", line 5484, in CreateGeometryFromWkt
    return _ogr.CreateGeometryFromWkt(*args, **kwargs)
RuntimeError: OGR Error: Corrupt data

I was thinking this behaviour must be a GEOS thing, but using Django's GEOS bindings I get a different result.

>>> from django.contrib.gis import geos
>>> geos.GEOSGeometry('GEOMETRYCOLLECTION(POINT(1 2),POINT EMPTY)')
<GeometryCollection object at 0x7fbcf6ca6d90>

GEOS 3.4.2 FWIW, and both are using the same /usr/lib/libgeos-3.4.2.so

Change History (7)

comment:1 Changed 6 weeks ago by Even Rouault

Resolution: fixed
Status: newclosed

In 40621:

importFromWkt(): fix import of GEOMETRYCOLLECTION ending with POINT EMPTY or LINESTRING EMPTY (fixes #7128, 2.1 regression)

comment:2 Changed 6 weeks ago by Even Rouault

In 40622:

importFromWkt(): fix import of GEOMETRYCOLLECTION ending with POINT EMPTY or LINESTRING EMPTY (fixes #7128, 2.1 regression)

comment:3 Changed 6 weeks ago by Even Rouault

In 40623:

importFromWkt(): fix import of GEOMETRYCOLLECTION ending with POINT EMPTY or LINESTRING EMPTY (fixes #7128, 2.1 regression)

comment:4 Changed 6 weeks ago by Even Rouault

Milestone: 2.1.5
Version: svn-trunk2.1.0

Pure OGR bug. GEOS is not involved in this

comment:5 Changed 6 weeks ago by Even Rouault

In 40624:

Perl tests: disable some tests for now (refs #7128)

comment:6 Changed 6 weeks ago by Even Rouault

In 40625:

Perl tests: disable some tests for now (refs #7128)

comment:7 Changed 6 weeks ago by Even Rouault

In 40626:

Perl tests: disable some tests for now (refs #7128)

Note: See TracTickets for help on using tickets.