SlideShare a Scribd company logo
Welcome 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
Hands on Lab 
14D Automating Repetitive 
Tasks with MapBasic 
Peter Horsbøll Møller 
GIS/LI Pre-Sales Specialist 
June 13, 2014 
Every connection is a new opportunity™ 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
Automating Repetitive Tasks 
with MapBasic 
Time to look under the hood. 
Open up the MapBasic 
window to see how you can 
automate data processing and 
other tasks using MapInfo 
Professional. 
You might find some great 
time savers in this session. 
You do not need to be a 
programmer to benefit from 
these techniques. 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
MapBasic Documentation 
MapBasic Help file: Help System (zip) 
MapBasic Reference Guide: Reference 
MapBasic User Guide: User Guide 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
MapBasic Help File 
INTRODUCTION 
How to read the Help File? 
MapBasic Fundamentals 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
MapBasic Documentation 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
The Features of the MapBasic Window 
The MapBasic window in MapInfo Professional: 
•Can be opened via Options > Show MapBasic Window 
•Records, when open, (most) actions performed by the 
user in MapInfo Professional 
•Can also ”play back” actions/statements 
• Put the cursor in the line and hit the Enter-key 
• Highlight several lines and hit the Enter-key 
•You can save statements from the window to a text file via 
the MapBasic menu 
•You can clear the content in the window via the MapBasic 
menu 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Be adviced! 
Please note that 
•The MapBasic statements in the MapBasic window can be 
very specific. They can for example refer to a specific 
window, a specific table or similar 
•The scenario might not be completely similar next time 
you want to run a MapBasic statement. Maybe you don’t 
have any tables open, maybe there are no open windows, 
maybe the active window isn’t a map window and so on
Using the MapBasic window 
Open the MapBasic window 
Perform one or more actions using the interface in MapInfo 
Professional, that is a menu item, a button or similar 
Notice that the statements are written to the MapBasic 
window 
Now try to execute the statements one at a time via the 
MapBasic window 
Remember to clean up before you repeat the actions via 
the MapBasic window: Close tables or revert changes to 
tables and so forth. 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Example
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Update Column 
Normally you are limited to updating one column at a time 
thru the Update Column dialog. 
The MapBasic statement Update Table, however, lets you 
update several columns at a time 
Update table 
Set column = expr [ , column = expr, ...] 
[ Where RowID = idnum ] 
Use the dialog to get the syntax for one column and then 
modify the statement to update several afterwards
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Exercise 
Dataset 
•Exercise_DataCriminalActivity.TAB 
•Update X with CentroidX(OBJ) thru the dialog 
•Modify the Update Table statement to also update: 
• Y with CentroidY(OBJ) 
• CRIMEID with RowID 
•Consider setting the Coordinate System with: 
• Set CoordSys Table C
Append Rows to table 
With Append Rows to Table you can insert records from one 
table into another table 
Using the dialog you can however not control which column is 
inserted into which column. 
When using the dialog the order of the columns is important 
You can get around this issue using the MapBasic window 
Insert Into table [ ( columnlist ) ] 
{ Values ( exprlist ) 
| Select columnlist From table } 
Using columnlist you can specify columns with names like ID, 
X, Y, NAME instead of COL1, COL2, COL2, COL4 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Exercise 
Dataset 
•USCITY_125.TAB 
•USSTATECAP.TAB 
•Save a copy of StateCap as USCities 
•Append City_125 to USCities using Append Rows to Table 
•Revert changes to USCities 
•Modify the statement to use column names 
•Modify the statement to set FIPS_Code to ”00” for the cities inserted
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Exercise 
Modify your script to have the style of the state capitals as red circles 
using the statement: 
Set Style Symbol(35,16711680,12,"MapInfo Symbols",0,0) 
And the style of the cities as grey circles using this statement: 
Set Style Symbol (35,8421504,8,"MapInfo Symbols",0,0) 
Use CreatePoint to recreate the points using the new style 
You can set the style using Symbol Style and use this statement to get 
the symbol printed to the Message window: 
Print CurrentSymbol()
Creating Spatial Features 
You can create points using Table > Create Points. 
And you can create other basic spatial features using the 
MapBasic window and some MapBasic functions: 
 CreatePoint(x, y) 
 CreateLine(x1, y1, x2, y2) 
 CreateCircle(x, y, radius) 
 Buffer(OBJ, resolution, distance, units) * 
 MBR(OBJ) 
 Offset(OBJ, direction, distance, units) * 
 OffsetXY(OBJ, offsetx, offsety, units) * 
* Some of the functions above can be used in a Cartesian 
as well as a Spherical version 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Exercise 
Dataset 
•USStates.TAB 
•USUS_HIWAY.TAB 
•USUSCities.TAB (the table that we created in a previous exercise) 
•Create buffers around the cities based on the population 
•Set the size to (POP_1990 / 20000) miles – or pick your own size 
•Set the style as blue border for cities and red for state capitals
From Points to Squares 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Exercise 
Dataset 
•USStates.TAB 
•USUS_HIWAY.TAB 
•USUSCities.TAB (the table that we created in a previous exercise) 
•Add four columns (X1, Y1, X2, Y2) of type Float to the table USCities 
•Update these with: 
• CentroidX(Offset(OBJ, 45, (POP_1990 / 20000), ”mi”)) 
• CentroidY(Offset(OBJ, 45, (POP_1990 / 20000), ”mi”)) 
• CentroidX(Offset(OBJ, 225, (POP_1990 / 20000), ”mi”)) 
• CentroidY(Offset(OBJ, 225, (POP_1990 / 20000), ”mi”)) 
•Create a square around each city using CreateLine and MBR
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Solutions 
Set CoordSys Table CriminalActivity 
Update CriminalActivity 
Set X = CentroidX(obj) 
, Y = CentroidY(obj) 
, CrimeID = ROWID
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Solutions 
Commit Table STATECAP As “…USUSCities.tab" TYPE NATIVE 
Charset "WindowsLatin1" Interactive 
Open Table “…USUSCities.TAB" Interactive 
Insert Into USCities ( Capital, State, Pop_1990, 
Num_HU_90) Select City, State, Tot_Pop, Tot_hu From 
CITY_125 
Insert Into USCities ( Capital, State, Pop_1990, 
Num_HU_90) Select City, State, Tot_Pop, Tot_hu From 
CITY_125
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Solutions 
Commit Table STATECAP As “…USUSCities.tab" TYPE NATIVE 
Charset "WindowsLatin1" Interactive 
Open Table “…USUSCities.TAB" Interactive 
Set Style Symbol(35,16711680,12,"MapInfo Symbols",0,0) 
Update USCities 
Set OBJ = CreatePoint(CentroidX(OBJ), CentroidY(OBJ)) 
Set Style Symbol (35,8421504,8,"MapInfo Symbols",0,0) 
Insert Into USCities 
( Capital, State, Pop_1990, Num_HU_90, FIPS_CODE, OBJ) 
Select City, State, Tot_Pop, Tot_hu, "00“ 
, CreatePoint(CentroidX(OBJ), CentroidY(OBJ)) 
From CITY_125
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Solutions 
Set Style Brush(1, 16777215, 16777215) 
Set Style BorderPen(1, 2, 16711680) 
Select * From USCities Where FIPS_Code <> "00" Into 
__TO_UPDATE 
Update __TO_UPDATE Set OBJ = Buffer(obj, 100, pop_1990 / 
20000, "mi") 
Set Style BorderPen(1, 2, 3175935) 
Select * From USCities Where FIPS_Code = "00" Into 
__TO_UPDATE 
Update __TO_UPDATE Set OBJ = Buffer(obj, 100, pop_1990 / 
20000, "mi")
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Solutions 
Alter Table "USCities" 
(add X1 Float,Y1 Float,X2 Float,Y2 Float ) Interactive 
Update USCities 
Set X1 = CentroidX(Offset(OBJ,45,(POP_1990/20000),"mi")) 
Update USCities 
Set Y1 = CentroidY(Offset(OBJ,45,(POP_1990/20000),"mi")) 
Update USCities 
Set X2 = CentroidX(Offset(OBJ,225,(POP_1990/20000),"mi")) 
Update USCities 
Set Y2 = CentroidY(Offset(OBJ,225,(POP_1990/20000),"mi")) 
Update USCities 
Set OBJ = CreateLine(X1, Y1, X2, Y2) 
Update USCities 
Set OBJ = MBR(OBJ)
Get the latest 
MapInfo User Conference news: 
Twitter via #MapInfoUC 
and follow us @MapInfo 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC

More Related Content

What's hot

Improved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and AlertmanagerImproved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and Alertmanager
Julien Pivotto
 
Grafana introduction
Grafana introductionGrafana introduction
Grafana introduction
Rico Chen
 
The msg box function and the messagebox class
The msg box function and the messagebox classThe msg box function and the messagebox class
The msg box function and the messagebox classFaisal Aziz
 
CONTROL STRUCTURE IN VB
CONTROL STRUCTURE IN VBCONTROL STRUCTURE IN VB
CONTROL STRUCTURE IN VB
classall
 
Text field and textarea
Text field and textareaText field and textarea
Text field and textareamyrajendra
 
Django User Management & Social Authentication
Django User Management & Social AuthenticationDjango User Management & Social Authentication
Django User Management & Social Authentication
Spin Lai
 
Grafana
GrafanaGrafana
Grafana
NoelMc Grath
 
JVM Memory Management Details
JVM Memory Management DetailsJVM Memory Management Details
JVM Memory Management Details
Azul Systems Inc.
 
Monitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaMonitoring using Prometheus and Grafana
Monitoring using Prometheus and Grafana
Arvind Kumar G.S
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
Kostas Saidis
 
06 laboratory exercise 1
06 laboratory exercise 106 laboratory exercise 1
06 laboratory exercise 1
Anne Lee
 
Variable scope in php
Variable scope in phpVariable scope in php
Variable scope in php
MUHAMMED MASHAHIL PUKKUNNUMMAL
 
Java Basics
Java BasicsJava Basics
Java Basics
shivamgarg_nitj
 
javascript objects
javascript objectsjavascript objects
javascript objects
Vijay Kalyan
 
Java- Datagram Socket class & Datagram Packet class
Java- Datagram Socket class  & Datagram Packet classJava- Datagram Socket class  & Datagram Packet class
Java- Datagram Socket class & Datagram Packet class
Ruchi Maurya
 
Best Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part IIIBest Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part III
ICS
 
OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++
Aabha Tiwari
 
Vb.net (loop structure)
Vb.net (loop structure)Vb.net (loop structure)
Vb.net (loop structure)
Abhishek Pachisia
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub

What's hot (20)

Improved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and AlertmanagerImproved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and Alertmanager
 
Grafana introduction
Grafana introductionGrafana introduction
Grafana introduction
 
The msg box function and the messagebox class
The msg box function and the messagebox classThe msg box function and the messagebox class
The msg box function and the messagebox class
 
CONTROL STRUCTURE IN VB
CONTROL STRUCTURE IN VBCONTROL STRUCTURE IN VB
CONTROL STRUCTURE IN VB
 
Text field and textarea
Text field and textareaText field and textarea
Text field and textarea
 
Django User Management & Social Authentication
Django User Management & Social AuthenticationDjango User Management & Social Authentication
Django User Management & Social Authentication
 
Grafana
GrafanaGrafana
Grafana
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 
JVM Memory Management Details
JVM Memory Management DetailsJVM Memory Management Details
JVM Memory Management Details
 
Monitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaMonitoring using Prometheus and Grafana
Monitoring using Prometheus and Grafana
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
 
06 laboratory exercise 1
06 laboratory exercise 106 laboratory exercise 1
06 laboratory exercise 1
 
Variable scope in php
Variable scope in phpVariable scope in php
Variable scope in php
 
Java Basics
Java BasicsJava Basics
Java Basics
 
javascript objects
javascript objectsjavascript objects
javascript objects
 
Java- Datagram Socket class & Datagram Packet class
Java- Datagram Socket class  & Datagram Packet classJava- Datagram Socket class  & Datagram Packet class
Java- Datagram Socket class & Datagram Packet class
 
Best Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part IIIBest Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part III
 
OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++
 
Vb.net (loop structure)
Vb.net (loop structure)Vb.net (loop structure)
Vb.net (loop structure)
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 

Similar to Automating Repetitive Tasks with MapBasic

Advanced SQL Selects
Advanced SQL SelectsAdvanced SQL Selects
Advanced SQL Selects
Peter Horsbøll Møller
 
Precisely MapInfo Pro v2019 and Roadmap
Precisely MapInfo Pro v2019 and RoadmapPrecisely MapInfo Pro v2019 and Roadmap
Precisely MapInfo Pro v2019 and Roadmap
Peter Horsbøll Møller
 
Taking Advantage of a Spatial Database with MapInfo Professional
Taking Advantage of a Spatial Database with MapInfo ProfessionalTaking Advantage of a Spatial Database with MapInfo Professional
Taking Advantage of a Spatial Database with MapInfo Professional
Peter Horsbøll Møller
 
Concepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into MapsConcepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into Maps
Mohammad Liton Hossain
 
MapInfo Professional 12.0 and SQL Server 2008
MapInfo Professional 12.0 and SQL Server 2008MapInfo Professional 12.0 and SQL Server 2008
MapInfo Professional 12.0 and SQL Server 2008
Peter Horsbøll Møller
 
Mapping Immigrants
Mapping ImmigrantsMapping Immigrants
Mapping Immigrants
borderzine
 
QGIS Tutorial 1
QGIS Tutorial 1QGIS Tutorial 1
QGIS Tutorial 1
niloyghosh1984
 
Geoprocessing
GeoprocessingGeoprocessing
Geoprocessing
Ehsan Hamzei
 
Plan601 e session 1 demo 20150413
Plan601 e session 1 demo 20150413Plan601 e session 1 demo 20150413
Plan601 e session 1 demo 20150413
rkottam
 
Plan601 e session 1 demo
Plan601 e session 1 demoPlan601 e session 1 demo
Plan601 e session 1 demo
rkottam
 
Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005
rkottam
 
Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005
rkottam
 
How to empower community by using GIS lecture 2
How to empower community by using GIS lecture 2How to empower community by using GIS lecture 2
How to empower community by using GIS lecture 2wang yaohui
 
DLP_Observation-1.docx
DLP_Observation-1.docxDLP_Observation-1.docx
DLP_Observation-1.docx
WyztyDelle2
 
Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005
rkottam
 
Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005
rkottam
 
Ex32018.pdf
Ex32018.pdfEx32018.pdf
Ex32018.pdf
ssuser211b2b
 
Robotic iAssembly
Robotic iAssemblyRobotic iAssembly
Robotic iAssembly
Brian Halicki
 
Get the Sheet out of here! Plan production for jobs due yesterday
Get the Sheet out of here! Plan production for jobs due yesterdayGet the Sheet out of here! Plan production for jobs due yesterday
Get the Sheet out of here! Plan production for jobs due yesterday
Synergis Engineering Design Solutions
 

Similar to Automating Repetitive Tasks with MapBasic (20)

Advanced SQL Selects
Advanced SQL SelectsAdvanced SQL Selects
Advanced SQL Selects
 
Precisely MapInfo Pro v2019 and Roadmap
Precisely MapInfo Pro v2019 and RoadmapPrecisely MapInfo Pro v2019 and Roadmap
Precisely MapInfo Pro v2019 and Roadmap
 
Taking Advantage of a Spatial Database with MapInfo Professional
Taking Advantage of a Spatial Database with MapInfo ProfessionalTaking Advantage of a Spatial Database with MapInfo Professional
Taking Advantage of a Spatial Database with MapInfo Professional
 
Concepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into MapsConcepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into Maps
 
MapInfo Professional 12.0 and SQL Server 2008
MapInfo Professional 12.0 and SQL Server 2008MapInfo Professional 12.0 and SQL Server 2008
MapInfo Professional 12.0 and SQL Server 2008
 
Mapping Immigrants
Mapping ImmigrantsMapping Immigrants
Mapping Immigrants
 
QGIS Tutorial 1
QGIS Tutorial 1QGIS Tutorial 1
QGIS Tutorial 1
 
It ready dw_day4_rev00
It ready dw_day4_rev00It ready dw_day4_rev00
It ready dw_day4_rev00
 
Geoprocessing
GeoprocessingGeoprocessing
Geoprocessing
 
Plan601 e session 1 demo 20150413
Plan601 e session 1 demo 20150413Plan601 e session 1 demo 20150413
Plan601 e session 1 demo 20150413
 
Plan601 e session 1 demo
Plan601 e session 1 demoPlan601 e session 1 demo
Plan601 e session 1 demo
 
Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005
 
Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005
 
How to empower community by using GIS lecture 2
How to empower community by using GIS lecture 2How to empower community by using GIS lecture 2
How to empower community by using GIS lecture 2
 
DLP_Observation-1.docx
DLP_Observation-1.docxDLP_Observation-1.docx
DLP_Observation-1.docx
 
Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005
 
Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005Plan601 e session 1 demo 20151005
Plan601 e session 1 demo 20151005
 
Ex32018.pdf
Ex32018.pdfEx32018.pdf
Ex32018.pdf
 
Robotic iAssembly
Robotic iAssemblyRobotic iAssembly
Robotic iAssembly
 
Get the Sheet out of here! Plan production for jobs due yesterday
Get the Sheet out of here! Plan production for jobs due yesterdayGet the Sheet out of here! Plan production for jobs due yesterday
Get the Sheet out of here! Plan production for jobs due yesterday
 

More from Peter Horsbøll Møller

MapInfo Pro v12.5 to v2021.1 Overview
MapInfo Pro v12.5 to v2021.1 OverviewMapInfo Pro v12.5 to v2021.1 Overview
MapInfo Pro v12.5 to v2021.1 Overview
Peter Horsbøll Møller
 
MapInfo Pro Tips & Tricks med Geograf
MapInfo Pro Tips & Tricks med GeografMapInfo Pro Tips & Tricks med Geograf
MapInfo Pro Tips & Tricks med Geograf
Peter Horsbøll Møller
 
Be Location Intelligent with MapInfo Pro v2019
Be Location Intelligent with MapInfo Pro v2019Be Location Intelligent with MapInfo Pro v2019
Be Location Intelligent with MapInfo Pro v2019
Peter Horsbøll Møller
 
MapInfo Pro v2019: Improving the Way You Query
MapInfo Pro v2019: Improving the Way You QueryMapInfo Pro v2019: Improving the Way You Query
MapInfo Pro v2019: Improving the Way You Query
Peter Horsbøll Møller
 
Eksklusivsmagning - 10 års jubilæum, Oksenvad Whiskylaug
Eksklusivsmagning - 10 års jubilæum, Oksenvad WhiskylaugEksklusivsmagning - 10 års jubilæum, Oksenvad Whiskylaug
Eksklusivsmagning - 10 års jubilæum, Oksenvad Whiskylaug
Peter Horsbøll Møller
 
Llinking Spectrum dataflows to MapInfo Pro
Llinking Spectrum dataflows to MapInfo ProLlinking Spectrum dataflows to MapInfo Pro
Llinking Spectrum dataflows to MapInfo Pro
Peter Horsbøll Møller
 
Clynelish - Oksenvad Whiskylaug
Clynelish - Oksenvad WhiskylaugClynelish - Oksenvad Whiskylaug
Clynelish - Oksenvad Whiskylaug
Peter Horsbøll Møller
 
Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016
Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016
Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016
Peter Horsbøll Møller
 
MapInfo Discover 3D: From 2D to 3D
MapInfo Discover 3D: From 2D to 3DMapInfo Discover 3D: From 2D to 3D
MapInfo Discover 3D: From 2D to 3D
Peter Horsbøll Møller
 
Whiskysmagning: Samaroli
Whiskysmagning: SamaroliWhiskysmagning: Samaroli
Whiskysmagning: Samaroli
Peter Horsbøll Møller
 
Using Spectrum on Demand from MapInfo Pro
Using Spectrum on Demand from MapInfo ProUsing Spectrum on Demand from MapInfo Pro
Using Spectrum on Demand from MapInfo Pro
Peter Horsbøll Møller
 
Hvad sker der hos Pitney Bowes
Hvad sker der hos Pitney BowesHvad sker der hos Pitney Bowes
Hvad sker der hos Pitney Bowes
Peter Horsbøll Møller
 
MapInfo Discover 2015.2 64 bit
MapInfo Discover 2015.2 64 bitMapInfo Discover 2015.2 64 bit
MapInfo Discover 2015.2 64 bit
Peter Horsbøll Møller
 
MapInfo Pro 64 bit og MapInfo Pro Advanced 64 bit
MapInfo Pro 64 bit og MapInfo Pro Advanced 64 bitMapInfo Pro 64 bit og MapInfo Pro Advanced 64 bit
MapInfo Pro 64 bit og MapInfo Pro Advanced 64 bit
Peter Horsbøll Møller
 
MapInfo Pro Raster og de danske højdedata
MapInfo Pro Raster og de danske højdedataMapInfo Pro Raster og de danske højdedata
MapInfo Pro Raster og de danske højdedata
Peter Horsbøll Møller
 
64 bits of MapInfo Pro - Danish version
64 bits of MapInfo Pro - Danish version64 bits of MapInfo Pro - Danish version
64 bits of MapInfo Pro - Danish version
Peter Horsbøll Møller
 
Blend, Single Grain og Single Malt Whisky
Blend, Single Grain og Single Malt WhiskyBlend, Single Grain og Single Malt Whisky
Blend, Single Grain og Single Malt Whisky
Peter Horsbøll Møller
 
MapInfo Pro og SQL Server - Uden opgaver
MapInfo Pro og SQL Server - Uden opgaverMapInfo Pro og SQL Server - Uden opgaver
MapInfo Pro og SQL Server - Uden opgaver
Peter Horsbøll Møller
 
Nyheder i MapInfo Pro 12.5 Dansk 32 bit
Nyheder i MapInfo Pro 12.5 Dansk 32 bitNyheder i MapInfo Pro 12.5 Dansk 32 bit
Nyheder i MapInfo Pro 12.5 Dansk 32 bit
Peter Horsbøll Møller
 
The Macallan - Oksenvad Whiskylaug
The Macallan - Oksenvad WhiskylaugThe Macallan - Oksenvad Whiskylaug
The Macallan - Oksenvad Whiskylaug
Peter Horsbøll Møller
 

More from Peter Horsbøll Møller (20)

MapInfo Pro v12.5 to v2021.1 Overview
MapInfo Pro v12.5 to v2021.1 OverviewMapInfo Pro v12.5 to v2021.1 Overview
MapInfo Pro v12.5 to v2021.1 Overview
 
MapInfo Pro Tips & Tricks med Geograf
MapInfo Pro Tips & Tricks med GeografMapInfo Pro Tips & Tricks med Geograf
MapInfo Pro Tips & Tricks med Geograf
 
Be Location Intelligent with MapInfo Pro v2019
Be Location Intelligent with MapInfo Pro v2019Be Location Intelligent with MapInfo Pro v2019
Be Location Intelligent with MapInfo Pro v2019
 
MapInfo Pro v2019: Improving the Way You Query
MapInfo Pro v2019: Improving the Way You QueryMapInfo Pro v2019: Improving the Way You Query
MapInfo Pro v2019: Improving the Way You Query
 
Eksklusivsmagning - 10 års jubilæum, Oksenvad Whiskylaug
Eksklusivsmagning - 10 års jubilæum, Oksenvad WhiskylaugEksklusivsmagning - 10 års jubilæum, Oksenvad Whiskylaug
Eksklusivsmagning - 10 års jubilæum, Oksenvad Whiskylaug
 
Llinking Spectrum dataflows to MapInfo Pro
Llinking Spectrum dataflows to MapInfo ProLlinking Spectrum dataflows to MapInfo Pro
Llinking Spectrum dataflows to MapInfo Pro
 
Clynelish - Oksenvad Whiskylaug
Clynelish - Oksenvad WhiskylaugClynelish - Oksenvad Whiskylaug
Clynelish - Oksenvad Whiskylaug
 
Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016
Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016
Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016
 
MapInfo Discover 3D: From 2D to 3D
MapInfo Discover 3D: From 2D to 3DMapInfo Discover 3D: From 2D to 3D
MapInfo Discover 3D: From 2D to 3D
 
Whiskysmagning: Samaroli
Whiskysmagning: SamaroliWhiskysmagning: Samaroli
Whiskysmagning: Samaroli
 
Using Spectrum on Demand from MapInfo Pro
Using Spectrum on Demand from MapInfo ProUsing Spectrum on Demand from MapInfo Pro
Using Spectrum on Demand from MapInfo Pro
 
Hvad sker der hos Pitney Bowes
Hvad sker der hos Pitney BowesHvad sker der hos Pitney Bowes
Hvad sker der hos Pitney Bowes
 
MapInfo Discover 2015.2 64 bit
MapInfo Discover 2015.2 64 bitMapInfo Discover 2015.2 64 bit
MapInfo Discover 2015.2 64 bit
 
MapInfo Pro 64 bit og MapInfo Pro Advanced 64 bit
MapInfo Pro 64 bit og MapInfo Pro Advanced 64 bitMapInfo Pro 64 bit og MapInfo Pro Advanced 64 bit
MapInfo Pro 64 bit og MapInfo Pro Advanced 64 bit
 
MapInfo Pro Raster og de danske højdedata
MapInfo Pro Raster og de danske højdedataMapInfo Pro Raster og de danske højdedata
MapInfo Pro Raster og de danske højdedata
 
64 bits of MapInfo Pro - Danish version
64 bits of MapInfo Pro - Danish version64 bits of MapInfo Pro - Danish version
64 bits of MapInfo Pro - Danish version
 
Blend, Single Grain og Single Malt Whisky
Blend, Single Grain og Single Malt WhiskyBlend, Single Grain og Single Malt Whisky
Blend, Single Grain og Single Malt Whisky
 
