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 Would like to calculate the Sum of pipe lengths in Mapinfo within a polygon. Any ideas?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted
  1. Open the MapBasic window (from the Option menu)
  2. Select you polygon
  3. Run these statements from the MapBasic window. Simple copy & paste them into the MapBasic window, hightlight all the lines and hit enter. Do replace "PIPES" with the name of your table.

    Fetch First From Selection

    Dim oSel As Object

    oSel = Selection.OBJ

    Select Sum(ObjectLen(Overlap(PIPES.OBJ, oSel), "m")) "SumLength, m" From PIPES Where PIPES.OBJ Intersects oSel

    Browse * From Selection

    UnDim oSel

This should give you a browser with the sum of the lengths of the lines within the selected polygon.

Do note that the length is only measured within the selected polygon. Some lines may extend outside the polygon. That part of the lines is not part of the total length

share|improve this answer
add comment

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.