Animating Large Geographic Datasets using HADOOP - Northwest ...

3 downloads 152970 Views 4MB Size Report
... to be added so that we can process the points add jar hdfs:///user/esri/esri-geometry-api.jar; add jar hdfs:///user/esri/spatial-sdk-hive-1.1.1-SNAPSHOT.jar;.
www.inl.gov

Animating Large Geographic Datasets using HADOOP Sera White – Advanced Transportation Computing Lead INL/MIS-15-35323

2

3

Geographic Data in SQL Server •  Simplest Use: Data Classification –  what city/zipcode/state is your data in •  For mapping –  Create dynamic database driven maps •  For advanced analysis –  Statistical modeling, 3D modeling, Time Series animation…

4

Example •  US States, US Zipcodes (Data inserted into database using ESRI ArcGIS)

5

6

7

Optimization Algorithm using Geographic Data Types

Takes 13 records and turns it into 3

Combine

Buffer

8

Can use SQL Server Select  concat(year(alastlocaltime),  REPLACE(STR(  month(alastlocaltime),2),  SPACE(1),  '0'))  ym,  geography::Point(  parklocationlatitude,  parklocationlongitude,4326).BufferWithTolerance(10,5,0)  geopoly  INTO  step1  from  tripTable   select              ym,              geography::UnionAggregate(geopoly)  geopoly              INTO  ssTerritoryFinal from  step1 group  by  ym;

--Used to aggregate points in a geo data set -- These jar files are the ESRI Jar files that need to be added so that we can process the points add jar hdfs:///user/esri/esri-geometry-api.jar; add jar hdfs:///user/esri/spatial-sdk-hive-1.1.1-SNAPSHOT.jar; add jar hdfs:///user/esri/spatial-sdk-json-1.1.1-SNAPSHOT.jar;

Speedup? – Run SQL using Hadoop

-- Once the jars are added we need to create the functions associated to the jars create temporary function ST_Aggr_Union as 'com.esri.hadoop.hive.ST_Aggr_Union'; create temporary function ST_Buffer as 'com.esri.hadoop.hive.ST_Buffer'; create temporary function ST_Point as 'com.esri.hadoop.hive.ST_Point'; create temporary function ST_AsText as 'com.esri.hadoop.hive.ST_AsText'; create temporary function ST_SetSRID as 'com.esri.hadoop.hive.ST_SetSRID'; --Step 1 create the datapoint with a buffer and the correct projection using a precision of .001 and Projection of 4326 CREATE TABLE step1territory as select year(alastlocaltime) year, lpad(month(alastlocaltime),2,'0') month,

ST_Buffer(ST_SetSRID( ST_Point( parklocationlongitude, parklocationlatitude),4326),'.001') geopoly from tripTable; -- Step 2 we need to concat the year and month to do time series and to group the points by yearmonth CREATE TABLE step2territory as SELECT concat(year,month) ym, geopoint from step1territory; --Step 3 Aggregate all the points based on the unigue year month combination and convert the geopoly to text for export to SQL Server drop table step3territory; create table step3territory as SELECT ym,

ST_AsText( ST_Aggr_Union(geopoly)) geopoly from step2territory group by ym; exit;

Time Animations

Suggest Documents