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

Advanced GIS Editing in the Web Browser with th...

Advanced GIS Editing in the Web Browser with the Texas Water Service Boundary Viewer

Taylor Christian
Aubrey Drescher

More Decks by Texas Natural Resources Information System

Transcript

  1. 1 Advanced GIS Editing in the Web Browser with the

    Texas Water Service Boundary Viewer Texas GIS Forum Oct 24, 2018 Taylor Christian Aubrey Drescher
  2. The following presentation is based upon professional research and analysis

    within the scope of the Texas Water Development Board’s statutory responsibilities and priorities but, unless specifically noted, does not necessarily reflect official Board positions or decisions. 2
  3. Background • Original service area map was produced in 2009

    through a TWDB research grant. • Received a grant from USGS Water Use Data and Research Program –Provides grants for the state’s benefit, but also to align with plans for USGS priorities –Develop Water Use GIS Database and Reporting Tools 3
  4. Better Boundaries, Better Population Estimates • 2017 State Water Plan

    – Water User Groups aligned with political boundaries, such as city limits 4 • 2022 State Water Plan – Water User Groups aligned with water utility service area
  5. Why is the Water Service Boundary Viewer Needed? • Utility

    boundaries can change annually • Geographically display data related to water systems to the public • Better population estimates and projections for the State Water Plan (Political boundary vs utility boundary) 5
  6. Project Scope & Functions • Editors Site –Current authorized users

    of the Water Use Survey –Submit, edit, or verify water system boundary annually 6 • Public Site –View, create a map, or download a shapefile –Link to other water data reports • Admin Site – Review & maintain boundaries – Provide customer service
  7. Timeline • December 2016 – Contract between USGS and TWDB

    • February 2017 – Develop project scope for future reporting functionality • May /Jun 2018 – Internal testing / beta testing • January 2019 – Application open to public with editor functionality 7
  8. Potential Future Enhancement • Create a public view dashboard -

    Provide a built-in data reporting to access water use, planning data, TWDB loans & projects, socio-economic & demographic information. 8 WUG information ENTITY_NAME 2010 pop 2011 pop 2012 pop 2013 pop 2014 pop 2015 pop 2016 pop GONZALES COUNTY WSC 7,140 7,131 7,200 6,150 6,345 6,350 6,350 Water Use Survey Population
  9. Tech Stack • SQL Server Spatial • ArcGIS Server •

    ESRI JavaScript API • Dojo Enhanced Grid • C#.NET MVC • Entity Framework • Visual Studio Team Foundation Server 10
  10. Attribute Inspector InfoWindow 14 var statusCodeList = new Memory({ data:

    [ { id: 0, label: "Unverified" }, { id: 1, label: "Saved" }, { id: 2, label: "Pending" }, { id: 3, label: "Auto Approved" }, { id: 4, label: "Approved" }, { id: 5, label: "Not Approved" }] }); var statusOS = new ObjectStore({ objectStore: statusCodeList }); var statusSelect = new Select({ id: "statusSelect", name: "statusSelect", store: statusOS, value: 1, sortByLabel: false, style: { width: "220px" } }, "statusSelect");
  11. Client demo phase: advanced functions • Query for Overlaps •

    Send Email • Multi Part Polygons • Undo / Redo • Download Shapefile • Upload Shapefile 15
  12. Send Email or Generate .eml 17 MailMessage message = new

    System.Net.Mail.MailMessage(); client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory; client.PickupDirectoryLocation = tempFolder; client.Send(message); string newFile = Path.Combine(tempFolder, "email.eml"); return File(newFile, "message/rfc822", "email.eml");
  13. Split & Union Multipart Polygons arrayUtils.forEach(graphic.geometry.rings, function (ring) { //Split

    the multipolygon into its parts var polygonPartJson = { "rings": [ring], "spatialReference": evt.graphic.geometry.spatialReference }; var polygonPart = new Polygon(polygonPartJson); //Determine which part the user selected to delete if (GeometryEngine.contains(polygonPart, evt.mapPoint)) { removedPolygon = new Graphic(polygonPart, selectedSymbol, attributes); } else if (polygonPart.isClockwise(ring)) { //isClockwise checks for polygon holes remainingGeometries.push(polygonPart); } else { doughnutGeometries.push(polygonPart); }}); 18
  14. Custom Undo / Redo Actions 19 gs.difference([drawGraphicsLayer.graphics[0].geometry], evt.geometry, function (clippedGeometry)

    { var clippedGraphic = new Graphic(clippedGeometry[0], selectedSymbol, drawGraphicsLayer.graphics[0].attributes); var operation = new app.Clip({ unclippedGraphic: drawGraphicsLayer.graphics[0], clippedGraphic: clippedGraphic }); undoManager.add(operation); customOp.Clip = declare("app.Clip", OperationBase, { constructor: function (params) { ... }, performUndo: function () { ... }, performRedo: function () { ... } });
  15. Download shape w/ Python script 20 PWSIds = arcpy.GetParameterAsText(0) selectStatement

    = "select * from TWDBSpatial.PWS.vw_ServiceAreasGrid" PWSRecords = arcpy.MakeQueryLayer_management( input_database = os.path.join(ProjectPath), out_layer_name = "PWSRecords", query = selectStatement + " where PWSId in (" + PWSIds + ")") arcpy.FeatureClassToFeatureClass_conversion( in_features = PWSRecords, out_path = arcpy.env.scratchFolder, out_name = "PWS_Export.shp") zip = zipfile.ZipFile(os.path.join(arcpy.env.scratchFolder, "PWS_Export.zip"), "w" , zlib.DEFLATED) zip.write(TempPath + "\\" + "PWS_Export.shp", "PWS_Export.shp") zip.write(...) zip.close() arcpy.SetParameterAsText(1, os.path.join(arcpy.env.scratchFolder, "PWS_Export.zip"))
  16. Improved errors on Upload shape 21 var shapetype = featureCollection.layers[0].

    layerDefinition.geometryType; if (shapetype != "esriGeometryPolygon") { errorHandler(error); }
  17. Testing phase: fine tuning • Minimum Viable Product (MVP) •

    User Friendly Improvements • Performance Improvements 22
  18. User Friendly Improvements • Add splash page • Snap to

    adjacent polygons • Add CCN Boundaries • Reduce polygon vertices 23
  19. Your Turn! GIS Analyst / Application Administrator (Planner III) position

    http://www.twdb.texas.gov/jobs/ Any Questions? 27