Took me a little while to find an example of this, so I thought I would add one to the "interweb" to help other people.
One part of MapInfo that is extremely powerful is the SQL functionality. It isn't comprehensive, but there are a number of things you can do with it. Where I'm currently living/working (The Northern Territory) has a number of communities that could have several different names for the same location. This comes from communities named by European settlers in the area, and Indigenous names. Basically, you can have a spreadsheet of data that you want to tie to a geographic location via the name of an organisation, but the spreadsheet names might not necessarily match the database names that have the latitude and longitude. So I want to find out which values in the spreadsheet are "missing" from the database. In other words, which values did not join.
Two Tables: sdss_geography and tutorial_sample_2
Two Columns: sdss_geography.Organisation_Name and tutorial_sample_2.School
The first step is to perform a Join on the two tables. Using Query --> SQL Select
Select Columns: *
From Tables: sdss_geography, Tutorial_Sample_2
Where: sdss_geography.Organisation_Name = Tutorial_Sample_2.School
Ordered By: School
into Table Named: InitialJoin
Next go to File --> Save Query and save the InitialJoin query as a table. Then close the query table and load the InitialJoin.tab table.
Once the table is loaded, go back to Query --> SQL Select.
Select Columns: *
From Tables: Tutorial_Sample_2
Where: not School in (select School from InitialJoin)
Ordered By: School
into Table Named:MissingJoin
Click OK.
This produces a table of missing values. I take this table and make sure the name and spelling matches the central database.
Hopefully that helps someone else.
Showing posts with label Quick Tip. Show all posts
Showing posts with label Quick Tip. Show all posts
Thursday, November 6, 2008
Tuesday, June 10, 2008
ArcGIS QuickTip #2
This isn't a quicktip. I've posted a short example on how to use ModelBuilder in ArcGIS to build a more robust tool by adding options to manipulate the Environmental Settings.
http://boxshapedworld.googlepages.com/modelbuildertips
http://boxshapedworld.googlepages.com/modelbuildertips
Labels:
ArcGIS,
ArcObjects Tutorial,
ModelBuilder,
Quick Tip
Wednesday, June 4, 2008
Python QuickTip
I'm not much of a Python user. I don't care for the syntax (probably because I don't use it enough). It took me forever to find where I could read the input list from a toolbox in ArcGIS...i.e. a multivalue parameter.
Here is the help file that I found. Look under the Using a multivalue input in a script section.
Another problem I have with Python mostly comes from ArcGIS, which is the only time I ever use Python. Well, most of programming revolves around Spatial Software in some way. Everytime I try and do something with the geoprocessing scripts, I seem to run into a bug. I wrote a script once that exported coverages from all the featureclasses in a workspace. This script stopped to function from the toolbox with service pack 3 (9.2). I think this is working again with service pack 4. Also, apparently the reset method on a lot of the cursors do not work, so forget about reusing a cursor. Seems like every time I need to write a little geoprocessing script I need to try and figure out a workaround because I find another problem. Granted though, I've had some success too.
On a completely different note:
I was also updating my Antivirus and saw that one way to help them was add a link to their site. I use the ClamWin open source antivirus program. I've probably used it for maybe a year, and have been happy with it. It isn't the beast of a software that Norton is. I can only vouch for it on a personal computer, so I don't know how it would work at an "enterprise" level. I haven't had any viruses, but then again, I didn't have any before I installed it either...knock on cyber wood.
Here is the help file that I found. Look under the Using a multivalue input in a script section.
Another problem I have with Python mostly comes from ArcGIS, which is the only time I ever use Python. Well, most of programming revolves around Spatial Software in some way. Everytime I try and do something with the geoprocessing scripts, I seem to run into a bug. I wrote a script once that exported coverages from all the featureclasses in a workspace. This script stopped to function from the toolbox with service pack 3 (9.2). I think this is working again with service pack 4. Also, apparently the reset method on a lot of the cursors do not work, so forget about reusing a cursor. Seems like every time I need to write a little geoprocessing script I need to try and figure out a workaround because I find another problem. Granted though, I've had some success too.
On a completely different note:
I was also updating my Antivirus and saw that one way to help them was add a link to their site. I use the ClamWin open source antivirus program. I've probably used it for maybe a year, and have been happy with it. It isn't the beast of a software that Norton is. I can only vouch for it on a personal computer, so I don't know how it would work at an "enterprise" level. I haven't had any viruses, but then again, I didn't have any before I installed it either...knock on cyber wood.
Labels:
ArcGIS,
Clamwin,
Multivalue,
Python,
Quick Tip
Thursday, May 15, 2008
Quick Tip #1
Here's a quick tip that I learned today. In ArcMap 9.2, instead of using copy and paste. While moving a label at the same time press the ctrl button. Release the mouse button, then the control button and the label is copied to the new location.
Subscribe to:
Posts (Atom)