MapInfo Pro og SQL Server - Uden opgaver
MapInfo Pro og SQL Server - Uden opgaverMapInfo Pro og SQL Server - Uden opgaver
MapInfo Pro og SQL Server - Uden opgaver
 
Nyheder i MapInfo Pro 12.5 Dansk 32 bit
Nyheder i MapInfo Pro 12.5 Dansk 32 bitNyheder i MapInfo Pro 12.5 Dansk 32 bit
Nyheder i MapInfo Pro 12.5 Dansk 32 bit
 
The Macallan - Oksenvad Whiskylaug
The Macallan - Oksenvad WhiskylaugThe Macallan - Oksenvad Whiskylaug
The Macallan - Oksenvad Whiskylaug
 

Recently uploaded

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 

Recently uploaded (20)

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 

Automating Repetitive Tasks with MapBasic

  • 1. Welcome MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 2. Hands on Lab 14D Automating Repetitive Tasks with MapBasic Peter Horsbøll Møller GIS/LI Pre-Sales Specialist June 13, 2014 Every connection is a new opportunity™ MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 3. Automating Repetitive Tasks with MapBasic Time to look under the hood. Open up the MapBasic window to see how you can automate data processing and other tasks using MapInfo Professional. You might find some great time savers in this session. You do not need to be a programmer to benefit from these techniques. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 4. MapBasic Documentation MapBasic Help file: Help System (zip) MapBasic Reference Guide: Reference MapBasic User Guide: User Guide MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 5. MapBasic Help File INTRODUCTION How to read the Help File? MapBasic Fundamentals MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 6. MapBasic Documentation MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 7. The Features of the MapBasic Window The MapBasic window in MapInfo Professional: •Can be opened via Options > Show MapBasic Window •Records, when open, (most) actions performed by the user in MapInfo Professional •Can also ”play back” actions/statements • Put the cursor in the line and hit the Enter-key • Highlight several lines and hit the Enter-key •You can save statements from the window to a text file via the MapBasic menu •You can clear the content in the window via the MapBasic menu MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 8. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Be adviced! Please note that •The MapBasic statements in the MapBasic window can be very specific. They can for example refer to a specific window, a specific table or similar •The scenario might not be completely similar next time you want to run a MapBasic statement. Maybe you don’t have any tables open, maybe there are no open windows, maybe the active window isn’t a map window and so on
  • 9. Using the MapBasic window Open the MapBasic window Perform one or more actions using the interface in MapInfo Professional, that is a menu item, a button or similar Notice that the statements are written to the MapBasic window Now try to execute the statements one at a time via the MapBasic window Remember to clean up before you repeat the actions via the MapBasic window: Close tables or revert changes to tables and so forth. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 10. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Example
  • 11. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Update Column Normally you are limited to updating one column at a time thru the Update Column dialog. The MapBasic statement Update Table, however, lets you update several columns at a time Update table Set column = expr [ , column = expr, ...] [ Where RowID = idnum ] Use the dialog to get the syntax for one column and then modify the statement to update several afterwards
  • 12. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Exercise Dataset •Exercise_DataCriminalActivity.TAB •Update X with CentroidX(OBJ) thru the dialog •Modify the Update Table statement to also update: • Y with CentroidY(OBJ) • CRIMEID with RowID •Consider setting the Coordinate System with: • Set CoordSys Table C
  • 13. Append Rows to table With Append Rows to Table you can insert records from one table into another table Using the dialog you can however not control which column is inserted into which column. When using the dialog the order of the columns is important You can get around this issue using the MapBasic window Insert Into table [ ( columnlist ) ] { Values ( exprlist ) | Select columnlist From table } Using columnlist you can specify columns with names like ID, X, Y, NAME instead of COL1, COL2, COL2, COL4 MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 14. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Exercise Dataset •USCITY_125.TAB •USSTATECAP.TAB •Save a copy of StateCap as USCities •Append City_125 to USCities using Append Rows to Table •Revert changes to USCities •Modify the statement to use column names •Modify the statement to set FIPS_Code to ”00” for the cities inserted
  • 15. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Exercise Modify your script to have the style of the state capitals as red circles using the statement: Set Style Symbol(35,16711680,12,"MapInfo Symbols",0,0) And the style of the cities as grey circles using this statement: Set Style Symbol (35,8421504,8,"MapInfo Symbols",0,0) Use CreatePoint to recreate the points using the new style You can set the style using Symbol Style and use this statement to get the symbol printed to the Message window: Print CurrentSymbol()
  • 16. Creating Spatial Features You can create points using Table > Create Points. And you can create other basic spatial features using the MapBasic window and some MapBasic functions:  CreatePoint(x, y)  CreateLine(x1, y1, x2, y2)  CreateCircle(x, y, radius)  Buffer(OBJ, resolution, distance, units) *  MBR(OBJ)  Offset(OBJ, direction, distance, units) *  OffsetXY(OBJ, offsetx, offsety, units) * * Some of the functions above can be used in a Cartesian as well as a Spherical version MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 17. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Exercise Dataset •USStates.TAB •USUS_HIWAY.TAB •USUSCities.TAB (the table that we created in a previous exercise) •Create buffers around the cities based on the population •Set the size to (POP_1990 / 20000) miles – or pick your own size •Set the style as blue border for cities and red for state capitals
  • 18. From Points to Squares MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 19. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Exercise Dataset •USStates.TAB •USUS_HIWAY.TAB •USUSCities.TAB (the table that we created in a previous exercise) •Add four columns (X1, Y1, X2, Y2) of type Float to the table USCities •Update these with: • CentroidX(Offset(OBJ, 45, (POP_1990 / 20000), ”mi”)) • CentroidY(Offset(OBJ, 45, (POP_1990 / 20000), ”mi”)) • CentroidX(Offset(OBJ, 225, (POP_1990 / 20000), ”mi”)) • CentroidY(Offset(OBJ, 225, (POP_1990 / 20000), ”mi”)) •Create a square around each city using CreateLine and MBR
  • 20. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Solutions Set CoordSys Table CriminalActivity Update CriminalActivity Set X = CentroidX(obj) , Y = CentroidY(obj) , CrimeID = ROWID
  • 21. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Solutions Commit Table STATECAP As “…USUSCities.tab" TYPE NATIVE Charset "WindowsLatin1" Interactive Open Table “…USUSCities.TAB" Interactive Insert Into USCities ( Capital, State, Pop_1990, Num_HU_90) Select City, State, Tot_Pop, Tot_hu From CITY_125 Insert Into USCities ( Capital, State, Pop_1990, Num_HU_90) Select City, State, Tot_Pop, Tot_hu From CITY_125
  • 22. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Solutions Commit Table STATECAP As “…USUSCities.tab" TYPE NATIVE Charset "WindowsLatin1" Interactive Open Table “…USUSCities.TAB" Interactive Set Style Symbol(35,16711680,12,"MapInfo Symbols",0,0) Update USCities Set OBJ = CreatePoint(CentroidX(OBJ), CentroidY(OBJ)) Set Style Symbol (35,8421504,8,"MapInfo Symbols",0,0) Insert Into USCities ( Capital, State, Pop_1990, Num_HU_90, FIPS_CODE, OBJ) Select City, State, Tot_Pop, Tot_hu, "00“ , CreatePoint(CentroidX(OBJ), CentroidY(OBJ)) From CITY_125
  • 23. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Solutions Set Style Brush(1, 16777215, 16777215) Set Style BorderPen(1, 2, 16711680) Select * From USCities Where FIPS_Code <> "00" Into __TO_UPDATE Update __TO_UPDATE Set OBJ = Buffer(obj, 100, pop_1990 / 20000, "mi") Set Style BorderPen(1, 2, 3175935) Select * From USCities Where FIPS_Code = "00" Into __TO_UPDATE Update __TO_UPDATE Set OBJ = Buffer(obj, 100, pop_1990 / 20000, "mi")
  • 24. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Solutions Alter Table "USCities" (add X1 Float,Y1 Float,X2 Float,Y2 Float ) Interactive Update USCities Set X1 = CentroidX(Offset(OBJ,45,(POP_1990/20000),"mi")) Update USCities Set Y1 = CentroidY(Offset(OBJ,45,(POP_1990/20000),"mi")) Update USCities Set X2 = CentroidX(Offset(OBJ,225,(POP_1990/20000),"mi")) Update USCities Set Y2 = CentroidY(Offset(OBJ,225,(POP_1990/20000),"mi")) Update USCities Set OBJ = CreateLine(X1, Y1, X2, Y2) Update USCities Set OBJ = MBR(OBJ)
  • 25. Get the latest MapInfo User Conference news: Twitter via #MapInfoUC and follow us @MapInfo MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC