Commit 083a3a4e authored by Tim Graham's avatar Tim Graham
Browse files

Fixed #13904 - Documented how to avoid garbage collection messages in GIS.

Thanks Claude Peroz for the patch.
parent c5d6f6d6
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -75,6 +75,17 @@ return a :class:`GEOSGeometry` object from an input string or a file::
    >>> pnt = fromfile('/path/to/pnt.wkt')
    >>> pnt = fromfile(open('/path/to/pnt.wkt'))

.. _geos-exceptions-in-logfile:

.. admonition:: My logs are filled with GEOS-related errors

    You find many ``TypeError`` or ``AttributeError`` exceptions filling your
    Web server's log files. This generally means that you are creating GEOS
    objects at the top level of some of your Python modules. Then, due to a race
    condition in the garbage collector, your module is garbage collected before
    the GEOS object. To prevent this, create :class:`GEOSGeometry` objects
    inside the local scope of your functions/methods.

Geometries are Pythonic
-----------------------
:class:`GEOSGeometry` objects are 'Pythonic', in other words components may
+2 −0
Original line number Diff line number Diff line
@@ -191,6 +191,8 @@ GEOS C library. For example:
    The setting must be the *full* path to the **C** shared library; in
    other words you want to use ``libgeos_c.so``, not ``libgeos.so``.

See also :ref:`My logs are filled with GEOS-related errors <geos-exceptions-in-logfile>`.

.. _proj4:

PROJ.4