Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

i am trying to fill a polygon with lines and calculate total distance of these lines.

http://i.stack.imgur.com/KxdqN.png

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?

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

share|improve this question

1 Answer 1

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

 
discard

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.