mszlazak

Reading Polygon Geometries. Help with Javascript search cursor on  polygon  features

Discussion created by mszlazak on May 11, 2013
Latest reply on May 13, 2013 by mszlazak
I am having a problem detecting holes with my Javascript search cursor that I based on the info found here:

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Reading_geometries/002z0000001t000000/#GUID-1A3F0F89-EA03-4560-8629-C2639A4AA6EC

My script is:

   function parseGeometry(geometry) {
    var feature = [];
    for (var i = 0, I = geometry.length; i < I; ++i) {
     var parts = geometry[i].getPaths();
     var paths = [];
     for (var j = 0, J = parts.getLength(); j < J; ++j) {
      part = parts.getAt(j);
      path = [];
      for (var k = 0, K = part.getLength(); k < K; ++k) {
       var pnt = part.getAt(k);
       if (pnt) {
        path.push([pnt.lng(), pnt.lat()]);
       }
       else {
        console.log("Hole in geometry " + i + " at part " + j);
       }
      }
      paths.push(path);
     }
     feature.push(paths);
    }
    return feature;
   }

I am using it to read drive time coverage polygons BUT can't seem to get "hole" information.

Outcomes