Presentation is loading. Please wait.

Presentation is loading. Please wait.

Thematic Mapping with Google Maps. "US-KS":{code:"US-KS", name:"Kansas", center:{lat:38.4959185,lng:98.326385},

Similar presentations


Presentation on theme: "Thematic Mapping with Google Maps. "US-KS":{code:"US-KS", name:"Kansas", center:{lat:38.4959185,lng:98.326385},"— Presentation transcript:

1 Thematic Mapping with Google Maps

2

3

4

5

6 "US-KS":{code:"US-KS", name:"Kansas", center:{lat:38.4959185,lng:98.326385}, polylines:[{points:"czy`FpvgcQjDxj`AoAfiVbQfvq@gKjs`@zInkHaMdfcBrAlyk@fAd~jAzSf__AaLvdaAUvsy @mAjkn@fCtud@z@ruxA~TdptAuDx|SHjxwA}LdmPc@nqiBfFbx|@_DhsVxC|c}A|o@x}zAWhnAcrlA~ \\{yp@hNycQ_BkmdB`Lqz@gB_xcAvKq`NCwgbAvG_pPyEidtAvDyc@`C{_sA`L_L}x|BcDysObIqxmBjEw zByGsfiBTw~@wNq_kBlTiyvAtFedUWsebAhG_fi@eGa}m@C}i`A}FiaUtMwxwArFarwApIa{Sx@czbA_A }th@cC}vm@jImaj@tDwawAsi@gbCbeJifLrWqoEzmDetAhLknGtmFmvHxSeiFueA}xDsvBghA_WuaJr\\kf D|bH{IpdB}mA|\\u~ChcAi|@trCpbAxcAbsEzl@pJ|lBgrAwPsvG~g@uc@p{Ath@lmA|lDu@h|Cez@hjCzZ ~t@`eHzgBfoCvuHhaFhlDhrFaN~aDbyI`mDmj@|gHgsI|jCgk@tqCorIbnDelDr{DukE|BqjDf|FrpAxiB{UbfF ceDvvCwhHd|HanAjwAi_Ed_D_sJ}UyvI`fB}tDli@}qE``AmfAtpDdj@zhLdFdpg@zRhoRfCz{r@xa@noNb Apt`AyIv}CuBtmcA|NjwDy@`qw@m@zuy@zJjiKw@kVfpoAiCzsF",levels:"PDFGFFFBGGFCEDGGEFFD EEHDPDGEDEDCFEFDPDGEFBDHCGEFEEGDEFDBFEHLIIIIKIHIGPJHHKIHJIIHLHGHKIIJJJMHIIEIKHJIJ KDIIHGMHAEEIEDFFCEDNCP", numLevels:18, zoomFactor:2}],}, Javascript for State of Kansas

7 Steps to Extending JS 1)Calculate centroids from shapefile in ArcMap 2)Export shapefile to KML 3)Use online tool to encode KML 4)Put all data in SAS 5)Join data and use SAS to write Javascript 6)Add new javascript to Cartographer.js

8 Add centroids to shapefile

9 Layer to KML

10 Unzip KMZ to view KML

11 http://facstaff.unca.edu/mcmcclur/googlemaps/encodepolyline/encodeForm.html Encode KML

12

13 filename encoded 'D:\data\ArcView\shptoKML\encodedKSCounties.txt'; /* read text file containing encoded KML for Kansas Counties */ data test; length points $1865 levels $461 ; infile encoded end=eof lrecl=2000 pad; input @ 'points: "' points $1865. ; input@ 'levels: "' levels $ ; run; SAS Code to read text file

14 proc sql; create table kml.encoded as select a.*, b.*, c.epoints, c.elevels from kml.countyabbv as a, centers as b, test2 as c where a.county=b.name and b.row=c.row; quit; SAS Code to join data

15 data _null_; set kml.encoded; put '"KS-' abbv +(-1) '":{code:"KS-' abbv +(-1) '",name:"' name +(-1) ' County, Kansas",center:{lat:' lat +(-1) ',lng:' lon +(-1) '}, polylines:[{ points: "' epoints +(-1) '", levels: "' elevels +(-1) '", numLevels:18,zoomFactor:2}],},'/; run; SAS code to write Javascript

16

17

18 Ready to create map var cartographer = Cartographer( map, { colorize:"#000", colorizeAlpha:.3 } ); cartographer.choropleth([ {region:"KS-DG",val:1855}, {region:"KS-JO",val:1855}, {region:"KS-SA",val:1860}, {region:"KS-EW",val:1867}, {region:"KS-MR",val:1855}, {region:"KS-OS",val:1855}, {region:"KS-LY",val:1857}, {region:"KS-FR",val:1855},…

19

20 Keys to Map Include both cartographer.js and raphael.js PHP dynamically writes map Javascript based on user input (variable selected, color, metric…) MySQL stores table of abbreviations, fips, etc which are joined with data to produce map

21

22

23 Xan Wedel Institute for Policy & Social Research The University of Kansas 607 Blake Hall Lawrence, KS 66045-3129 xan@ku.edu


Download ppt "Thematic Mapping with Google Maps. "US-KS":{code:"US-KS", name:"Kansas", center:{lat:38.4959185,lng:98.326385},"

Similar presentations


Ads by Google