Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am pretty new to arcpy and am slowly learning all its functions. I have a scenario where I am traversing a polyline. I get a start point and an end point on the polyline and form a segment with those points. That segment is used to create geometries to construct a polygon around that area of the polyline.

My problem is that on areas where the polyline curves, a part of the polyline is outside of the polygon. Ultimately I will need to shift my polygon downward/upward depending (change the heights of the polygon). I was looking to construct a function using the [contains] method but am lost on how to write a function to see if every point in the polyline, between that segment, fits inside of the polygon. Any help/ideas would be greatly appreciated. Thanks in advance

share|improve this question
Are you trying to convert polylines to polygons? Perhaps a visual aid would help. – blah238 Mar 5 '13 at 23:33
There shouldn't be any conversion neccessary. I was able to find a [contains] method that I'm still testing out to see if it answers my own question 'code' shape1 = "C:\Temp\Test1.shp" shape2 = "C:\Temp\Test2.shp" for row1 in arcpy.SearchCursor(shape1): for row2 in arcpy.SearchCursor(shape2): if row1.shape.contains(row2.shape): print "True"'code' <---------- im not sure how or why its not being put in its grey code block. I must have done it wrong – user1898629 Mar 6 '13 at 17:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.