2015 wingap conference wingapsql and gis mark lovett & rusty scoven

77
2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Upload: simon-harris

Post on 02-Jan-2016

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

2015 WinGap Conference

WinGapSQL and GIS

Mark Lovett & Rusty Scoven

Page 2: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

2018V3 (DBF) Official Support Ends

Page 3: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Managing GIS data using database connections

ArcMap for Desktop Basic License

SSMS (Sequel Server Management Studio)

Page 4: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

ArcMap Query Layer

Stand alone table created from a connected database

Provides for live updates from the database directly to the map project

Must have a database connection in order to be created

Utilizes SQL syntax in order to create the stand alone table

Works much like a SQL view query

Only exists within the map project it was created in

Are read only

Editable when accessed via certain types of services/licenses

Page 5: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 6: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

From the catalogue tree create a database connection

Double click Add Database Connection

Page 7: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Database Connection window will appear and be blank

Must add the SQL Instance and the Authentication Type

The Instance can be found within SSMS (see next slide)

The Authentication Type for Windows Authentication will be Operating system authentication

Those users that use password protected authentication will select Database Authentication and enter the user name and password

Page 8: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

SQL Instance name as seen from SSMS

Page 9: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Back to the Database Connection window

The Database can either be keyed or as a test to see if you entered the correct Instance and Authentication Type, you can click the drop down arrow and select the database you wish to query from.

The Query Layer will only pull from that database

Page 10: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Once the database connection is established it will display in the Catalogue tree

You can rename it by right clicking on it if you prefer or take the default

It will default to being disconnected (appear with a red x beside it)

To connect it double click the connection you created (red x will disappear and a + will appear to the left

Page 11: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Once connected you will be able to see all of the WinGap dbo tables within the database

These dbo tables cannot and should not be renamed, deleted, copied, cut, changed or manipulated in any shape form or fashion

Any manipulation of these tables could result in WinGap SQL malfunctioning

If you are an individual that is click happy DO NOT click the + symbol

Page 12: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

To create the Query Layer Go to:

File>>>>>Add Data>>>>>Add Query Layer

Page 13: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

The New Query Layer window opens

Page 14: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Select your database connection by clicking the drop down arrow

A list of all the dbo tables within the database will appear

Page 15: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

First give the query layer a name on the Name line

As for the query, a couple of ways to skin this cat

You can build the query by navigating through the list of dbo tables, selecting the table and then selecting the field names from the columns box

OR you can use SSMS to build your query and copy and paste

Page 16: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 17: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 18: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

After you have built your query you can click Validate to ensure it is correct and then click Finish

Page 19: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

After you click finish the new Query Layer table will appear in the Table of Contents window

Page 20: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

To view the table, right click on the table, and select Open

Page 21: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

The attribute table will display showing the columns you selected in the query

Page 22: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

The table will update as changes are made in WinGap SQL

Example is Realkey 2, lets remove the Homestead Code in WinGap SQL

Page 23: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 24: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 25: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Once the change is made in WinGap SQL you must refresh the data so that it can update in ArcMap

Refreshing the data can be done in two ways, closing the table and reopening it OR by selecting Reload Cache from the table while it is open

Page 26: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

After performing either option to refresh the table will update

Page 27: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

The Query Layer can be edited or changed to fit the user’s needs

To edit the Query Layer, right click on the table, select properties

Page 28: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

From the Source tab select Change Query

Page 29: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

The Edit Query Layer will open

You can now add or subtract from the original query

Page 30: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 31: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 32: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

The Query Layer also allows for pulling data from multiple tables using SQL join commands

For these types of queries I prefer SSMS but you can use the query window within ArcMap as well

Page 33: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 34: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 35: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Major benefit in using Query Layer is on the fly updates from WinGAP SQL

Another PLUS is not having to maintain a bunch of fields within shapefile or geodatabase

The Query Layer can be joined to spatial layers and as updates are made in WinGap SQL they will be reflected in the map

Page 36: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Attribute table from parcel data

Page 37: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

To perform the join, right click on the shapefile, select Joins and Relates, the select Join

Page 38: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Join Data window appears

Select the primary key to join the data on, click OK

Page 39: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Message below may appear

Select Perform Join Now Without Index

Page 40: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Join occurs

Open attribute table to review the joined data

Page 41: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

For the update example lets look at Realkey 5723

Acreage discrepancy requires an update

Page 42: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 43: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 44: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Refresh the attribute table using the same method

Page 45: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Table updates

Page 46: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Can be used with symbology and thematic mapping updates

To use symbology, right click on the layer you want to symbolize, then click properties

Page 47: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

The Layer Properties window will appear

Click on the Symbology tab, select categories, then select the field you wish to symbolize on followed by add all values

Page 48: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

The example I am using is the Taxdistrict field from WinGapSQL

The example shows a parcel that appears to be in the wrong Tax District

Page 49: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 50: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 51: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 52: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven
Page 53: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Click the refresh button from the map to see the update.

Page 54: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Using a SQL View with ARCGIS

Page 55: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

SQL Views

Creating SQL Views

Joining SQL views with ARCGIS

Page 56: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Query from SSMS: Lets say you have a complex query, and you would like to use those results with your parcel data

This a query that compares data from two different data years

Page 57: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

CREATING A VIEW IN SIMPLE FORM

CREATE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition

Page 58: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

CREATING A VIEW FROM THE SSMS QUERY

CREATE VIEW view_name ASSELECT column_name(s)

FROM table_name

WHERE condition

Page 59: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Where does my VIEW live?

Page 60: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Adding the VIEW to ARCGIS

Page 61: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Joining the View to the Parcel Layer

Page 62: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Now Lets Display the Queried Parcels

Page 63: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Visual display of our data may indicate incorrect Neighborhood changes

Page 64: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Using joined

data

for analysis

Page 65: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Example: You want to determine if parcels are more valuable within a one

mile radius of a school

Page 66: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

In our example you have joined a Query Layer or a View to your Parcel Layer

Page 67: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Select by Location from PARCELS that are within a distance of 5,280

feet (1 mile) from SCHOOLS

Page 68: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Now you have selected all of the

parcels within a one mile radius of

the schools

Page 69: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Now you have your selection, lets move it to a usable report

Page 70: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Now you have a usable

spreadsheet to use for analysis

Page 71: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

What if you have a spreadsheet of information that you would like to Map and Analyze with your Parcel Data?

Page 72: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Example: You have been given a list of parcels that should have been combined. You want to determine if these combinations have been completed.

Page 73: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

First you will add your Excel data to ARCGIS

Page 74: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Next step: Joining to our Parcel Layer

Page 75: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Now that you have joined the combination list to the parcel data you can select parcels by attributes from the Excel data.

Using SELECT BY ATTRIBUTES You can select any parcel that was supposed to be Deleted as a result of a combination by selecting any parcel that has a Realkey from the Deleted Parcel

Page 76: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

Now you have a visual representation of

the parcels that should have been

deleted per a combination with another

parcel

Page 77: 2015 WinGap Conference WinGapSQL and GIS Mark Lovett & Rusty Scoven

This is just a sampling of

the many things that can

be accomplished by using

these two powerful tools!

WinGAPSQL + ARCGIS = Time Saving Analysis