SlideShare a Scribd company logo
Peter Horsbøll Møller
Senior Systems Engineer
Pitney Bowes Software
The Power of Spatial SQL in MapInfo Professional
Peter Horsbøll Møller
Senior Systems Engineer
June 15, 2012
Every connection is a new opportunity™
Workshop agenda
• In this workshop we will play around with the spatial SQL
capabilties of MapInfo Professional
• We will look at joining tables based on the spatial objects
• We will calculate size of parts of the spatial objects
• We will extract and insert parts into new tables
3
SQL Select
• Columns, expressions
• Tables
• Conditions
4
Joining via the spatial object
• Select the two tables
– Object will come from
first table
• Specify spatial
condition:
– Contains
– Within
– Intersects
– Partly Within
– Contains Part
– Entirely Within
– Contains Entire
5
Contains / Within
• Comparing the
Centroid!
• Order does matter
• Good with points
• A Contains C
• A Contains D
• B Contain A
• C Contains D
• C Within A
• D Within A
• B Within A
• D Within C
6
Intersects / Partly Within / Contains Part
• Comparing the entire
object!
• Order doesn’t matter
• A Contains Part B
• A Contains Part C
• A Contains Part D
• B Contain Part A
• B Contains Part C
• C Contains Part A
• C Contains Part B
• C Contains Part D
• D Contains Part A
• D Contains Part C
7
Contains Entire / Entirely Within
• Comparing the entire
object!
• Order does matter
• A Contains Entire D
• C Contains Entire D
• D Entirely Within A
• D Entirely Within C
8
Spatial operators
• Within/Contains
– Very fast
– Inprecise when working with other objects than points
• Intersects/Partly Within/Contains Part
– Slower then Within/Contains
– Should be used when comparing lines/polylines and regions
• Entirely Within/Contains Entire
– Slower then Within/Contains
– To be used if one object should be ”entirely within” the other
9
Specifying columns
• Pick the columns from
the ”Columns” list
• Create expressions
using the ”Functions”
list or type in some
functions manually
• Use aliases (”some
new name”) for
expressions
10
Exercise
• Join the two tables Cadastre and Urban_Area
• Join them using the Intersects operator
• Select these columns
– CADASTRE.AREA_NAME
– CADASTRE.LOT_NO
– URBAN_AREAS.NAME
• Add these functions and aliases:
– CartesianArea(CADASTRE.OBJ, "sq m") "Area_Cadastre”
– CartesianArea(URBAN_AREAS.OBJ, "sq m") "Area_UrbanArea"
11
Adding a overlap tolerance
• Overlap(obj1, obj2):
– Creates an object where
the two objects have a
common ”area”
• MapInfo Pro will create
this object and calculate
the area of it
• If this area is larger then
10 sq m, the intersection
will be used
12
Calculating area overlap
There are a number of ways to calculate the size of the
overlapping area:
• CartesianArea(Overlap(obj, obj), units)
– Uses the defined units
– Should be used for projected data (non Longitude/Latitude data)
• SpericalArea(Overlap(obj, obj), units)
– Uses the defined units
– Should be used for Longitude/Latitude data
• AreaOverlap(obj, obj)
– Uses the current units in MapInfo Professional
– Uses the SpericalArea calculation
13
Exercise
• Add a overlap tolerance by adding this to the condition:
– CartesianArea(Overlap(Cadastre.obj, Urban_Areas.obj), "sq m") >
10
• Try different tolerances
• How do you change the unit used?
14
Extracting spatial data
• By default MapInfo Professional takes the spatial object
from the first table in your query
• You can however add ”more” spatial objects to your
query thru the ”Column” field
• To see these extra columns you need to insert the result
into a new/another table
15
Adding an extra spatial column
• Add your extra spatial
object, can be an
expression
• Consider using an alias
• Note that the result still
will highlight the entire
area from the first table
16
Creating a new table
• You can consider
using the structure
from your first table
and just modify it to
match the columns in
your query
17
Inserting the query
• You need to do this thru the MapBasic window
• Show the MapBasic Window from the Options menu
• Write this:
Insert Into OverlapResult (AREA_NAME, LOT_NO, NAME, OBJ)
Select AREA_NAME, LOT_NO, NAME, OverlapObj From Query1
• Where
– OverlapResult is your new table
– OverlapObj is your spatial column alias
– Query1 is the name of yoru query
• And hit enter
• Make sure your new table hasn’t been added to the map as
that will slow it down – a lot!
18
Final result
19
Exercise
• Add a spatial column to your result
• Create a new table
• Insert the result into this new table using this:
Insert Into OverlapResult (AREA_NAME, LOT_NO, NAME, OBJ)
Select AREA_NAME, LOT_NO, NAME, OverlapObj From Query3
20
Regions and lines/polylines
• Works just like regions
and regions
• Note that Overlap uses
the style from the first
object
21
Exercise
• Find the roads that intersects the urban areas
• Use these columns from the roads:
– ROADNAME
– ROUTE_NO
– ID
• And this column from the urban areas
– NAME
• Extract only the part of the road within the urban area
• Create a new table
• Insert the result into this new table
Insert Into UrbanRoads (ROADNAME,ROUTE_NO,ID,NAME, OBJ)
Select ROADNAME,ROUTE_NO,ID,NAME, LineOverlap From Query1
22
Adding multiple spatial columns
• The SQL statement can include several spatial columns
23
Select Cadastre.LOT_NO
, Cadastre.AREA_NAME
, Cadastre.obj "CObj"
, Urban_Areas.obj "UObj"
, Overlap(Cadastre.obj
, Urban_Areas.obj) "JOBJ"
From Cadastre, Urban_Areas
Where Cadastre.Obj Intersects
Urban_Areas.Obj
into Selection
Extracting multiple spatial objects
• You need MapBasic to get to these ”many” spatial
columns
• They could be inserted into the cosmetic layer in this
way:
Fetch First From Selection
Dim oTemp As Object
oTemp = selection.UObj
Insert Into WindowInfo(FrontWindow(), 10) (OBJ) Values (oTemp)
24
Exercise
• Select multiple spatial columns
• Insert a few of the selected spatial data into the cosmetic
layer of a map window
25
Some other spatial function
• Overlap()
• Erase()
• Combine()
• IntersectNodes()
• ExtractNodes()
• MBR()
• Centroid()
• CreatePoint()
• CreateLine()
• Buffer() (Cart/Sper)
• Offset() (Cart/Sper)
• OffsetXY() (Cart/Sper)
• Rotate()
• RotateAtPoint()
26
Thank You
Peter Horsbøll Møller
peter.moller@pb.com

More Related Content

What's hot

MySQL and its basic commands
MySQL and its basic commandsMySQL and its basic commands
MySQL and its basic commands
Bwsrang Basumatary
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
farwa waqar
 
SQL
SQLSQL
DML Commands
DML CommandsDML Commands
Chapter 4 Structured Query Language
Chapter 4 Structured Query LanguageChapter 4 Structured Query Language
Chapter 4 Structured Query Language
Eddyzulham Mahluzydde
 
Difference between group by and order by in sql server
Difference between group by and  order by in sql serverDifference between group by and  order by in sql server
Difference between group by and order by in sql server
Umar Ali
 
MySQL: Indexing for Better Performance
MySQL: Indexing for Better PerformanceMySQL: Indexing for Better Performance
MySQL: Indexing for Better Performance
jkeriaki
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Beat Signer
 
Singly link list
Singly link listSingly link list
Singly link list
Rojin Khadka
 
The relational database model chapter 2
The relational database model  chapter 2The relational database model  chapter 2
The relational database model chapter 2Nargis Ehsan
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
Md.Mojibul Hoque
 
[APJ] Common Table Expressions (CTEs) in SQL
[APJ] Common Table Expressions (CTEs) in SQL[APJ] Common Table Expressions (CTEs) in SQL
[APJ] Common Table Expressions (CTEs) in SQL
EDB
 
Sets in Tableau
Sets in TableauSets in Tableau
Sets in Tableau
Kanika Nagpal
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
Shrija Madhu
 
Sql views
Sql viewsSql views
Sql views
arshid045
 

What's hot (20)

MySQL and its basic commands
MySQL and its basic commandsMySQL and its basic commands
MySQL and its basic commands
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
SQL
SQLSQL
SQL
 
DML Commands
DML CommandsDML Commands
DML Commands
 
Chapter 4 Structured Query Language
Chapter 4 Structured Query LanguageChapter 4 Structured Query Language
Chapter 4 Structured Query Language
 
Difference between group by and order by in sql server
Difference between group by and  order by in sql serverDifference between group by and  order by in sql server
Difference between group by and order by in sql server
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
MySQL: Indexing for Better Performance
MySQL: Indexing for Better PerformanceMySQL: Indexing for Better Performance
MySQL: Indexing for Better Performance
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
 
Singly link list
Singly link listSingly link list
Singly link list
 
The relational database model chapter 2
The relational database model  chapter 2The relational database model  chapter 2
The relational database model chapter 2
 
SQL Constraints
SQL ConstraintsSQL Constraints
SQL Constraints
 
SQL
SQLSQL
SQL
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
 
[APJ] Common Table Expressions (CTEs) in SQL
[APJ] Common Table Expressions (CTEs) in SQL[APJ] Common Table Expressions (CTEs) in SQL
[APJ] Common Table Expressions (CTEs) in SQL
 
Sets in Tableau
Sets in TableauSets in Tableau
Sets in Tableau
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
single linked list
single linked listsingle linked list
single linked list
 
Sql views
Sql viewsSql views
Sql views
 

Viewers also liked

3D-printing with GRASS GIS – a work in progress in report FOSS4G 2014
3D-printing with GRASS GIS – a work in progress in report FOSS4G 20143D-printing with GRASS GIS – a work in progress in report FOSS4G 2014
3D-printing with GRASS GIS – a work in progress in report FOSS4G 2014
Peter Löwe
 
Advanced SQL Selects
Advanced SQL SelectsAdvanced SQL Selects
Advanced SQL Selects
Peter Horsbøll Møller
 
MAPINFO PROJECT
MAPINFO PROJECTMAPINFO PROJECT
MAPINFO PROJECTGargi Sen
 
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
 
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
 
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
 
Mapinfo
MapinfoMapinfo
Mapinfodoai
 

Viewers also liked (8)

3D-printing with GRASS GIS – a work in progress in report FOSS4G 2014
3D-printing with GRASS GIS – a work in progress in report FOSS4G 20143D-printing with GRASS GIS – a work in progress in report FOSS4G 2014
3D-printing with GRASS GIS – a work in progress in report FOSS4G 2014
 
Advanced SQL Selects
Advanced SQL SelectsAdvanced SQL Selects
Advanced SQL Selects
 
MAPINFO PROJECT
MAPINFO PROJECTMAPINFO PROJECT
MAPINFO PROJECT
 
Introduction to mapinfo
Introduction to mapinfoIntroduction to mapinfo
Introduction to mapinfo
 
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
 
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
 
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
 
Mapinfo
MapinfoMapinfo
Mapinfo
 

Similar to The power of spatial SQL in MapInfo Professional

Excel tips
Excel tipsExcel tips
Excel tips
laxmiraj01
 
Excel Tips 101
Excel Tips 101Excel Tips 101
Excel Tips 101
Andre Pereira
 
Excel Tips.pptx
Excel Tips.pptxExcel Tips.pptx
Excel Tips.pptx
SumitPaul80
 
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
 
QBIC
QBICQBIC
Electronic Spreadsheets
Electronic SpreadsheetsElectronic Spreadsheets
Electronic Spreadsheets
NeilfieOrit2
 
Excel tips
Excel tipsExcel tips
Excel tips
Preet Sandhu
 
Oracle Advanced SQL and Analytic Functions
Oracle Advanced SQL and Analytic FunctionsOracle Advanced SQL and Analytic Functions
Oracle Advanced SQL and Analytic Functions
Zohar Elkayam
 
it skill excel sheet for ppt.pptx
it skill excel sheet for ppt.pptxit skill excel sheet for ppt.pptx
it skill excel sheet for ppt.pptx
MdAquibRazi1
 
Advance Microsoft Office Excel Course.pptx
Advance Microsoft Office Excel Course.pptxAdvance Microsoft Office Excel Course.pptx
Advance Microsoft Office Excel Course.pptx
ssuserc9f959
 
Using Excel Functions
Using Excel FunctionsUsing Excel Functions
Using Excel Functions
Gautam Gupta
 
Libre Office Calc Lesson 4: Understanding Functions
Libre Office Calc Lesson 4: Understanding FunctionsLibre Office Calc Lesson 4: Understanding Functions
Libre Office Calc Lesson 4: Understanding Functions
Smart Chicago Collaborative
 
OOW2016: Exploring Advanced SQL Techniques Using Analytic Functions
OOW2016: Exploring Advanced SQL Techniques Using Analytic FunctionsOOW2016: Exploring Advanced SQL Techniques Using Analytic Functions
OOW2016: Exploring Advanced SQL Techniques Using Analytic Functions
Zohar Elkayam
 
Excel useful tips
Excel useful tipsExcel useful tips
Excel useful tips
Ramachandram Jangili
 
Excel tips%20simple%20tax%20india%20dot%20org
Excel tips%20simple%20tax%20india%20dot%20orgExcel tips%20simple%20tax%20india%20dot%20org
Excel tips%20simple%20tax%20india%20dot%20orgSeshasalam Murugesan
 
Excel tips
Excel tipsExcel tips
Excel tips
MOHAMMAD ATIF ALI
 
Exploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic FunctionsExploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic Functions
Zohar Elkayam
 

Similar to The power of spatial SQL in MapInfo Professional (20)

Excel tips
Excel tipsExcel tips
Excel tips
 
Excel Tips 101
Excel Tips 101Excel Tips 101
Excel Tips 101
 
Excel Tips.pptx
Excel Tips.pptxExcel Tips.pptx
Excel Tips.pptx
 
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
 
Excel tips
Excel tipsExcel tips
Excel tips
 
QBIC
QBICQBIC
QBIC
 
Electronic Spreadsheets
Electronic SpreadsheetsElectronic Spreadsheets
Electronic Spreadsheets
 
Excel tips
Excel tipsExcel tips
Excel tips
 
Oracle Advanced SQL and Analytic Functions
Oracle Advanced SQL and Analytic FunctionsOracle Advanced SQL and Analytic Functions
Oracle Advanced SQL and Analytic Functions
 
it skill excel sheet for ppt.pptx
it skill excel sheet for ppt.pptxit skill excel sheet for ppt.pptx
it skill excel sheet for ppt.pptx
 
Advance Microsoft Office Excel Course.pptx
Advance Microsoft Office Excel Course.pptxAdvance Microsoft Office Excel Course.pptx
Advance Microsoft Office Excel Course.pptx
 
Using Excel Functions
Using Excel FunctionsUsing Excel Functions
Using Excel Functions
 
Libre Office Calc Lesson 4: Understanding Functions
Libre Office Calc Lesson 4: Understanding FunctionsLibre Office Calc Lesson 4: Understanding Functions
Libre Office Calc Lesson 4: Understanding Functions
 
OOW2016: Exploring Advanced SQL Techniques Using Analytic Functions
OOW2016: Exploring Advanced SQL Techniques Using Analytic FunctionsOOW2016: Exploring Advanced SQL Techniques Using Analytic Functions
OOW2016: Exploring Advanced SQL Techniques Using Analytic Functions
 
Excel useful tips
Excel useful tipsExcel useful tips
Excel useful tips
 
Excel tips%20simple%20tax%20india%20dot%20org
Excel tips%20simple%20tax%20india%20dot%20orgExcel tips%20simple%20tax%20india%20dot%20org
Excel tips%20simple%20tax%20india%20dot%20org
 
35 excel tips
35 excel tips35 excel tips
35 excel tips
 
Excel tips
Excel tipsExcel tips
Excel tips
 
Excel tips
Excel tipsExcel tips
Excel tips
 
Exploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic FunctionsExploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic Functions
 

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
 
Introduction to MapBasic
Introduction to MapBasicIntroduction to MapBasic
Introduction to MapBasic
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
 
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
 
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
 
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
 
Introduction to MapBasic
Introduction to MapBasicIntroduction to MapBasic
Introduction to MapBasic
 
Precisely MapInfo Pro v2019 and Roadmap
Precisely MapInfo Pro v2019 and RoadmapPrecisely MapInfo Pro v2019 and Roadmap
Precisely MapInfo Pro v2019 and Roadmap
 
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
 
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
 
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

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
 
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
 
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
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
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
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
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
 
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
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
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
 
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
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
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
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 

Recently uploaded (20)

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 ...
 
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)
 
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
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
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
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
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 -...
 
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
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
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...
 
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...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
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...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 

The power of spatial SQL in MapInfo Professional

  • 1. Peter Horsbøll Møller Senior Systems Engineer Pitney Bowes Software
  • 2. The Power of Spatial SQL in MapInfo Professional Peter Horsbøll Møller Senior Systems Engineer June 15, 2012 Every connection is a new opportunity™
  • 3. Workshop agenda • In this workshop we will play around with the spatial SQL capabilties of MapInfo Professional • We will look at joining tables based on the spatial objects • We will calculate size of parts of the spatial objects • We will extract and insert parts into new tables 3
  • 4. SQL Select • Columns, expressions • Tables • Conditions 4
  • 5. Joining via the spatial object • Select the two tables – Object will come from first table • Specify spatial condition: – Contains – Within – Intersects – Partly Within – Contains Part – Entirely Within – Contains Entire 5
  • 6. Contains / Within • Comparing the Centroid! • Order does matter • Good with points • A Contains C • A Contains D • B Contain A • C Contains D • C Within A • D Within A • B Within A • D Within C 6
  • 7. Intersects / Partly Within / Contains Part • Comparing the entire object! • Order doesn’t matter • A Contains Part B • A Contains Part C • A Contains Part D • B Contain Part A • B Contains Part C • C Contains Part A • C Contains Part B • C Contains Part D • D Contains Part A • D Contains Part C 7
  • 8. Contains Entire / Entirely Within • Comparing the entire object! • Order does matter • A Contains Entire D • C Contains Entire D • D Entirely Within A • D Entirely Within C 8
  • 9. Spatial operators • Within/Contains – Very fast – Inprecise when working with other objects than points • Intersects/Partly Within/Contains Part – Slower then Within/Contains – Should be used when comparing lines/polylines and regions • Entirely Within/Contains Entire – Slower then Within/Contains – To be used if one object should be ”entirely within” the other 9
  • 10. Specifying columns • Pick the columns from the ”Columns” list • Create expressions using the ”Functions” list or type in some functions manually • Use aliases (”some new name”) for expressions 10
  • 11. Exercise • Join the two tables Cadastre and Urban_Area • Join them using the Intersects operator • Select these columns – CADASTRE.AREA_NAME – CADASTRE.LOT_NO – URBAN_AREAS.NAME • Add these functions and aliases: – CartesianArea(CADASTRE.OBJ, "sq m") "Area_Cadastre” – CartesianArea(URBAN_AREAS.OBJ, "sq m") "Area_UrbanArea" 11
  • 12. Adding a overlap tolerance • Overlap(obj1, obj2): – Creates an object where the two objects have a common ”area” • MapInfo Pro will create this object and calculate the area of it • If this area is larger then 10 sq m, the intersection will be used 12
  • 13. Calculating area overlap There are a number of ways to calculate the size of the overlapping area: • CartesianArea(Overlap(obj, obj), units) – Uses the defined units – Should be used for projected data (non Longitude/Latitude data) • SpericalArea(Overlap(obj, obj), units) – Uses the defined units – Should be used for Longitude/Latitude data • AreaOverlap(obj, obj) – Uses the current units in MapInfo Professional – Uses the SpericalArea calculation 13
  • 14. Exercise • Add a overlap tolerance by adding this to the condition: – CartesianArea(Overlap(Cadastre.obj, Urban_Areas.obj), "sq m") > 10 • Try different tolerances • How do you change the unit used? 14
  • 15. Extracting spatial data • By default MapInfo Professional takes the spatial object from the first table in your query • You can however add ”more” spatial objects to your query thru the ”Column” field • To see these extra columns you need to insert the result into a new/another table 15
  • 16. Adding an extra spatial column • Add your extra spatial object, can be an expression • Consider using an alias • Note that the result still will highlight the entire area from the first table 16
  • 17. Creating a new table • You can consider using the structure from your first table and just modify it to match the columns in your query 17
  • 18. Inserting the query • You need to do this thru the MapBasic window • Show the MapBasic Window from the Options menu • Write this: Insert Into OverlapResult (AREA_NAME, LOT_NO, NAME, OBJ) Select AREA_NAME, LOT_NO, NAME, OverlapObj From Query1 • Where – OverlapResult is your new table – OverlapObj is your spatial column alias – Query1 is the name of yoru query • And hit enter • Make sure your new table hasn’t been added to the map as that will slow it down – a lot! 18
  • 20. Exercise • Add a spatial column to your result • Create a new table • Insert the result into this new table using this: Insert Into OverlapResult (AREA_NAME, LOT_NO, NAME, OBJ) Select AREA_NAME, LOT_NO, NAME, OverlapObj From Query3 20
  • 21. Regions and lines/polylines • Works just like regions and regions • Note that Overlap uses the style from the first object 21
  • 22. Exercise • Find the roads that intersects the urban areas • Use these columns from the roads: – ROADNAME – ROUTE_NO – ID • And this column from the urban areas – NAME • Extract only the part of the road within the urban area • Create a new table • Insert the result into this new table Insert Into UrbanRoads (ROADNAME,ROUTE_NO,ID,NAME, OBJ) Select ROADNAME,ROUTE_NO,ID,NAME, LineOverlap From Query1 22
  • 23. Adding multiple spatial columns • The SQL statement can include several spatial columns 23 Select Cadastre.LOT_NO , Cadastre.AREA_NAME , Cadastre.obj "CObj" , Urban_Areas.obj "UObj" , Overlap(Cadastre.obj , Urban_Areas.obj) "JOBJ" From Cadastre, Urban_Areas Where Cadastre.Obj Intersects Urban_Areas.Obj into Selection
  • 24. Extracting multiple spatial objects • You need MapBasic to get to these ”many” spatial columns • They could be inserted into the cosmetic layer in this way: Fetch First From Selection Dim oTemp As Object oTemp = selection.UObj Insert Into WindowInfo(FrontWindow(), 10) (OBJ) Values (oTemp) 24
  • 25. Exercise • Select multiple spatial columns • Insert a few of the selected spatial data into the cosmetic layer of a map window 25
  • 26. Some other spatial function • Overlap() • Erase() • Combine() • IntersectNodes() • ExtractNodes() • MBR() • Centroid() • CreatePoint() • CreateLine() • Buffer() (Cart/Sper) • Offset() (Cart/Sper) • OffsetXY() (Cart/Sper) • Rotate() • RotateAtPoint() 26
  • 27. Thank You Peter Horsbøll Møller peter.moller@pb.com