Creating a polygon using minimum bounding rectangle co-ordinates

880 views
Skip to first unread message

Philip

unread,
Aug 16, 2011, 6:17:49 AM8/16/11
to MapInfo-L
Hello,

I have a list of point data with minimum bounding rectangle co-
ordinates (X1, X2 & Y1, Y2) for each record. Is there any way to
generate the rectangles for all points so I can see it on the map?

cheers

P

Andy Harfoot

unread,
Aug 16, 2011, 6:34:04 AM8/16/11
to mapi...@googlegroups.com
The following command typed into the MapBasic window will do this:
(Work on a copy of the point table as the command will overwrite the points)

update PointTable set obj = mbr(createline(X1,Y1,X2,Y2))

Andy
-- 
Andy Harfoot

GeoData Institute
University of Southampton
Southampton
SO17 1BJ

Tel:  +44 (0)23 8059 2719
Fax:  +44 (0)23 8059 2849

www.geodata.soton.ac.uk

---------------------------------------
For further information about GeoData's
Training Courses, please visit:
           www.gis-train.com
---------------------------------------

Andy Harfoot

unread,
Aug 16, 2011, 6:38:48 AM8/16/11
to mapi...@googlegroups.com
You will also need to make sure that MapInfo uses the appropriate coordinate system when interpreting the coordinate values - assuming the point table is in the same coordinate system as the X1,Y1,X2,Y2 values, then this command will ensure this (run before the update command):

set coordsys table PointTable

Andy Harfoot wrote:
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
Reply all
Reply to author
Forward
0 new messages