GeoTools
  1. GeoTools
  2. GEOT-1254

A NullPointerException is thrown in StreamingRenderer when a MapLayer contains no features

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 2.7.6
    • Component/s: render
    • Labels:
      None
    • Environment:
      Java 6, Windows Vista
    • Testcase included:
      yes

      Description

      The problem occurs in GeoTools 2.3.1 (but is also present in the trunk), when rendering a map context that has an empty layer.
      In this situation a NullPointerException is thrown in the StreamingRenderer class, in the processStylers(...) method, because
      "geometryAttribute" variable is null, see code below:

      final GeometryAttributeType geometryAttribute = schema.getDefaultGeometry();
      final CoordinateReferenceSystem sourceCrs = geometryAttribute.getCoordinateSystem();

      Attached you can find a testcase for replicating the problem and patch for the trunk version.

      1. EmptyLayerBugTestCase.java
        1 kB
        Teodor Baciu
      2. patch-teodorbaciu.txt
        0.9 kB
        Teodor Baciu

        Activity

          People

          • Assignee:
            Jesse Eichar
            Reporter:
            Teodor Baciu
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: