query layers are your friends. show me the ways inside arcmap bad addresses –simply looking at a...

6
Query Layers are Your Friends

Upload: nickolas-scott

Post on 17-Jan-2018

214 views

Category:

Documents


0 download

DESCRIPTION

Real Integration Table with a geometric component –Either a geometry/geography column –Or simply X/Y values Create a view to handle attributes –A replacement for SDE views, but better Add the view to ArcMap –Voila, you have a feature class Use it just like you would a “regular” feature class

TRANSCRIPT

Page 1: Query Layers are Your Friends. Show me the ways Inside ArcMap Bad Addresses –Simply looking at a table Sensor_PT –Combining disparate datasources easily

Query Layers are Your Friends

Page 2: Query Layers are Your Friends. Show me the ways Inside ArcMap Bad Addresses –Simply looking at a table Sensor_PT –Combining disparate datasources easily

Show me the waysInside ArcMap

• Bad Addresses– Simply looking at a

table• Sensor_PT

– Combining disparate datasources easily

• Unit Time– Making functionality

• Editing– With a little work

Services Anyone?• Polling Places

– Using them in place of conventional feature classes

• BaseMapIMS– Using them to fix

inherent problems• Auto Updates

– AVL like applications

Page 3: Query Layers are Your Friends. Show me the ways Inside ArcMap Bad Addresses –Simply looking at a table Sensor_PT –Combining disparate datasources easily

Real Integration• Table with a geometric component

– Either a geometry/geography column– Or simply X/Y values

• Create a view to handle attributes– A replacement for SDE views, but better

• Add the view to ArcMap– Voila, you have a feature class

• Use it just like you would a “regular” feature class

Page 4: Query Layers are Your Friends. Show me the ways Inside ArcMap Bad Addresses –Simply looking at a table Sensor_PT –Combining disparate datasources easily

Bad Addresses

Select APID, Num, PreDir, StrName, StrType, SecUnit, SecUnitDes, City, geometry::Point(X,Y,3419) as Shape from addrep.dbo.vwAddptFailQC_WithDescriptionsAndAddptData WHERE AddptQCID = 121

Page 5: Query Layers are Your Friends. Show me the ways Inside ArcMap Bad Addresses –Simply looking at a table Sensor_PT –Combining disparate datasources easily

Sensor_PTselect cast(row_number() over(order by a.SiteID) as int) as seq,GEOMETRY::Point(a.XCoord,a.YCoord,3419) as Shape, a.*,b.SensorGroup,b.LastValidDataTime,b.LastValidDataValue from jocoPub.DL.Sensor_PT a left outer join OP_STORMWATCH2.StormWatch3.dbo.SensorDef b on a.SiteID = b.SiteID where a.XCoord is not null and a.YCoord is not null and b.InService = 1 and b.LastValidDataTime > GETDATE() - 1 and SensorGroup in ( 'Barometric Pressure', 'Flow Volume', 'Peak Wind', 'Rain', 'Relative Humidity', 'Temperature', 'Water Level', 'Wind Direction')

Page 6: Query Layers are Your Friends. Show me the ways Inside ArcMap Bad Addresses –Simply looking at a table Sensor_PT –Combining disparate datasources easily

Unit Timeselect * from (SELECT *, CAST(LEFT(DATETIME, 4) + '-' + SUBSTRING(DATETIME, 5, 2) + '-' + SUBSTRING(DATETIME, 7, 2) + ' ' + SUBSTRING(DATETIME, 9, 2) + ':' + SUBSTRING(DATETIME, 11, 2) + ':' + SUBSTRING(DATETIME, 13, 2) as DATETIME) as dt

from dl.SHERIFFUNITS) a CROSS APPLY(SELECT MIN(DT) as dtt FROM (SELECT *, CAST(LEFT(DATETIME, 4) + '-' +

SUBSTRING(DATETIME, 5, 2) + '-' + SUBSTRING(DATETIME, 7, 2) + ' ' + SUBSTRING(DATETIME, 9, 2) + ':' + SUBSTRING(DATETIME, 11, 2) + ':' + SUBSTRING(DATETIME, 13, 2) as DATETIME) as dt

from dl.SHERIFFUNITS) c WHERE c.UNIT = a.UNIT AND c.dt > a.dt) b

Unit Time