SlideShare a Scribd company logo
1 of 27
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

AWS Blackbelt 2015シリーズ Amazon EC2 Container Service (Amazon ECS)
AWS Blackbelt 2015シリーズ Amazon EC2 Container Service (Amazon ECS)AWS Blackbelt 2015シリーズ Amazon EC2 Container Service (Amazon ECS)
AWS Blackbelt 2015シリーズ Amazon EC2 Container Service (Amazon ECS)Amazon Web Services Japan
 
AWS Black Belt Techシリーズ Amazon WorkDocs / Amazon WorkMail
AWS Black Belt Techシリーズ Amazon WorkDocs / Amazon WorkMailAWS Black Belt Techシリーズ Amazon WorkDocs / Amazon WorkMail
AWS Black Belt Techシリーズ Amazon WorkDocs / Amazon WorkMailAmazon Web Services Japan
 
AWS Summit Seoul 2023 | AWS의 개발자를 위한 신규 서비스 소개 Amazon CodeCatalyst & Amazon C...
AWS Summit Seoul 2023 | AWS의 개발자를 위한 신규 서비스 소개 Amazon CodeCatalyst & Amazon C...AWS Summit Seoul 2023 | AWS의 개발자를 위한 신규 서비스 소개 Amazon CodeCatalyst & Amazon C...
AWS Summit Seoul 2023 | AWS의 개발자를 위한 신규 서비스 소개 Amazon CodeCatalyst & Amazon C...Amazon Web Services Korea
 
AWSでEC2上にMTAを構築した話
AWSでEC2上にMTAを構築した話AWSでEC2上にMTAを構築した話
AWSでEC2上にMTAを構築した話康宏 緒方
 
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...Masahiko Sawada
 
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 2008Peter Horsbøll Møller
 
20211209 Ops-JAWS Re invent2021re-cap-cloud operations
20211209 Ops-JAWS Re invent2021re-cap-cloud operations20211209 Ops-JAWS Re invent2021re-cap-cloud operations
20211209 Ops-JAWS Re invent2021re-cap-cloud operationsAmazon Web Services Japan
 
Hadoop World 2011: Advanced HBase Schema Design
Hadoop World 2011: Advanced HBase Schema DesignHadoop World 2011: Advanced HBase Schema Design
Hadoop World 2011: Advanced HBase Schema DesignCloudera, Inc.
 
Creating AppStream apps and configuring users with Domain Join.
Creating AppStream apps  and configuring users with Domain Join.Creating AppStream apps  and configuring users with Domain Join.
Creating AppStream apps and configuring users with Domain Join.Subramanyam Vemala
 
AWS Black Belt Online Seminar 2016 Amazon WorkSpaces
AWS Black Belt Online Seminar 2016 Amazon WorkSpacesAWS Black Belt Online Seminar 2016 Amazon WorkSpaces
AWS Black Belt Online Seminar 2016 Amazon WorkSpacesAmazon Web Services Japan
 
AWS Black Belt Techシリーズ AWS Direct Connect
AWS Black Belt Techシリーズ AWS Direct ConnectAWS Black Belt Techシリーズ AWS Direct Connect
AWS Black Belt Techシリーズ AWS Direct ConnectAmazon Web Services Japan
 
Budget Control with mis_builder 3 (2017)
Budget Control with mis_builder 3 (2017)Budget Control with mis_builder 3 (2017)
Budget Control with mis_builder 3 (2017)acsone
 
컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...
컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...
컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...Amazon Web Services Korea
 
AWSome Day Online 2020_Module 3: Building in the cloud
AWSome Day Online 2020_Module 3: Building in the cloudAWSome Day Online 2020_Module 3: Building in the cloud
AWSome Day Online 2020_Module 3: Building in the cloudAmazon Web Services
 
Hive + Tez: A Performance Deep Dive
Hive + Tez: A Performance Deep DiveHive + Tez: A Performance Deep Dive
Hive + Tez: A Performance Deep DiveDataWorks Summit
 

What's hot (20)

AWS Blackbelt 2015シリーズ Amazon EC2 Container Service (Amazon ECS)
AWS Blackbelt 2015シリーズ Amazon EC2 Container Service (Amazon ECS)AWS Blackbelt 2015シリーズ Amazon EC2 Container Service (Amazon ECS)
AWS Blackbelt 2015シリーズ Amazon EC2 Container Service (Amazon ECS)
 
AWS OpsWorksのご紹介
AWS OpsWorksのご紹介AWS OpsWorksのご紹介
AWS OpsWorksのご紹介
 
AWS Black Belt Techシリーズ Amazon WorkDocs / Amazon WorkMail
AWS Black Belt Techシリーズ Amazon WorkDocs / Amazon WorkMailAWS Black Belt Techシリーズ Amazon WorkDocs / Amazon WorkMail
AWS Black Belt Techシリーズ Amazon WorkDocs / Amazon WorkMail
 
Sequences and indexes
Sequences and indexesSequences and indexes
Sequences and indexes
 
AWS Summit Seoul 2023 | AWS의 개발자를 위한 신규 서비스 소개 Amazon CodeCatalyst & Amazon C...
AWS Summit Seoul 2023 | AWS의 개발자를 위한 신규 서비스 소개 Amazon CodeCatalyst & Amazon C...AWS Summit Seoul 2023 | AWS의 개발자를 위한 신규 서비스 소개 Amazon CodeCatalyst & Amazon C...
AWS Summit Seoul 2023 | AWS의 개발자를 위한 신규 서비스 소개 Amazon CodeCatalyst & Amazon C...
 
AWSでEC2上にMTAを構築した話
AWSでEC2上にMTAを構築した話AWSでEC2上にMTAを構築した話
AWSでEC2上にMTAを構築した話
 
All about InfluxDB.
All about InfluxDB.All about InfluxDB.
All about InfluxDB.
 
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
 
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
 
20211209 Ops-JAWS Re invent2021re-cap-cloud operations
20211209 Ops-JAWS Re invent2021re-cap-cloud operations20211209 Ops-JAWS Re invent2021re-cap-cloud operations
20211209 Ops-JAWS Re invent2021re-cap-cloud operations
 
Hadoop World 2011: Advanced HBase Schema Design
Hadoop World 2011: Advanced HBase Schema DesignHadoop World 2011: Advanced HBase Schema Design
Hadoop World 2011: Advanced HBase Schema Design
 
Creating AppStream apps and configuring users with Domain Join.
Creating AppStream apps  and configuring users with Domain Join.Creating AppStream apps  and configuring users with Domain Join.
Creating AppStream apps and configuring users with Domain Join.
 
AWS Black Belt Online Seminar 2016 Amazon WorkSpaces
AWS Black Belt Online Seminar 2016 Amazon WorkSpacesAWS Black Belt Online Seminar 2016 Amazon WorkSpaces
AWS Black Belt Online Seminar 2016 Amazon WorkSpaces
 
AWS Black Belt Techシリーズ AWS Direct Connect
AWS Black Belt Techシリーズ AWS Direct ConnectAWS Black Belt Techシリーズ AWS Direct Connect
AWS Black Belt Techシリーズ AWS Direct Connect
 
Budget Control with mis_builder 3 (2017)
Budget Control with mis_builder 3 (2017)Budget Control with mis_builder 3 (2017)
Budget Control with mis_builder 3 (2017)
 
컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...
컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...
컨테이너와 서버리스 기반 CI/CD 파이프라인 구성하기 - 김필중 솔루션즈 아키텍트, AWS / 강승욱 솔루션즈 아키텍트, AWS :: A...
 
Autonomous Database Explained
Autonomous Database ExplainedAutonomous Database Explained
Autonomous Database Explained
 
Modelo E-R
Modelo E-RModelo E-R
Modelo E-R
 
AWSome Day Online 2020_Module 3: Building in the cloud
AWSome Day Online 2020_Module 3: Building in the cloudAWSome Day Online 2020_Module 3: Building in the cloud
AWSome Day Online 2020_Module 3: Building in the cloud
 
Hive + Tez: A Performance Deep Dive
Hive + Tez: A Performance Deep DiveHive + Tez: A Performance Deep Dive
Hive + Tez: A Performance Deep Dive
 

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 2014Peter Löwe
 
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 ProfessionalPeter 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 opgaverPeter Horsbøll Møller
 
Mapinfo
MapinfoMapinfo
Mapinfodoai
 

Viewers also liked (7)

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 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

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 QueryPeter Horsbøll Møller
 
Electronic Spreadsheets
Electronic SpreadsheetsElectronic Spreadsheets
Electronic SpreadsheetsNeilfieOrit2
 
Oracle Advanced SQL and Analytic Functions
Oracle Advanced SQL and Analytic FunctionsOracle Advanced SQL and Analytic Functions
Oracle Advanced SQL and Analytic FunctionsZohar 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.pptxMdAquibRazi1
 
Advance Microsoft Office Excel Course.pptx
Advance Microsoft Office Excel Course.pptxAdvance Microsoft Office Excel Course.pptx
Advance Microsoft Office Excel Course.pptxssuserc9f959
 
Using Excel Functions
Using Excel FunctionsUsing Excel Functions
Using Excel FunctionsGautam 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 FunctionsSmart 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 FunctionsZohar Elkayam
 
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
 
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 FunctionsZohar Elkayam
 

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

Excel Tips 101
Excel Tips 101Excel Tips 101
Excel Tips 101
 
Excel tips
Excel tipsExcel tips
Excel tips
 
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

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 v2019Peter 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 WhiskylaugPeter 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 ProPeter 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 2016Peter 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 ProPeter 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 bitPeter 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øjdedataPeter 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 WhiskyPeter 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

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

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