Create Points with MapBasic

640 views
Skip to first unread message

A.Jame...@googlemail.com

unread,
May 19, 2008, 11:54:24 AM5/19/08
to MapInfo-L
Does any one know how to replicate the "Create Points" from function
MapInfo in MapBasic?

Yours

James

Kent.T...@state.mn.us

unread,
May 19, 2008, 12:16:07 PM5/19/08
to mapi...@googlegroups.com

UPDATE Table Set Obj = CreatePoint(CentroidX(Obj),CentroidY(Obj))
____________
Kent Treichel
GIS Analyst
Tax Research
Minnesota Department of Revenue
MS 2230
600 North Robert St
St. Paul, MN 55146-2230
651-556-6150
fax 651-556-3103




"A.Jame...@googlemail.com" <A.Jame...@googlemail.com>     05/19/2008 10:54 AM
Sent by: mapi...@googlegroups.com
Please respond to: mapi...@googlegroups.com

To
MapInfo-L <mapi...@googlegroups.com>
cc
Subject
[MI-L] Create Points with MapBasic


Bill Thoen

unread,
May 19, 2008, 3:12:17 PM5/19/08
to mapi...@googlegroups.com
Kent.T...@state.mn.us wrote:
>
> UPDATE Table Set Obj = CreatePoint(CentroidX(Obj),CentroidY(Obj))
Since there is no object yet, this won't work. Instead you get your
coordinates from columns in the table and use this command:

UPDATE MyTable SET obj = CreatePoint ( x_column, y_column )

To set the symbol you want BEFORE you do this, use these commands:

Include "MapBasic.def"
Set Style Symbol MakeSymbol (34,YELLOW,9)

If you use the constant 'YELLOW' the you need to include MapBasic.def,
but you don't if you use the color number (e.g. 16776960 for yellow).
See the online help for "Symbol Clause" for rmore detail about this.


If your coordinates are not Longitude and Latitude, then before you
create points, you need to set the coordinate system to match the one
that your coordinates represent. This command is:

Set CoordSys ...

(see the online help for "CoordSys Clause" to get more info about this.)

- Bill Thoen

AlbertT

unread,
May 20, 2008, 2:17:05 AM5/20/08
to MapInfo-L

In addition to BillT's reply:

If your starting from a non-mappable table, don't forget to
make your table mappable first:

(long lat CoordSys):

Create Map For TableName CoordSys Earth Projection 1, 0

(see the online help for "Create Map" to get more info about this.)

AlbertT


On May 19, 8:54 am, "A.James.B...@googlemail.com"

A.Jame...@googlemail.com

unread,
May 20, 2008, 9:31:20 AM5/20/08
to MapInfo-L
Many thanks all, will try these in the week when I have a chance
Reply all
Reply to author
Forward
0 new messages