how to set attributes on a polyline

578
1
02-10-2014 10:59 AM
MichaelEber
Occasional Contributor
here is what I am trying to achieve:
  We have a polygon area that will delay a ship moving through that area for a period of time.  I need to apply this to our hydrography map.

How we are doing this:
  Each cell in the cost array equal (n sec/meter) * 1000 depending on the speed of the ship
  The delay needs to be applied with the value 1 in the middle cells and the delay time / 2 in the outer rim of the polygon.

  We use IExtractionOp2.Polygon to get the part of the hydrography raster that the polygon overlays
  We set the entire polygon area to the value 1 using ReclassByRemap
  Next I get the polygon.Boundary to get the polyline that encompasses the outer ring of the polygon.
  Finally I intended to call PolygonToRaster to get a raster with the outer rim set to delay time /2

The call to PolylineToRaster fails and I think the reason is I'm passing an integer field.  The documetation, I found, states it has to be "any attribute field in the Polygon".  So how do I set a specific attirbute field with the values I need?  The polyline doesn't even expose anything like AddAttribute!!!

Thanks
0 Kudos
1 Reply
DuncanHornby
MVP Notable Contributor
Mike,

It is not clear which tools you are trying to run.

You state "Next I get the polygon.Boundary to get the polyline that encompasses the outer ring of the polygon." but IPolygon has no method Boundary?

You refer to "PolylineToRaster" can I assume this is the geo-processing tool and not some function you are attempting to build? If it is then this tool takes as input a FeatureLayer not a single geometry object so a number for a field makes no sense. To use this tool you would need to store your polyline in a FeatureClass and supply the FeatureClass to the tool.

Duncan
0 Kudos