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

share|improve this question
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

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.