Upgrade to Pro — share decks privately, control downloads, hide ads and more …

South Florida GIS Expo 2012: Professional GIS: ...

James Fee
October 11, 2012

South Florida GIS Expo 2012: Professional GIS: Argle bargle, or fooforaw

James Fee

October 11, 2012
Tweet

More Decks by James Fee

Other Decks in Technology

Transcript

  1. James’ Definition of a GIS Professional Someone digitally creates and

    "manipulates" spatial areas that may be jurisdictional, purpose, or application-oriented.
  2. Image attribution: ESRI International User Conference - 2011 - San

    Diego, California by Kris Krüg http://flic.kr/p/a2rdhq CC BY-NC-SA 2.0
  3. GIS

  4. Problems with Wizards • Wizards cause us to conform •

    Options are either preset or confusing • Lack of documenting the process
  5. With the Command Line • Freedom to work with the

    data as you want • Better understanding of the commands • Combined with scripting you have a recipe for future work. AKA documentation!
  6. Programming GIS 1999-2004 • Start up ArcCatalog (wait 2-4 min

    while it loads) • Browse for toolbox (clicking through the endless tree)
  7. Programming GIS 1999-2004 • Start up ArcCatalog (wait 2-4 min

    while it loads) • Browse for toolbox (clicking through the endless tree) • Open tool dialog
  8. Programming GIS 1999-2004 • Start up ArcCatalog (wait 2-4 min

    while it loads) • Browse for toolbox (clicking through the endless tree) • Open tool dialog • Browse for input dataset
  9. Programming GIS 1999-2004 • Start up ArcCatalog (wait 2-4 min

    while it loads) • Browse for toolbox (clicking through the endless tree) • Open tool dialog • Browse for input dataset • Browse for any optional data for analysis
  10. Programming GIS 1999-2004 • Start up ArcCatalog (wait 2-4 min

    while it loads) • Browse for toolbox (clicking through the endless tree) • Open tool dialog • Browse for input dataset • Browse for any optional data for analysis • Browse for an output location
  11. Programming GIS 1999-2004 • Start up ArcCatalog (wait 2-4 min

    while it loads) • Browse for toolbox (clicking through the endless tree) • Open tool dialog • Browse for input dataset • Browse for any optional data for analysis • Browse for an output location • Fill out options
  12. Programming GIS 1999-2004 • Start up ArcCatalog (wait 2-4 min

    while it loads) • Browse for toolbox (clicking through the endless tree) • Open tool dialog • Browse for input dataset • Browse for any optional data for analysis • Browse for an output location • Fill out options • Click OK and pray it doesn’t crash
  13. Programming GIS the ArcINFO Way • Start up Command Prompt

    (about a second) • Type simple command (BUILD, CLIP, etc)
  14. Programming GIS the ArcINFO Way • Start up Command Prompt

    (about a second) • Type simple command (BUILD, CLIP, etc) • Hit Enter
  15. Programming GIS the ArcINFO Way • Start up Command Prompt

    (about a second) • Type simple command (BUILD, CLIP, etc) • Hit Enter • Tell everyone how hard it was
  16. Where is Python Used? • GIS Applications (ArcGIS, QGIS, Safe

    FME, Autodesk) • Web Frameworks (WeoGeo.com, Google) • Anywhere (Corel, Civilization, Gmail) • Become the de-facto scripting language
  17. ArcPy, the New Command Line • Much like the Arc

    prompt and AML, ArcPy and Python give us a powerful analysis and scripting method. • ArcPy builds on the commands we learned 15 years ago. • ArcPy is integrated in ArcMap • Python can be extended to other GIS platforms such as QGIS.
  18. Python Scripting With ArcPy import  arcpy   from  arcpy  import

     env   env.workspace  =  "c:/workspace"   #  variables
 in_features  =  "soils.shp"   clip_features  =  "study_boundary.shp"   out_feature_class  =  "c:/workspace/output/study_area_soils.shp"   xy_tolerance  =  ""   #  Execute  Clip   arcpy.Clip_analysis(in_features,  clip_features,
 out_feature_class,  xy_tolerance)
  19. Python Scripting With ArcPy import  arcpy   from  arcpy  import

     env   env.workspace  =  "c:/workspace"   #  variables
 in_features  =  "soils.shp"   clip_features  =  "study_boundary.shp"   out_feature_class  =  "c:/workspace/output/study_area_soils.shp"   xy_tolerance  =  ""   #  Execute  Clip   arcpy.Clip_analysis(in_features,  clip_features,
 out_feature_class,  xy_tolerance)
  20. Export to KML import  arcpy   arcpy.CheckOutExtension(“3D”)   env.workspace  =

     "c:/workspace"   #  variables
 in_feature  =  "c:/data/TIGER2009/04/ARIZONA/tl_2009_04_county.lyr"   out_feature  =  "c:/temp/output.kmz"   #  Execute  KML  Export   arcpy.LayerToKML_conversion(in_feature,  out_feature,1)
  21. If you like GIS, you like statistics If you like

    statistics, you like baseball
  22. If you like GIS, you like statistics If you like

    statistics, you like baseball If you like baseball, you should root for the 2010 World Series Champion San Francisco Giants
  23. NYY 95 67 .586 +136 BAL 93 69 .574 +7

    TAM 90 72 .556 +120 TOR 73 89 .451 -68 BOS 69 93 .426 -72 DET 88 74 .543 +56 CHS 85 77 .525 +72 KAN 72 90 .444 -70 CLE 68 94 .420 -178 MIN 66 96 .407 -131 OAK 94 68 .580 +99 TEX 93 69 .574 +101 LAA 89 73 .549 +68 SEA 75 87 .463 -32 WAS 98 64 .605 +137 ATL 94 68 .580 +100 PHI 81 81 .500 +4 NYM 74 88 .457 -59 MIA 69 93 .426 -115 CIN 97 65 .599 +81 STL 88 74 .543 +117 MIL 83 79 .512 +43 PIT 79 83 .488 -23 CHC 61 101 .377 -146 HOU 55 107 .340 -211 SFG 94 68 .580 +69 LAD 86 76 .531 +40 ARI 81 81 .500 +46 SDP 76 86 .469 -59 COL 64 98 .395 -132
  24. #!/usr/bin/python   from  scipy  import  stats   from  pylab  import

     *   #  Read  in  the  data.   mlb  =  loadtxt('mlb.txt',  dtype=[('team',  'S3'),  ('w',  'i'),  ('l',  'i'),   ('pct',  'f'),    ('rdiff',  'i')])   #  Plot  the  data  with  invisible  points.   scatter(mlb['rdiff'],  mlb['w'],  s=0)   xlabel('Run  differential')   ylabel('Wins')   #  Put  team  names  at  the  data  points.   for  (t,  w,  rd)  in  zip(mlb['team'],  mlb['w'],  mlb['rdiff']):     text(rd,  w,  t,  size=9,          horizontalalignment='center',  verticalalignment='center')       #  Perform  the  linear  regression   m,  b,  r,  p,  stderr  =  stats.linregress(mlb['rdiff'],  mlb['w'])   #  Get  endpoints  of  regression  line  and  plot  it.   rdMin  =  min(mlb['rdiff'])   wMin  =  m*rdMin  +  b   rdMax  =  max(mlb['rdiff'])   wMax  =  m*rdMax  +  b   plot([rdMin,  rdMax],  [wMin,  wMax])   show()
  25. #!/usr/bin/python   from  scipy  import  stats   from  pylab  import

     *   #  Read  in  the  data.   mlb  =  loadtxt('mlb.txt',  dtype=[('team',  'S3'),  ('w',  'i'),  ('l',  'i'),   ('pct',  'f'),    ('rdiff',  'i')])   #  Plot  the  data  with  invisible  points.   scatter(mlb['rdiff'],  mlb['w'],  s=0)   xlabel('Run  differential')   ylabel('Wins')   #  Put  team  names  at  the  data  points.   for  (t,  w,  rd)  in  zip(mlb['team'],  mlb['w'],  mlb['rdiff']):     text(rd,  w,  t,  size=9,          horizontalalignment='center',  verticalalignment='center')       #  Perform  the  linear  regression   m,  b,  r,  p,  stderr  =  stats.linregress(mlb['rdiff'],  mlb['w'])   #  Get  endpoints  of  regression  line  and  plot  it.   rdMin  =  min(mlb['rdiff'])   wMin  =  m*rdMin  +  b   rdMax  =  max(mlb['rdiff'])   wMax  =  m*rdMax  +  b   plot([rdMin,  rdMax],  [wMin,  wMax])   show()
  26. OpenGeoDa • Spatial Data Manipulation • Visualization and Queries •

    Mapping • Exploratory Data Analysis • Spatial Statistics https://geodacenter.asu.edu/
  27. If You... • Put points on a map and throw

    up a scale bar • Perform geoprocessing without Python or Model Builder • Have a job description of “Plotter Operator” • Have no idea what “fuzzy tolerance” is
  28. If You... • Embrace Python as your GIS tool of

    choice. • Use Model Builder to automate your work flows. • Learn new tools such as TileMill/Mapnik/ PostGIS
  29. GIS

  30. WeoGeo OSM • Early availability tomorrow (10/12) • Clip/Ship to

    FGDB, GML, KML, DWG, CSV and FFS • Available Western USA, then rest of the world • Updated monthly • Free!