sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlebi...@apache.org
Subject svn commit: r1713282 - /sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java
Date Sun, 08 Nov 2015 19:47:31 GMT
Author: mlebihan
Date: Sun Nov  8 19:47:31 2015
New Revision: 1713282

URL: http://svn.apache.org/viewvc?rev=1713282&view=rev
Log:
Multiple calls are made to Polygon.startPath() when a polygon has multiple parts.

Modified:
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java

Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java?rev=1713282&r1=1713281&r2=1713282&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java
[UTF-8] Sun Nov  8 19:47:31 2015
@@ -305,7 +305,17 @@ public class ShapefileByteReader extends
 
         // create a line from the points
         for(int index=0; index < numPoints; index ++) {
-            if (index == 0) {
+            // Check if this index is one that begins a new part.
+            boolean newPolygon = false;
+
+            for(int j=0; j < partsIndexes.length; j ++) {
+                if (partsIndexes[j] == index) {
+                    newPolygon = true;
+                    break;
+                }
+            }
+            
+            if (newPolygon) {
                 poly.startPath(xPoints[index], yPoints[index]);                
             }
             else {



Mime
View raw message