i Would like to calculate the Sum of pipe lengths in Mapinfo within a polygon. Any ideas?
- Open the MapBasic window (from the Option menu)
- Select you polygon
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
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