Skip navigation
All People > bokeefe > Blinking Maps!

Blinking Maps!

11 posts

So my background is a mix of web-programming, CAD, and everything Adobe...

 

269c8930755955.56313a8d9cd32.gif

I've been able to shift into ESRI because I was introduced to it whilst in the USMC (on and off) due to my training being Artillery. I was the guy who read the maps, wind, calculated powder and distance, and called in 'Fire for Effect.'

 

My years of software development on a myriad of platforms gave me a keen eye for interfaces. I tend to intuit new software, regardless of training, quickly. So jumping from Bentley's CAD into ESRI ArcMap was a fairly simple process. I think I got stumped more by the Shapefile interactivity than anything when I got back into ESRI products.

 

But the one thing I've worked hard at is honing my graphics skills. I love to draw and create and Adobe has been my goto. I've got a personal Creative Cloud license and one at work.

 

I love Adobe.

11d79627984875.5636dd38872e4.pngbdbd1427984875.5636dd388bac5.pnga02a8f27984875.5620270e81f43.png

Now ESRI just started dating Adobe. I'm kind of in love.

 

I have an Adobe / Behance account where I've posted some things both Mapping related AND strictly art related here:

Behance

 

BUT... all of this to say... I am so excited to see this merger. It means I might have a chance of expanding my career options from a 'Web Configurer of Web Maps'-strictly... To a graphics design / web-maps direction. And this makes me happy.

 

SO happy that I decided to start a bandwagon for anyone sharing this kind of path or even just those interested in Adobe.

 

Creative Cloud Mapping : Come... Join!

 

I've got 15+ years working with ALL Adobe Products. I've been dying to find the time to delve into the Web App Builder and Dojo and start doing work like Robert Scheitlin, GISP does with his amazing widgets, but work doesn't afford me that level of time to dig in and learn. So I have to settle with configuration and tweaking. But now...

 

With Adobe on board? I've got a chance to start putting together some amazing maps... and the beta has future enhancements that look like they will just improve and increase the possibilities for those of us in this field with more art than coordinates in our head.

05e12c31488957.56532a2821003.png

Either way... I'm thrilled.

 

Join the group... ask questions... whatever works for you! Welcome to the artists corner of Geonet.

 

Peace, Love and Graphics that are pretty AND smart (finally)...

bokeefe

Help Me Help You

Posted by bokeefe Apr 22, 2016

So I've been working on converting out the old Flex maps in favor of the new JSAPI / WAB flavored versions of all of our web maps. During this process, in what I think was a side-note for them because they don't understand, I was told to include "help files" for the map. So that end users can better navigate the web maps.

 

Well, since we're talking about a seriously complicated set of tools and because there isn't a 'template' for help files I can't just dump rubbish onto a screen and feel good about it. So... I started developing the help system and I think I finally have something that is worth something.

 

I talked management into getting me the Adobe Creative Cloud because of my experience with it and I've been using Photoshop, Illustrator and InDesign regularly for various projects and presentations we give from our group and a few I've given at local SCAUG gatherings. So I use Illustrator to layout, vectorize and piece meal things, photoshop to clean up raster images, InDesign to package them for pamphlets, and Dreamweaver to lay them out on web pages.

 

First I started on my tablet. Looking at some layouts, trying some things out with Adobe Comp.

 

Like this...

 

New_Composition.png

 

So I have some place to start. I tried working this idea in Illustrator on some Artboards. Meh? It didn't suck. It came together alright, but I noticed that I was creating Artboards (think sketch notebooks for the non-adobe literate) for each of the Widgets. Well, I jumped into Dreamweaver and started laying out an HTML page. I figured I would use the About widget and include a link to a separate page using _blank to put it in another tab and voila.

 

Back and forth, trying out templates in Dreamweaver, and I'm ready to pull my hair out. I'm a Wordpress guy, I can knock out a phenom site in Wordpress in minutes. Building web pages from scratch is what I did when I was a kid and had hours of my life to throw away. I don't have that now. I also don't have Wordpress. City servers won't run it (firewalls, no apache, etc). So I plod in and started thrashing around like a drunk in a pool. It wasn't fun.

 

Then, searching out a template for dreamweaver that I could just modify I remember Adobe Muse.

 

And voila. I trashed EVERYTHING from Dreamweaver and began hitting Muse full force.

 

I'm now envisioning creating a network of help sites. One SITE to rule them all, but each widget gets a network of pages that provide help for that widget. I'm going to create a generic featureset on our server (points, lines, polygons) and generate a REST service, create an ArcGIS webmap, and then build a WAB for each Widget. Once I have a WAB built I can grab screen shots from each Widget in action, maybe grab some video too, then with each Widget fully covered, I just have to create a HEADER PAGE for each web map I make in the future.

 

If Map X has Widgets A, C, and E in it, then I build the HEADER PAGE in Muse and a navigation menu that points to Widgets A, C, and E. This way I can move the help files to their own place, and have them be Map-Independent. If I end up with Map-Dependent help files that are needed, I can add them to this network. The HEADER PAGE will be the only page that has navigation TO the customized Widget Help Files, so I can keep everything unified and clean, and SIMPLE...

 

If you would like to see what I have so far... here is our sandbox.

 

Home

 

So yay. Progress, a System, and more. And it has the potential to look sleek and sexy as well.

 

As of this writing I haven't made it responsive yet, but for those who have worked with Muse you know making it responsive is what you do once you are done. Because it's so fricking easy.

 

Well, that's all I have for now...

 

Peace, Love and Clay Software

So on Friday, March 11th, at the ESRI Dev Summit there was a session that grabbed my attention. I've started reading up on it and plan on implementing it within both my own programming (outside of ESRI) and for Mapping-based web applications. The session was titled, "Custom Elements : An End to the Framework Wars" given by Patrick Arlt and he covered A LOT... Being a recent returnee to truly delving into Javascript and other Web-based programming I am confronted with an almost completely new world. HTML5 is here, Be responsive, Flash is Dead, Shadow DOM, and more is quite a learning curve to find myself stepping back into.

 

Luckily, variables still hold data and objects... html is still built with elements / tags... and CSS still has selectors.

 

So in the session Patrick discussed a few websites, https://customelements.io/ is one. It's a repository of these 'Web Components' or 'Custom Elements' and it's loaded. Now there have been some decent adjustments to ECMAScript (the foundation of Javascript) so if this information finds you scratching your head, go grab a few video tutorials or books and catch up. It shouldn't take long. But, the power that is presented here is staggering.

 

I decided to take a few minutes and hit the web to see what I could find on this new magic and I hit some valuable pages and wanted to log / share them.

 

 

Alot of the sessions mention ARIA, which I wasn't familiar with. It's Accessible Rich Internet Applications, or making your web-creations accessible to those with disabilities. There are some good articles on this topic as well and regardless of whether you are required (or not) to format your development for ARIA, you really should.

 

So for those of you asking, "What ARE web components?" Let's take a second and see if I can explain things AS I UNDERSTAND THEM... Keep in mind, I have yet to create one. But I'm actively making plans.

 

So you develop your ESRI Maps in JSAPI or Web AppBuilder with some custom code? Does this code include a DIV Soup (where you have divs nested in divs nested in divs, etc., ad nauseum)? Is that simple to peruse and look over? How many times do you have to pull apart those Divs just to get a better idea of what is going on? What if you could use a smarter HTML element?

 

If you've made a single web page in your life, regardless of GIS experience, then you've developed (or coded) a form. You've created the form tab, with an action attribute, and various inputs / selects / etc. inside of it. You've probably had to custom style certain components within the form as well. Then you've had CSS get absolutely silly moving buttons and labels all over. What if you had one form that you had to use ALL over your site but it required minor adjustments?

 

Technically, you could create a Custom Element version and shorten the amount of code you have to copy-n-paste all over.

 

So let's say you have a form that looks like

 

<form action="form_submit.php">
  LabelTextA: <input type="text" name="custom-label-A"><br>
  LabelTextB: <input type="text" name="custom-label-B">
  <textarea name="custom-name" rows="3" cols="20">Default entry goes here for visitor.</textarea>
  <br>
  <input type="submit">
</form>

 

Now, this is probably a bad example but I'm going to use it anyway...

 

Technically, with Custom Elements you could condense this entire chunk of HTML into something like THIS...

 

<my-reusable-form submit="form-submit.php" defaultText="Default entry goes here for visitor." />

 

The trick is all of the extra HTML would be placed into a Template that you could reuse ANYWHERE. Can you think of any tags that would make your work easier? Maybe even entire Widgets? What about sharing within your organization? Non-Map based web pages. Custom organization-only elements?

 

The sky is the limit... and this concept is huge and kind of overwhelming right now. I'm going to be looking at a process for laying out these kinds of concepts so we can see how possible this would be. But I'm hoping to make my coding easier, less time consuming, more reusable, better accessibility, etc.

 

Let's see if we can all do this...

 

<good-bye>Peace, Love and Harmony</good-bye>

bokeefe

ESRI and D3.js

Posted by bokeefe May 14, 2015

In the Beginning...

When ESRI first made the move over to Javascript I was elated. I had been busily re-educating myself on Flex Development (and remembering why I hated it so much, and all compiled languages) so the switch was exciting for me. At this point tho, I was only seeing ESRI example maps that were one-tool wonders. Creating that City Map for multiple departments or public consumption was not within easy grasp. I realized I needed a framework. Enter WAB. Yippee! Yahoo!

 

But I still wasn't happy. I can code Javascript. I've developed several application in Javascript (years ago) and can quite quickly take-apart or edit javascript with little, to no, headaches. But Javascript has changed dramatically since the advent of DHMTL > HTML5. We have DOM manipulations, jQuery, and a HOST of other libraries written to 'simplify' everything. And now I have a fairly confusing new library to learn if I want to manipulate my web-maps, create custom widgets, etc.

 

DOJO

When I say confusing, I mean REALLY confusing. There are no easy to grasp, example-laden, tutorials. The documentation on this library reads like most manuals for the various programming languages I've picked up over the years. It's convoluted, uses esoteric definitions, and they are written like a developer wrote them (chuckle).

 

Enter D3.js

If you haven't checked out D3.js yet then do yourself a favor. Set aside 20-30 minutes and go here: Gallery · mbostock/d3 Wiki · GitHub

 

This is the Example Gallery of THIS SITE: D3.js - Data-Driven Documents

 

Just go around. Check out the examples and then... then check out the code used to create them. It's impressive. I've started several tutorials on this library and am stunned at the power. Now, technically, I should have had this library under my belt by now but... I'm kinda busy. You see, beside working full-time as a GIS Analyst for the City, I do school part-time (trying to get that degree), work a second job developing websites for clients nights and weekends, and I have a ton of hobbies that I want to dabble in. Picking ONE THING to focus on is literally impossible. So, I am still at the dabble-level with D3.

 

I'm hoping to create a decent repository of D3 / GIS-related sites and examples tho. Why? Because maybe if I get a decent enough example set I can convince my boss to put me through some paid training on this library.

 

The Repository

Below this line I hope to update as needed (and available) with D3 / ESRI examples showing what can be done using this amazing library. If you have suggestions, please do not hesitate to comment, message, notify, call, etc. And here goes...


 

esri_d3 : An extension to the Esri JSAPI for rendering geojson features with D3

CSS Highlight > Feature

This shows how to use a very simple CSS based style to highlight a state:

http://chelm.github.com/esri-d3/index.html

 

CSS-Based Categorization

This shows how we can data-* attributes on our elements as a way to assign categories to data. The classication rules are defined in the CSS instead of directly on the elements themselves:

http://chelm.github.com/esri-d3/rules.html

 

CSS-Cross Data Selection / Interaction

This example adds some interaction to each state. The point is to show an alternative CSS based approach to cross data selection and interaction.

http://chelm.github.io/esri-d3/rules.html

 

geoenrichment-demo

This is a simple web-app that uses esri's geoenrichment API to calculate age characteristics and Esri tapestry data for user defined areas. A user can generate a drive time or standard geography around a point or draw a circle, rectangle, or custom polygon to define an area. If you have an arcgis.comaccount you can demo the mapping app here (you can also create a Trial Account). It should look something like this:

 

http://geoenrichment-demo.herokuapp.com/

 

ESRI Videos

Accessing & Visualizing GeoServices - ArcGIS Javascript API, D3, and Node.js

In this session, we'll discuss new ways to interact with various ArcGIS GeoServices APIs in the context of advanced JavaScript libraries such as D3.js and Node.js. The session will present ways to use third-party data and APIs within the ArcGIS platform and will illustrate how such data can be combined with other Esri services to make compelling - See more at: http://video.esri.com/watch/3368/accessing-_and_-visualizing-geoservices-_dash_-arcgis-javascript-api_comma_-d3_comma_-and-nodejs#sthash.yzJOZccG.dpuf

Accessing & Visualizing GeoServices - ArcGIS JavaScript API, D3, and Node.js | Esri Video

 


Related Information

The following are details on related pieces to this ESRI > D3 pie.

 

Koop

Turn data into Feature Services.

Koop is a node.js module that exposes an Express server for the purpose of being used as middleware within an Express based application.

Koop provides a flexible server for exposing 3rd party data sources (APIs) as both Feature Services and other data formats (GeoJSON). This project is meant to provide a simple / pluggable platform for experimenting with various data within the ArcGIS platform. Koop aims to provide a platform for accessing any API and making it easy to consume within the realm of Esri's geospatial web products.

Visit the demo at http://koop.dc.esri.com.

Situation / Background

When I was hired for my current position (GIS Analyst, City of Tulsa) my boss passed on the Tulsa Fire Department work that he had been handling since before he became a manager. He had worked for the Fire Department for years and constructed a manual system for providing the Fire Engines with a 'Map and Apartment' book. Being that we are all City Employees he hadn't had a chance to improve the system in awhile. When I came on board I thought I would give it a shot and just never... had... time...

 

Process

The process for maintaining an updated Map Book was as follows...

  1. New Apartment is built (hooray!)
  2. Create a Site Drawing in Visio
    1. This PREVIOUSLY involved driving out to the site and visually inspecting and drawing on site (by hand)
    2. (I came into this position with contacts to previous departments so it changed to...)
      I request the Record Drawings of the site and use those to construct a Site Drawing
  3. Convert the Drawing to PDF
  4. Save 1 copy to Apartments folder using naming convention "ApartmentName - Address.pdf"
  5. Save 1 copy to Apts by number folder using naming convention "#AptsNum.pdf"
  6. Edit HTML file to insert new entry for new Apartment, insert link to PDF's
  7. Compile a new Combination PDF of all Apartments

 

Glitches in the LGM (tl;dr)

I've needed a smoother system for awhile now. I've been studying the lgm so I can figure out a process for managing not only the Apartment Book but also the 'Fire Map Book' which has our City broken down into a grid system. The lgm is NOT intuitive and is barely documented. It doesn't provide an easy understanding of itself that is unifying in any manner... but I need to learn it as I think it will VASTLY simplify the process we have here at work for a majority of our tasks. But even if the lgm had a "Local Government for Dummies" book I would still not have had time to devote to it like I need. The nature of City Government work I guess. EVERYTHING is an emergency to the person asking for the help. I literally have 50+ projects waiting for me to pick up and complete at any given moment... but I digress.

 

ParksFinderPlus

I don't remember what triggered it but I suddenly wondered if I could query the ESRI REST Services from our ArcGIS Server for NON-mapping coding?

 

It seemed like it SHOULD be possible, but I haven't seen it done on ANYLEVEL ANYWHERE. SO it would be brand new for me.

 

Tutorials to the rescue

I discovered the following tutorial Getting Started · Consuming a RESTful Web Service with jQuery and figured it would make a good starting point.

 

It starts out with the following two files.

 

hello.js

$(document).ready(function() {
  $.ajax({
  url: "http://rest-service.guides.spring.io/greeting"
  }).then(function(data) {
  $('.greeting-id').append(data.id);
  $('.greeting-content').append(data.content);
  });
});

index.html

<html>
  <head>
  <title>Hello jQuery</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  <script src="hello.js"></script>
  </head>


  <body>
  <div>
  <p class="greeting-id">The ID is </p>
  <p class="greeting-content">The content is </p>
  </div>
  </body>
</html>

 

I swapped out the URL with my REST URL... I couldn't get it to work. I tried modifying the JSON objects... data.NAME, data.FACILITYID... I spent a good couple hours on this to no avail. But then I started reading up on what REST is doing. I needed to build a "query" but I don't have time to learn jQuery to THAT level. Let's see what StackExchange says... and it said plenty. I tried out a handful of ideas but what brought me step-by-step closer was using console.log and dumping out the variables at different phases in the code. I kept getting back what looked like the RAW HTML from when you visit the REST Service page.

 

Which got me to thinking. You can query FROM those REST service pages. What happens when you do that?

 

I know that if you want to search a feature class from a REST Service and what you are REALLY trying to do is output ALL of the contents of the database... you use "1=1" in place of a wildcard. Again, if there is more going on that what I'm saying... please understand, I'm a hack. I've coded on several large projects throughout my life. But I've never been to a programming class that I didn't get bored in because the instructor only covered those things I knew already. I read ALOT... and I tinker. SO... from what I understand... you have to use "1=1" to get a wildcard output. You also need to tell the query what OUTPUTFIELDS you need... so here goes...

 

http://maps.cityoftulsa.org/gis/rest/services/LGDM/Parks/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=NAME%2C+FACILITYID%2C+FULLADDR&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&returnTrueCurves=false&resultOffset=&resultRecordCount=&f=html

 

If you click this link you will see at the bottom of the screen an output of ALL Parks and their coordinates as well as the NAME, FACILITYID, and the FULLADDR. But I was confused... I needed JSON and when I used this URL in my code I was getting problems. But I felt like I was on the right track. I don't remember what triggered it, I know it was something from Geonet, probably a Robert Scheitlin post (or two). But I remembered someone saying that in order to change the output of your URL-based query of a REST Service you needed to change the output parameter... that little "f=html" at the end of my URL above.

 

So I changed it...

http://maps.cityoftulsa.org/gis/rest/services/LGDM/Parks/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=NAME%2C+FACILITYID%2C+FULLADDR&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&gdbVersion=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=&f=json

 

There we go... Now I had JSON to play with.

 

The Final Countdown

I was ready. I started tinkering with the console.log and in chrome I use the developer tools. I forget the name of them. But the standard ones. So I was digging through and changing code in the console window, watching the variables fill up and dump out. I started tinkering with a jQuery $.each command to iterate through ALL of those JSON objects and find the parts that I needed. Until... I did.

 

index.html

<!DOCTYPE html>
<html>
    <head>
        <title>City of Tulsa Master Park List</title>
        <script src="../../js/jquery-1.11.2.min.js"></script>
        <script src="parksrest.js"></script>
    </head>


    <body>
        <div>
  <p>Welcome to the City of Tulsa Parks List.</p>
        </div>
    </body>
</html>

 

parksrest.js

$(document).ready(function() 
{
    $.ajax ( {
  type: 'GET',
  url: 'http://maps.cityoftulsa.org/gis/rest/services/LGDM/Parks/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=NAME%2CFULLADDR%2CFACILITYID&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&gdbVersion=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=&f=json',
  data: { get_param: 'value' },
  dataType: 'json',
  success: function (data) { $.each( data.features, function(index, element) {
  $('body').append($('<div><a href="http://maps.cityoftulsa.org/parksfinder/?selectedFeatureID=' + element.attributes.FACILITYID + '">' + element.attributes.NAME + '</a></div>') );  } ); } } );
});

And there you have it.

City of Tulsa Master Park List

 

Click on one of the Parks to see what it can do.

 

I haven't styled it... I haven't CSS'd it... I don't plan to. This is my sample... My snippet... So if you check it out, what I'm doing is kinda cool. ESRI has added the ability to craft a URL that jumps you to a selected feature. I don't know WHERE in the code it does this. But I need to find out. How many other URL modifiers are there? Can I jump to selected features on other maps? How do I do that in a feature rich web map? How does it know one feature from another? I maybe created some answers to my basic questions with this process but I created 10 times that number of questions.

 

Future Dev

So now my goal is to get the Apartments into the lgm. No more procrastinating. Convert all of my PDF's into lgm features, Everything from building footprints to paving and more. Generate the necessary Data-Drive Map Books for Apartments from there. Maybe build a ModelBuilder model to automate the process after I add (or modify) an Apartment in the system. And give the Fire Department access to a page created from this code that lists out ALL Apartments with links to the PDF's included. I'm also considering creating a picklist / dropdown for various features in some kind of Widget. Being able to generate a list of javascript objects from a rest service is beyond helpful. I'm wondering if I can't develop some PDF's that connect to our SiteAddressPoint from REST and force users to fill out permits using addresses that are ONLY in our system. Hmmmmm...

EDIT/UPDATE:

So apparently I've been TOO close to this whole project from the start. I completely forgot about the function Replace().

 

Public Function Replace(

  ByVal Expression As String,

  ByVal Find As String,

  ByVal Replacement As String,

  Optional ByVal Start As Integer = 1,

  Optional ByVal Count As Integer = -1,

  Optional ByVal Compare As CompareMethod = CompareMethod.Binary

) As String

 

I could have just used the following: NewEntry = Replace( [Address], "1/2", "" )

 

So now for my next trick, I will create a 3Gb script for capitalizing your name.


 

I am working with addresses. If you've done this yet, then you probably feel my pain. Everyone and their brother has an opinion on an address. Regardless of whether that address has been OFFICIALLY ASSIGNED by the ADDRESS COORDINATOR for that municipality or not.

 

I know this because I was, previous to my current GIS Analyst position, the "Address Coordinator for the City of Tulsa, Oklahoma."

 

And it didn't matter WHAT I said, someone else ALWAYS thought they knew the better answer. The funny thing was that sometimes there were MULTIPLE correct answers.

 

For instance, if we are dealing with an address of 1234-1/2 South Main Street East there are a variety of ways you can USE this address.

 

If there had previously been a building located at 1234 and one at 1234-1/2 but the main one had been demolished, then the post office might not care if you used 1234 or 1234-1/2. If the utility company you are on the phone ONLY had an entry for the 1234 and somehow 1234-1/2 had been set up on the 1234 old account, then they might NEVER care that officially 1234-1/2 is correct. Addresses can be... I hate to admit it... somewhat subjective.

 

Skip to today. I'm trying to clean up 200k+ addresses for a mass import into our Local Government Model in our Enterprise GIS system. I have hit a situation where 5k-10k address have the "1/2" sub-designator on them. We no longer USE this sub-designator. We have changed over to using a sub-designator of "REAR" much like "APT" is used. So "1234-1/2 S MAIN ST E" would now read "1234 S MAIN ST E, REAR" instead.

 

Now, some of these addresses might technically have not undergone the transformation that was supposed to happen roughly 4 years ago when I was still the "Address Coordinator" and they may legitimately be using an incorrect "1/2" but for all intents and purposes, I'm leaving that problem to the CURRENT "Address Coordinator" and trying to get the "1/2" out of ALL of our addresses.

 

What this has led to is a problem. I was able to use the toolbox tool ArcToolbox > Geocoding Tools > Standardize Addresses and break the various components out as needed. But these pesky "1/2" are still littering up my addresses. So I shifted over to the Field Calculator. I started hitting problems, but eventually settled on a solution that has worked wonders for me, and might be usable in other situations.

 

I had roughly 10 addresses where the "1/2" designator was at the END of the address. I manually removed those. But I'm still dealing with 5k-10k addresses containing "1/2" where there should be only silence. So... after some to-do, I figured out a solution. I wanted to share my code.

 

If you just need to see the code, here it is...

DIM StripStart, StripEnd
DIM DataToStrip, DataToStripRight, DataToStripLeft, DataToStripLen
DIM WhatToStrip, WhatToStripLen
DIM NewDataSet

WhatToStrip = "1/2"
WhatToStripLen = Len( WhatToStrip )

DataToStrip = [Address]
DataToStripLen = Len( DataToStrip )

StripStart = InStr( 1, DataToStrip, WhatToStrip )
If StripStart = 0 Then
     NewDataSet = DataToStrip
     Else
     StripEnd = StripStart + WhatToStripLen
     DataToStripLeft = Left( DataToStrip, ( StripStart - 1 ) )
     DataToStripRight = Right( DataToStrip, ( DataToStripLen - StripEnd ) )
     NewDataSet = DataToStripLeft + DataToStripRight
End If

There you go.

 

However, I recognize that not everyone understands Visual Basic, much less Visual Basic in relation to ArcGIS. So here is a COMMENTED OUT version of the same code for those who like to learn as they use.

DIM StripStart, StripEnd
DIM DataToStrip, DataToStripRight, DataToStripLeft, DataToStripLen
DIM WhatToStrip, WhatToStripLen
DIM NewDataSet

' Field Calculator VB Script Snippet
' Purpose: To strip targeted text from a text field
' Sample "DataToStrip" example = [1003 1/2 N EVANSTON AVE]
' Sample "WhatToStrip" example = [1/2]

' First we assign the STRING that we want to strip from our target
WhatToStrip = "1/2"

' We need to get the LENgth of this string, which in this case = 3
WhatToStripLen = Len( WhatToStrip )

' Our next step is to assign the targeted STRING data that we
' want to strip our "WhatToStrip" from. In this instance we
' are targeting the [Address] field.
DataToStrip = [Address]

' We need to get the LENgth of the "DataToStrip", which in
' this example = 23
DataToStripLen = Len( DataToStrip )

' Now we need to find the point at which to BEGIN our targeted
' removal. We do this by finding where in the "DataToStrip"
' using the VB Command InStr( ) to find where "WhatToStrip" is
' located. InStr() command returns the "number of characters from
' the beginning of the string where our targeted "WhatToStrip"
' can be found.

' Breakdown / Explanation:
' InStr( 1, DataToStrip, WhatToStrip )
' For our example above we are passing the command InStr three
' separate variables.
' 1) We are passing it the #1
' 2) We are passing it OUR variable called "DataToStrip" which
'    is the address [1003 1/2 N EVANSTON AVE]
' 3) We are passing it OUR variable called "WhatToStrip" which
'    is the STRING containing "1/2"
' What this does is tell InStr to find at what point the
' STRING we have assigned to "WhatToStrip" can be found inside
' of the STRING we have assigned "DataToStrip" if we start
' counting at the "1" character of "DataToStrip".
' So in our example, we are then counting from the number "1"
' in [1003 1/2 N EVANSTON AVE] to the first time that "1/2"
' appears which is the 6th character.
' So to sum it all up... if we starting counting at the first
' character in [1003 1/2 N EVANSTON AVE] until we hit the first
' occurence of the STRING "1/2" then we have counted to "6"
' So, we are then assigning the number 6 to our variable called
' "StripStart" so we can use it in our code.
StripStart = InStr( 1, DataToStrip, WhatToStrip )

' Now, since we may need to use this code sometimes in instances
' where we don't KNOW if our "WhatToStrip" actually EXISTS inside
' of the "DataToStrip" we need to do a check. We do this with
' an IF / THEN statement.
' The following IF / THEN statement says...

' If StripStart = 0
' Or, in english... if our previous command InStr didn't find
' the "WhatToStrip" inside of our "DataToStrip" then "StripStart"
' would now equal ZERO or 0
If StripStart = 0 Then

           ' IF "StripStart" equals ZERO / 0 then we are done. We
     ' don't need to do anything else with this data. Our code
     ' is finished...
     NewDataSet = DataToStrip
     Else

           ' Else
     ' Or, in english... If "StripStart" DOESN'T equal ZERO / 0
     ' Then we can move ahead.

     ' So we have deduced that our "DataToStrip" does IN FACT
     ' contain the "WhatToStrip" so we need to get some more
     ' information in order to complete our block of code.

     ' We need to take "StripStart" (which is now 6 in our example)
     ' and find the point inside of "DataToStrip" that the STRING
     ' we assigned to "WhatToStrip" ends. So we simply take
     ' "StripStart" and add the LENgth of our "WhatToStrip" to get
     ' our "StripEnd". This means that we would take 6 and add it
     ' to 3 and get 9. Or in english, we now know that our
     ' "WhatToStrip" exists inside of our "DataToStrip" and it
     ' starts at character "StripStart" (or 6) and it ends at
     ' character "StripEnd" (or 9).
     StripEnd = StripStart + WhatToStripLen

     ' It's time to take apart our "DataToStrip" and break it into
     ' two separate pieces.

           ' One step is to take ALL of the STRING to the LEFT of
     ' our "WhatToStrip"... We do this with the Left( ) command.

     ' This command takes two variables.
     ' Left ( DataToStrip, ( StripStart - 1 ) )
     ' 1) "DataToStrip" tells the Left() command that we are stripping
     '    the LEFT side of whatever is assigned to this variable.
     ' 2) ( StripStart - 1 ) tells the Left() command to take
     '    "StripStart" and subtract 1 to get the number of
     '    characters to strip from the LEFT side.
     ' Or in english, we need to take "DataToStrip" which has been
     ' assigned the STRING [1003 1/2 N EVANSTON AVE] and CUT OUT
     ' the first 5 characters ("StripStart" - 1 = 5) and assign
     ' them to our variable "DataToStripLeft".

     ' So once this line is executed, in our example, "DataToStripLeft"
     ' will now contain [1003 ]. Notice the space after the 1003.
     ' Spaces are considered a character. It's also important to note
     ' that the space is the 5th character if you count from the
     ' number 1, in 1003, and count TO THE RIGHT... or from the Left().
     DataToStripLeft = Left( DataToStrip, ( StripStart - 1 ) )

     ' Our next step is to take ALL of the STRING to the RIGHT of
     ' our "WhatToStrip"... we do this with the Right( ) command.

     ' This command is just like Left( ) and takes two variables.
     ' Right ( DataToStrip, ( DataToStripLen - StripEnd ) )
     ' 1) "DataToStrip" tells the Right() command that we are stripping
     '    the RIGHT side of whatever is assigned to this variable.
     ' 2) ( DataToStripLen - StripEnd ) tells the Right() command to
     '    take "DataToStripLen" and subtract the value assigned
     '    to "StripEnd" to get the number of characters to strip from
     '    the RIGHT side.
     ' Or in english, we need to take "DataToStrip" which has been
     ' assigned the STRING [1003 1/2 N EVANSTON AVE] and CUT OUT
     ' the last 14 characters ("DataToStripLen" - "StripEnd" or 23 - 9 = 14)
     ' and assign them to our variable "DataToStripRight".

     ' So once this line is executed, in our example, "DataToStripRight"
     ' will now contain [N EVANSTON AVE]. It's important to note that
     ' the letter "N" in this instance is the 14th character if you count
     ' from the "E" in "AVE" and count TO THE LEFT... or from the Right().
     DataToStripRight = Right( DataToStrip, ( DataToStripLen - StripEnd ) )

     ' So now we have "DataToStripLeft" assigned the STRING [1003 ] and
     ' we have "DataToStripRight" assigned the STRING [N EVANSTON AVE].
     ' With a simple concantenation we can create our final STRING minus
     ' the "WhatToStrip" in one fell swoop.

     ' We take the variable "NewDataSet" and assigned it two strings
     ' connected together.
     ' "DataToStripLeft" = [1003 ]
     ' "DataToStripRight" = [N EVANSTON AVE]
     ' If we piece them together, we get [1003 N EVANSTON AVE] and our
     ' pesky "1/2" is completely gone.
     NewDataSet = DataToStripLeft + DataToStripRight
End If

So enjoy, comment, correct or improve as you see fit. The biggest problem for this piece of code is if the 1/2 shows up at the end of the address. In MY situation, this only happened for roughly 10-20 so I manually corrected these. This code could be adjusted to cover those scenarios tho.

 

Well, that's all I have for this situation. I hope this helps someone.

 

Peace, Love and Basically VIsual

bokeefe

The Blinks take on the LGM

Posted by bokeefe Feb 13, 2015

So I'm tasked with GIS work as a GIS Analyst. My schooling wasn't in GIS, in fact it's still ongoing, but I have experience with the software and the data. Going on about 7 years of experience. One of the things that I have seen cause the biggest problems in GIS and Mapping in general is data structure.

 

I worked for SEVERAL years in a Graphics environment. The team was built on a foundation of draftsmen and engineers. As technology advanced they began digitizing their work. But rather than build DIGITAL system and learn new work flows, they forced the digital environment to cater to their paper workflows.

 

Being a City Government workplace there was no incentive to adapt and learn and become true GIS. Instead what I saw was a gradual adoption of GIS ideas and concepts adopted into a paper workflow for a digital system. <insert banging head on desk>

 

Well, that's my past. My present is within a true GIS environment. A current boss that grasps the GIS world with both hands, in fact he's been a GISP and even won an award or two. But it's been a few years since he last was able to delve, up to his elbows, into the GIS world. Meanwhile, he hired a GIS person with a plethora of experience. Almost two decades of experience utilizing true GIS, incorporating it into various workplaces and he and I have begun the process of bringing our City up to speed with GIS. ArcGIS Servers that are clustered, an entire 10.2.2 system (all desktops and servers), web maps (ParksFinder, and more), and the Local Government Data Model.

 

Now 3, or 4, years ago I was the Address Coordinator. My job was to manage, maintain, and create addresses for the City of Tulsa. During this time I was introduced to the LGM for Addressing. That initial introduction has sparked something. I am fascinated with what the LGM has to offer. A complete, robust, adaptable data structure for Government GIS. In my past, whenever I've discovered something like this it has been game-related. Based on game systems I've played, or found interesting, I would find a rule system that fascinated me and I would dive in and study it like it was a college course. Learning all of the nuances, trying to find applicable programming ideas to develop software tools as aids for fun.

 

Well, now I've got the LGM. Other than chess, I don't really play all that many games anymore but the LGM still feels like a set of rules that allow me an advantage. And so I've begun studying. Learning. Digging in and trying to understand the intricacies so that I can best integrate the data that we manage here at the City of Tulsa for the best setup for maintaining and presenting that data.

 

I'm also a Google Drive fan (BIG fan) and so I've begun my initial study workspace in my Google Drive. I thought that other GeoNet members might be interested in having access (or to assist) so I'm sharing my work. If you would like to be able to add to this, edit, or whatever just let me know. My Google e-mail is [ randomblink at gmail dot com ]. And here is the link to my docs...

 

Visual LGM

 

Again, I just started this today. It's probably being done by someone else, better, over somewhere else. But if I get in and set this all up it will help me to wrap my head around ALL of the pieces. It will require me to touch every aspect of the LGM. And HOPEFULLY, it will help me figure out where to put certain pre-existing datasets into the LGM.

 

Either way, it's going to be interesting. But I also think it will be fun. Taking apart systems and documenting them like this has always been something I enjoy and take a lot away from. So we'll see. Again, if you're interested in being a part? Let me know. I'll share.

bokeefe

ParksFinder for City of Tulsa

Posted by bokeefe Jan 29, 2015

Alrighty then...

 

Alot of you reading this probably offered me help, pointed me to resources, or just watched me struggle blindly through my attempt to implement the ESRI ParksFinder app. Even after figuring out how to get the Parks INTO the LGIM, and then getting the app to make that connection and start to show liveliness, I still had to go the 'upper management approval' route. Which added months to my process. And now...

 

The City of Tulsa Parks Finder Application is live. LIVE LIVE LIVE!

 

Please feast your eyes on the ParksFinder.

 

It is the first of many LGIM-based web map applications. We have begun the push to round up our data and figure out how to force it into the LGIM without losing anything important to us. So far, I've found ways to get City Boundaries, Parcels, and a few other pieces. But I don't want to just force data in but rather KNOW what data and why goes where. So it's going slowly for now, but soon... soon...

 

Please check out the app, play around, offer up any feedback you think works.

 

Have fun either way, thanks for reading and checking out our map.

Alright.

 

I'll just admit. I have slept since phase 1 was live and active. The number of issues we had with it were insane. They were frustrating and annoying and we couldn't seem to find answers. However, we were able to overcome and our ParksFinder works as expected now.

 

Our site is live, but not. http://maps.cityoftulsa.org/parksfinder/

 

You can visit it, use it, but the public has not been made aware yet because according to the Parks department they don't have the data ready for public consumption yet. Frustrating but I get it.

 

So why am I posting a phase 2 when I can't even remember the issues we had? Because I can remember the files that we had to adjust to get things rolling. So I wanted to share those here. I'm also going to try to break down some of the other issues we had based on my (already confessed) hazy memory of the whole thing.

 

ParksFinder/proxy.config

The proxy file gave us several issues. This is how our final one looks now. I have redacted all sensitive information from it. I know that at one point I had TWO AGOL maps up for this. One was for an internal server (serving only to internal customers) and one was external (public facing). So I was dealing with multiple server configurations. Our internal server had different versions between the ArcGIS for Server being used and the Desktop models and the Database, etc. The external also had discrepancies. But now? Now we have a 10.2.2 environment. From our SDE DB to our Desktop. I believe that cleared up ALOT. I think the conflicting versions was causing some of the issues. I also believe that because I was trying to host the app on an Internal-Only server with an Internal-Only AGOL map as well as an External server with an External AGOL map that I might have crossed my wires a couple of times.

 

I know that at one point I was making updates to the Internal data and trying to refresh on the external map. It was all very confusing at various points in the process. Here's the proxy.config file in 'almost' all of its glory.

<ProxyConfig mustMatch="true" logFile="redacted">

  <serverUrls>

 

  <serverUrl url="http://maps.cityoftulsa.org/ParksFinder/"

  matchAll="true"

  oauth2Endpoint="https://www.arcgis.com/sharing/oauth2"

  clientID="redacted"

  clientSecret="redacted"

  rateLimit="50"

  rateLimitPeriod="10">

  </serverUrl>

 

  <serverUrl url="http://maps.cityoftulsa.org/ParksFinder" matchAll="true"></serverUrl>

 

  <serverUrl url="http://maps.cityoftulsa.org/gis/rest/services/LGDM/Parks/FeatureServer" matchAll="true"></serverUrl>

  <serverUrl url="http://maps.cityoftulsa.org/gis/rest/services/LGDM/Parks/MapServer" matchAll="true"></serverUrl>

  <serverUrl url="http://maps.cityoftulsa.org/gis/rest/services/LGDM/Trails/MapServer" matchAll="true"></serverUrl>

 

  <serverUrl url="http://maps.cityoftulsa.org/gis/rest/services/Utilities/Geometry/GeometryServer" matchAll="true"></serverUrl>

 

  <serverUrl url="http://geocode.arcgis.com/arcgis/rest/" matchAll="true"></serverUrl>

  <serverUrl url="http://route.arcgis.com/arcgis/rest/" matchAll="true"

  clientId="redacted"

  clientSecret="redacted"

  rateLimit="10"

  rateLimitPeriod="3"

  ></serverUrl>

  <serverUrl url="http://server.arcgisonline.com/ArcGIS/rest/" matchAll="true"></serverUrl>

  <serverUrl url="http://services.arcgisonline.com/ArcGIS/rest/" matchAll="true"></serverUrl>

  <serverUrl url="http://serverapi.arcgisonline.com/jsapi/" matchAll="true"></serverUrl>

 

  </serverUrls>

</ProxyConfig>

 

ParksFinder/js.config.js

Basemap Settings

We don't have the Local Government Model fleshed out with enough information to populate the basemap settings. So we compromised and used ESRIs. Jake Skinner recommended using ESRI basemaps in order to get the map up much faster than it would take if I first created the necessary layers for the LGDM... This was a tremendous recommendation. I didn't even know it was an option. I feel like this should be the default for these apps, use ESRI basemap data if yours isn't ready. But if you have URL's to your basemap then replace these fields here. Very frustrating. If not for Jake, I might have abandoned the app at this point because of a lack of understanding. (thanks Jake!)

   // ------------------------------------------------------------------------------------------------------------------------

    // BASEMAP SETTINGS

    // ------------------------------------------------------------------------------------------------------------------------

    // Set baseMap layers

    // Please note: All base-maps need to use the same spatial reference. By default, on application start the first base-map will be loaded

    BaseMapLayers: [{

        Key: "topoMap",

        ThumbnailSource: "images/topographic.jpg",

        Name: "Topographic",

        MapURL: "http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"

    }, {

        Key: "parcelMap",

        ThumbnailSource: "images/parcel.png",

        Name: "Streets",

        MapURL: "http://server.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer"

    }, {

        Key: "imageMap",

        ThumbnailSource: "images/Imagery.jpg",

        Name: "Imagery",

        MapURL: "http://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer"

    }],

FeatureServer vs MapServer

I have built quite a few maps for the web and had yet to understand the difference or the creation process for a FeatureServer service versus a MapServer service. So while building the services for the ParksFinder I would go back and forth between following the installation instructions to the T and ad-libbing just to get an updated MXD edit out there quickly during the testing phase. I went back and forth between removing the REST Service and replacing it and testing it with adjustments. Sometimes I would use FeatureServer and other times I would use the MapServer. I believe that this contributed to the problem. Alot.

 

(Custom) Activities

The City of Tulsa parks don't have some of the features being made available in the standard ParksFinder, in fact we also have several that were NOT covered. So I got to not only make adjustments to a pre-built LGDM web app, but to the LGDM itself. Adding new and custom activities to the LGDM itself was the easiest part. Adding those fields to the web app were the harder part. Not actually hard, since it was mainly copy-n-paste, but it was time consuming. However, we have a LOT more activities we make available and quite a few that we cut out of the ParksFinder app. It was really just difficult in a time-consuming manner than in difficulty of the work.

    //Activities to be displayed in info window for a feature

    Activities: [{

        FieldName: "${RESTROOM}",

        Alias: "Restrooms Available",

        Image: "images/restrooms.png",

        isSelected: false

    }, {

 

This project was a great starter-project to get oriented to the Local Government Data Model. It allowed us to see some of the expectations on our system, our databases, our coding, our data, and more. If you're looking for a simple reason to delve in and start using the LGDM then I would highly recommend this app.

 

The setup and configuration are pretty straight forward. The data needed can be as simple as a single park point. But I would use two.

 

Phase 3 : Looking to the future (ParksFinderEditor)

So with the ParksFinder just waiting on the Parks department to update their data and generate the needed photos for ALL 130+ parks, I'm already thinking to myself. I don't have the time or energy to maintain the Parks data for them. But they don't have a dedicated GIS person. So I've put together a ParksFinderEditor map that is only available on our Internal server. It allows the Parks Department to edit each park point (attributes not geometry). They can change what services are offered, opening hours, etc. But they can't move the point. They can add a new park and delete a current park.

 

The problem is, in order to protect this information we are using AGOL security. So each ParksFinderEditor person has to have an AGOL account. We are researching what it would take to create a ParksDepartmentAGOL account. A user account that we could give editing permissions to and only use a single AGOL account for them. Since they don't have a lot of people available for this it might work. I'm just not sure what the rules are yet for 'group' or 'management' accounts on AGOL.

 

But if we can get the security figured out this will revolutionize our GIS department / data by giving non-GIS oriented departments access to managing their own GIS data in a manner that everyone is familiar with... a browser based solution.

 

I'm already looking to the other aspects of the LGDM and the other mapping applications. I took the Community Addressing web app and have retooled it to be a web interface for our Addressing people to begin managing LGDM-based Addresses. They don't have a GIS person, but they do have GIS software... and browsers. So my dream here is to get them started with the web interface and once they get some experience try to introduce some training to get them up to speed on the Addressing plugin for LGDM and ArcGIS for Desktop.

 

Back to the ParksFinder...

 

So the ParksFinder gave me pause on several occasions. But I blame my relative inexperience with under-the-hood GIS technologies for the majority of my issues. My co-workers (a DBA w/SDE experience & a 15+ yrs experience GIS person) really did behind the scenes work to get things tweaked. Again, a lot of what we found out was version issues. We were using version X on our DB, version Y on our ArcGIS for Server, and more. Our Quarterly release goal was to standardize our versions and we have... and coincidentally, ParksFinder works like a charm too.

 

Whatever you do, when trying to implement the ParksFinder web app just make sure to not give up. GeoNet and StackExchange are two great resources. Use them. Ask questions. Don't stop. The issues with getting ParksFinder propped up are not as serious as you probably think. At least they weren't for me. Well, I guess that's it. I hope everyone has a great Thanksgiving for 2014!

 

Peace, Love and Dots and Lines...

I've only been "officially" working with the LGDM (Local Government Data Model) for about a year. But the one key thing that I have found to be a constant is the lack of clarity when searching for information on it. So in an attempt to create a resource that I will use, and something that might benefit others, I plan on using this post to cover those key points that I feel are commonly asked Local Government questions and resources requested.

 

  1. ArcGIS for Local Government 10.2 : http://resources.arcgis.com/en/help/localgovernment/10.2/ This is a 'help' page for Local Government. It should cover the majority of questions that most users initially have for the 10.2 version.
  2. Local Government 10.2 Data Dictionary : http://resources.arcgis.com/en/help/localgovernment/10.2/028s/other/DataDictionary.htm
    The Local Government Data Model is fairly simple dataset. It has complexities within it, but for the most part it's a simple database with some in-depth domains. However, simple doesn't mean easy to digest. It sometimes requires asking questions that aren't self evident when working with it. And despite it having a 'Metadata' section within itself, it does not cover the various fields and what they ACTUALLY mean. The Data Dictionary does this.

...more as I find them...

I was promoted into a GIS Analyst position about a year ago. Prior to that I had spent a good 6-7 years working with GIS data in a CAD environment (Bentley Microstation / Geomedia) but I had ArcMap and Database experience previously and it wasn't that difficult of a struggle to shift gears into the new ESRI experience. I've built web-sites as well, both professionally and as a hobby for years now, so the new Web Maps that ESRI has developed practically call out to me. Prior to this position I was the Address Coordinator for my city and I dealt with the many pitfalls and challenges for a Local Government to be responsible for Addressing without having a good system in place to actually do the job.

 

In comes Adobe Local Government Model.

 

I still remember watching the Addressing videos and having to pick my jaw back up. All of that work that I would have to do to create addresses for a new Subdivision was reduced to point-and-click. And a Database and a Web Map was the end result. I almost cried. *sniff*

 

Well, now my horizon is much broader. I'm helping to develop the GIS foundation for the entire City, not just one department. This shift in focus only helped to solidify Local Government as the direction we needed to take. And that focus didn't get lost on my co-worker and boss.

 

Fast forward to this last week+ and I was encouraged to make a move on the LGDM (something that was already in my bullet journal) so I chose the simplest discipline I could think of... Parks. With roughly 5 tables/feature classes powering Parks in the LGDM I figured this process would give me a sample of what I was looking at as we moved forward into the LGDM arena.

 

But now that I've (mostly) got it up and running... I sure hope not!

 

Note: Just to clarify, I tend to differentiate between the LGDM and the LGIM. The LGIM (Local Government Information Model), to me, is the skeleton... the idea... of what ESRI has. It is the XML Workspace that shows what tables need to be where, and what relationships, etc. The LGIM is empty, and more of the map of what will be. The LGDM (Local Government Data Model) is what the LGIM is when you add data to it. So if I shift around from LGDM to LGIM that is what I am referencing.

 

The Download

Getting ahold of the ParksFinder is really the first step in the process.

 

The Park and Recreation Finder (ArcGIS 10.2) app. This page gives you a nice breakdown on what to expect from the app. What to expect, what requirements it has in order to be put into place, etc. But... buried down on this page is the most important link you can have if you plan on installing and getting this app up and running. The Release Notes has a link to the 'Online Help.'

 

Basically a Yoda page. (No, not short, green and long-eared) This page lays everything out. Just make sure you notice that there are two sections to this page... a Home and a Get Started section. This is where you will find yourself returning to as you hit your own snags and/or glitches.

 

But before you start reading, do yourself a little favor and go ahead and just download the app. Unless you are just going to use the sample data this will just get you started.

 

Data Massage

We started out massaging the data that we already had on our Parks. Basically, Polygons for each park. And we had field names as follows:

FIDPARK_NAMESITEADDRESSACRESPLAYGROUNDSPORTFIELDETC...
0ChamberlainChamberlain4940 N FRANKFORT1414...

 

Not too bad. Massaging this was the least of my issues. I would do things differently if (when) I had (have) to do it over. For instance, we had a kids pool and an adults pool option in our list, but there wasn't one in the LGDM... neither was there a Skatepark, Diskgolf, Indoorgym, etc. After I finished most of the work in getting this map to work I discovered that you can create your own columns in the GDB and just adjust the Javascript to allow for those new Activities... hindsight and that 20/20... ah well. Luckily, I can add them back in later, I just would have appreciated not having to redo that work.

 

Of course, I could have left them in. That IS one of the big selling points of the LGDM. Take their model as a skeleton and add whatever you want to it... Just don't take away from it and everything should work just fine. But... in my infinite wisdom, I went with the... let's try and maintain an LGDM as close to what ESRI has built as possible. If they don't think we need it, then maybe we don't.

 

Point learned.

 

Step 1 : Generate Centroids

So we generated centroids for each park... Simple and easy.

 

Step 2 : Append To LGIM

The next step was to get our data into the LGIM. This step was a little more interesting but not all that difficult. First we append our centroids into the Parks table (with some fairly easy field mapping).

 

DatabaseLocalGovernment
Feature DatasetLocalGovernment.SDE.ReferenceData
Feature ClassLocalGovernment.SDE.Park

 

Figuring out where to place the data was a little bit of a challenge. But not the hardest.

 

Step 3 : Apply Soothing Oils and Massage

We've got our data in the database. But now I want to see something on screen! (I know, impatience doesn't serve) But I've got to continue on.

 

In our Parks data the Activities fields don't operate on a YES/NO but rather a number system to describe how many of those Activities are available. Rather than just a YES/NO for Basketball Courts, we have a listing of how many. So I've got to convert. Field Calculator to the rescue. I'm an old VBA guy (I blame Office 95 and it's Access DB with VBA built in) so I code out some simple IF/THEN's in order to convert any number greater than 0 to a YES. But we can't forget to convert the 0's to a NO. I decided to generate a FACILITYID (Facility Identifier) by taking the first 3 letters of the NAME (Name of Facility) field and the first 3 digits of the address and combining them into something like so... CEN-102 (Centennial Park located at 1028 East 6th Street).

 

Whenever I found a field in the LGDM that we didn't have and I wasn't familiar with I would just go to the sample GDB and see what they had. For instance, SUBTYPEFIELD (Subtype Field) and FEATURECODE (Feature Code) I just set to '790' and 'Park' respectively. There were some other minor adjustments that had to be made but all in all, this wasn't the hard part... (yet). (Trust me, that yet will make sense once we find out about the Field Calculator and YES/NO fields... ugh!)

 

Alright... so our data looks right as far as parks go, the trails process was a lot less interesting. It was more of an almost straight append with some minor field mapping. And our Data Massage process is complete.

 

Map Document Time!

So now we get to open our Map Documents. There are a few in here and I'm suddenly getting this sad feeling like this app will never happen. What do I do with this GeneralPurpose.mxd? ImageryReferenceOverlay?! ACK! At this point I have given up... just a little.

 

But I shouldn't have.

 

I have the GeneralPurpose.mxd open and it's got millions of database connections to the sample GDB. It kinda hits me... oh, no... every one of these Local Government apps will have MXD's tied to the sample GDB's they offer... I have had to re-route data connections in some seriously large MXD's before and I was already daunted by the process just for this... and then Jake Skinner steps in to the rescue...

Parks and Rec Finder : Switch to SDE Connection

You can right-click on the MXD in the catalog window > Set Data Source.  The MXD that contains the hundreds of layers is actually the basemap.  This can take some time to create since you have to populate all of the feature classes in the LGIM.  If you're eager to stand up the app, what I recommend to customers is to use one of ESRI's basemaps in the application.  When your configuring the config file for the app, you can simply specify one of the basemap's REST URLs.

 

Now, you will just need to update the 2 layers in the Parks.mxd, publish this as a service, and you will be able to stand up the app.

I. Am. Floored. I mean, I've read how to do that before but it never clicked because I've never really needed it. The majority of my re-routes were single feature classes. But this was a game changer. So... ok. I get all of the MXD's re-routed to our internal SDE GBD where we have OUR copy of the Local Government Data Model. Containing ONLY the Parks data now... but it's there.

 

With a couple flickers the data suddenly populates on my screen in ArcGIS Desktop 10.2.2 and I am suddenly feeling a little more excited. We have life. It has begun. (Oh, I know I had already begun, but now I can see things on my screen!)

 

I check the Trails.mxd and it works. On a whim I check the other MXD's and step away from them very quickly. Go up to the Quote from Jake Skinner again and see the fourth sentence... "If you're eager to stand up the app, what I recommend to customers is to use one of ESRI's basemaps in the application." This is fundamental.

 

If your group doesn't have the majority of the LGDM filled with working and live data then you really want to ignore those other two MXD's. Inside of the app where you would NORMALLY reference the REST Services for those datasets just reference a relevant ESRI Basemap. This is EXACTLY what I did.

 

To the Web!

I'm done with all of this. I want to see a web map!

 

I share the Parks.mxd and Trails.mxd as webservices in a folder called LGDM.

 

I drop the app on our web server (a 10.1 Server running a 10.1 Web Adapter in a DMZ) and grab the config.js file and proxy.config and quickly add in some ESRI basemaps, an initial extent, and our services. I create a Geometry service (for good measure) and voila!

 

Stuff starts happening.

 

Now at this point I'm getting rudimentary map functionality. I can see the parks but I'm getting weird Javascript errors.

 

BUT I CAN SEE THE MAP WITH MY DATA!

Sigh... I'm going to step away from this blog entry at this point, but I did NOT get to step away from the work on this app at the time. I will try to cover the various issues we had from this. But for now I am posting to a blog for two reasons.

 

  1. To get this off of my brain

    Working through this app install / config process was a grinder. Figuring out which issues were from our data, the app itself, the browser, or our servers/webadapter was excruciatingly difficult at time. My brain got wrung out and put up to dry a few times and writing it out really helps to figure out where I can do better next time and hopefully avoid some of the rookie pitfalls I found.
  2. Help someone else

    The biggest thing I found while searching for answers on this process was that there are no answers. Not without the questions. It was almost comical as my co-worker kept searching out solutions to some of our problems and his web searches were pulling up my questions here on GeoNet instead of answers to those questions. I even posted some of my requests for help on StackExchange with little or not results. Oddly enough, the greatest breakthroughs were from the GeoNet group and some personal e-mail correspondence between me and one of the more experienced members.

My map is up. I'll cover some of the other issues and what we had to do to move past them later. For now, if you hit a snag, feel free to post on GeoNet and if I can help... I will.

 

Peace, Love and Coordinate Systems