How do I extract all the useful data that mapInfo uses into real
numbers that can then be used outside of the MapInfo environment? I'm
trying to compile all of our data into an MS Access database.
Thanks
Tom
In Mapinfo, you have data columns (like a database) plus an extra
invisible column called obj which contains the spatial information and
can be queried like any other. This is a bit of a simplification but
it will do. To do anything useful, you would need to write a program
in mapbasic (or mapxtreme) but you can get some idea from using the
mapbasic window in mapinfo.
For example ObjectInfo(obj,OBJ_INFO_NPOLYGONS) tells you how many
polygons make up an object, ObjectNodeX(obj,1,2) gives you the x co-
ordinate of the 2nd node of the first polygon in obj. After that, it
all gets complicated - what happens if there are multiple polygons to
an object - how do you tell if it's a hole or a polygon (hint:polygons
are clockwise, holes are anti-clockwise).
Anyway - hopefully this will give you some pointers as to where you
might start - or perhaps make you decide not to start at all!
Regards,
Phil
www.philallen.net
As mentioned, there is a hidden 'obj' column. To use it, do something
like
Open table "myTable"
Fetch first from myTable
' myTable.obj represents the object in the first record in the
table
There are a number of MapBasic functions that will extract information
about objects -- ObjectInfo(), ObjectGeography(), Centroid(),
CentroidX(), CentroidY(), and others.
To learn more about how to extract detailed information about objects,
you might want to look at the MapBasic utility GELink.mbx,
specifically the subprocedure processDisaggTable() in module
gelink_ExportKML.mb. You can search for GELink on the MapInfo web
site.
Charles Bates
MapInfo Corp.
Under the Function dropdown there are several spatial variables - e.g.
Area, Perimeter, etc.
A bit long winded if you have lots of polygons - but you can always
use the MapBasic window and copy and paste the commands if all the
polygons are similarly named...