VERIFIED SOLUTION i
X

How to remove null or zero length objects from a table in MapInfo Professional

UPDATED: May 4, 2017


In order to remove objects that either have no geometry (i.e. have yet to be geocoded) or have zero length geometry, you would need to create a new table from the existing table rather than modify it.

To do this, you can use the SQL Select functionality. The following SQL will create a new selection that does not contain invalid objects:
 
SELECT *
FROM ORIGINAL_TABLE
WHERE Str$(obj) <>"" AND ObjectLen(obj, "km") <> 0 

Using the SQL Select function, the above SQL can be transposed as thus:

Select Columns: SELECT *
from Tables: ORIGINAL_TABLE
where Condition: Str$(obj) <>"" AND ObjectLen(obj, "km") <> 0 
into Table Named: NEW_TABLE

The Str$() function converts the object into a textual string. Valid outputs are "Point", "Multipoint", "Line", "Polyline", "Region", "Collection", "Rectangle", "Rounded Rectangle", "Arc", "Ellipse", or "Text". 
The ObjectLen() function measures the length of an object taking into account it's projection.

Environment Details

Product affected: MapInfo Professional™ 

Downloads

  • No Downloads