uDIG
  1. uDIG
  2. UDIG-1615

Create Polygon Tool Validation Broken

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: UDIG 1.2.RC1
    • Fix Version/s: UDIG 1.2.RC2
    • Component/s: tools and editing
    • Labels:
      None

      Description

      Tony Roth sent the following mail:

      Hi Developers,

      an issue (GEOT-2958) that has been fixed for Geotools 2.6.2 causes an
      incorrect behaviour of the PolygonTool. Finishing the creation of polygons
      with a double click ends up in an error dialog, saying something like "The
      geometry resulting from the edit is invalid. Undo the last edit command
      (Ctrl+Z) and try again".

      I think the reason for this could be the last modification of the
      JTSUtilities class in gt-shapefile-2.6.2.jar. Have a look at the nested loop
      in the following method:

         public static final LinearRing reverseRing(LinearRing lr) {
             GeometryFactory gf = lr.getFactory();
             CoordinateSequenceFactory csf = gf.getCoordinateSequenceFactory();
      
             CoordinateSequence csOrig = lr.getCoordinateSequence();
                     int numPoints = csOrig.size();
                     int dimensions = csOrig.getDimension();
                     CoordinateSequence csNew = csf.create(numPoints, dimensions);
      
                     for (int i = 0; i < numPoints; i++) {
                             for (int j = 0; j < dimensions; j++) {
                                     csOrig.getOrdinate(i, j);
                             }
                     }
      
             return gf.createLinearRing(csNew);
         }
      

      The CoordinateSequence isn't filled with coordinates?

      I might be on the wrong tack.
      Tony

        Issue Links

          Activity

          Hide
          Jody Garnett added a comment -
          GEOT-2974 has a patch; waiting on a test case.
          Show
          Jody Garnett added a comment - GEOT-2974 has a patch; waiting on a test case.
          Hide
          Jody Garnett added a comment -
          Fixed up JTSUtilities.
          Show
          Jody Garnett added a comment - Fixed up JTSUtilities.

            People

            • Assignee:
              Unassigned
              Reporter:
              Jody Garnett
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: