#27472: GEOSGeometry('POINT EMPTY').ogr crashes
-------------------------------------------+------------------------
               Reporter:  Sergey Fedoseev  |          Owner:  nobody
                   Type:  Bug              |         Status:  new
              Component:  GIS              |        Version:  1.8
               Severity:  Normal           |       Keywords:
           Triage Stage:  Unreviewed       |      Has patch:  0
    Needs documentation:  0                |    Needs tests:  0
Patch needs improvement:  0                |  Easy pickings:  0
                  UI/UX:  0                |
-------------------------------------------+------------------------
 {{{
 #!div style="font-size: 80%"
 {{{#!python
 In [1]: from django.contrib.gis.geos import GEOSGeometry

 In [2]: GEOSGeometry('POINT EMPTY').ogr
 No handlers could be found for logger "django.contrib.gis"
 ---------------------------------------------------------------------------
 GEOSException                             Traceback (most recent call
 last)
 <ipython-input-2-2913b5e786ad> in <module>()
 ----> 1 GEOSGeometry('POINT EMPTY').ogr

 /home/sergey/dev/django/django/contrib/gis/geos/geometry.pyc in ogr(self)
     484             except gdal.SRSException:
     485                 pass
 --> 486         return gdal.OGRGeometry(self.wkb)
     487
     488     @property

 /home/sergey/dev/django/django/contrib/gis/geos/geometry.pyc in wkb(self)
     450         `ewkb` property instead.
     451         """
 --> 452         return wkb_w(3 if self.hasz else 2).write(self)
     453
     454     @property

 /home/sergey/dev/django/django/contrib/gis/geos/prototypes/io.pyc in
 write(self, geom)
     227     def write(self, geom):
     228         "Returns the WKB representation of the given geometry."
 --> 229         return six.memoryview(wkb_writer_write(self.ptr, geom.ptr,
 byref(c_size_t())))
     230
     231     def write_hex(self, geom):

 /home/sergey/dev/django/django/contrib/gis/geos/libgeos.pyc in
 __call__(self, *args, **kwargs)
     155         if self.func is None:
     156             self.func = self.get_func(*self.args, **self.kwargs)
 --> 157         return self.func(*args, **kwargs)
     158
     159     def get_func(self, *args, **kwargs):

 /home/sergey/dev/django/django/contrib/gis/geos/prototypes/threadsafe.pyc
 in __call__(self, *args)
      54             # Call the threaded GEOS routine with pointer of the
 context handle
      55             # as the first argument.
 ---> 56             return self.cfunc(self.thread_context.handle.ptr,
 *args)
      57         else:
      58             return self.cfunc(*args)

 /home/sergey/dev/django/django/contrib/gis/geos/prototypes/errcheck.pyc in
 check_sized_string(result, func, cargs)
      60     """
      61     if not result:
 ---> 62         raise GEOSException('Invalid string pointer returned by
 GEOS C function "%s"' % func.__name__)
      63     # A c_size_t object is passed in by reference for the second
      64     # argument on these routines, and its needed to determine the

 GEOSException: Invalid string pointer returned by GEOS C function
 "GEOSWKBWriter_write_r"
 }}}
 }}}

 The cause of this problem is that empty points couldn't be represented in
 WKB.
 There are similar crashes in the other places. I'm not sure if individual
 tickets should be created or all fixes should be done within the bounds of
 this ticket.

--
Ticket URL: <https://code.djangoproject.com/ticket/27472>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.68e2a148385a5615b9f8c816b572fac4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to