Jump to content

 
Photo

A question for Mapbasic

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Tuan VietNam

Tuan VietNam

    Newbie

  • New Member
  • Pip
  • 1 posts
  • No Country Selected

Hi List



I have a problem that is putting information for attribute.



There are tow layer map: a table contains text, one contains polygon



I want to put label of text layer for polygon.



Can anyone know that code to help me?



Thanks



Tuan

#2
gregsd

gregsd

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 169 posts
  • Gender:Male
  • Location:Surrey, England.
  • Interests:Cycling, mostly off-road (MTB) riding.
  • United Kingdom

Hi List
I have a problem that is putting information for attribute.
There are tow layer map: a table contains text, one contains polygon
I want to put label of text layer for polygon.
Can anyone know that code to help me?

Thanks
Tuan


You can do this using the Update Column function from the Tables menu:

Table to Update: polygon_tab (= the name of your polygon table)
Column to Update: column name (= the name of the column to update with the text)
Get Value from Table: text_tab (= the name of the text object table)
Join: - where object from table text_tab is within object from table poly_tab

Calculate: value
Of: Expression – objectinfo(obj, 3)

The expression will return a string representing the text object ( 3 = OBJ_INFO_TEXTSTRING)

This will update the selected column where the text objects are within the polygons. If you need to see the code behind this then you can open the MapBasic window within MapInfo (Options -> Show MapBasic Window), run the update and it’ll be shown in the MapBasic window.

HTH


Greg Driver

GIS Analyst
MapInfo User...!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->