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 trying to fill a polygon with lines and calculate total distance of these lines.

enter image description here

like this example. but i have different distances between these lines like 1 meter, 2 meter, 3 meter.. so i need to take this as an array from client side, calculate length for each of these parameters and return a json response, should i use arcgis modal as a geoprocessing service? or Server object extensions?

Actually i want to do this operation Filling a polygon with lines using Postgis in ArcGIS but not sure how

share|improve this question
up vote 3 down vote accepted

Whether to use an ArcGIS model as a geoprocessing service, or to write a Server object extension, will depend on the audience for the model/script - so I would first try to write a Python script that works on a test case.

The simplest script that would seem to do what you describe would be able to take just two parameters and create the result. Those parameters would be a feature class (already projected with units of metres) and a distance between lines.

The pseudo code would then be something like the following:

  1. Determine extent of polygon(s) in feature class and set variables xMin,yMin,xMax,yMax
  2. Create a new line feature class with same coordinate system as the polygon feature class
  3. Write line geometries into the new feature class - first line is xMin,yMax to xMax,yMax, next is xMin,(yMax - dist) to xMax,(yMax - dist), etc until (yMax - N*dist) < yMin
  4. Clip the line feature class (which will be series of horizontal lines) using the polygon feature class
  5. Use Summary Statistics to add up the length of the lines in the clipped line featureclass
share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.