CLD202x SharePoint Basics for IT Professionals: Yes please

I was planning on posting this a few weeks ago when I signed up for this course, but I’ve only gotten around to it now. I am very pleased with the course offering by Microsoft on edX, and this course is no exception.

Over 2 years ago now, when our GIS team split into Enterprise and Desktop, I was introduced to SharePoint. I had left the City just before they made switch to using SharePoint libraries as storage space instead of My Documents, so I had only dabbled with it briefly (and from an end user perspective).

During the last 2 years, I have had to interact with it in multiple ways – setting up subsites, managing permissions, creating content (such as embedding YouTube playlists, storing geometry in lists, configuring spatial viewers), and generally whatever else came up.

I never received any formal training in it, and simply clicking around in SharePoint while trying to figure it out, as I am inclined to do with other technologies, does not really work. There’s a reason this site exists. This is why I am pleased that Microsoft thought to offer this MOOC – it’s clearly needed.

The notes are very detailed, and explained very nicely in text form. This makes it very easy for me to copy into OneNote, and highlight as needed. The concepts are explained in a way that I would never have gotten from our seasoned SharePoint dev. Not that he doesn’t want to explain – he has shown me so many things on SharePoint – but it’s often the little things that one does automatically that trips up newbies.

For example, one of our clients had recently started using ArcGIS full time after only using it for very basic data capture before. He asked me why ArcMap was complaining about the projection of two feature classes being different when they were both in the same projection. I pointed out that while they were both in LO19, the one projection’s name was “LO19”, while the other one was “Transverse_Mercator_19”. It shouldn’t make a difference, but it does. The central meridian might differ by 0.00001 or something.

Another example is when one runs the Append tool in an ArcMap session, with the target table opened in the map. The tool will complete successfully, but the newly added rows won’t appear in the table even if you click away to a different table. You have to close the table, then open it again to force a refresh. Most of my ArcMap woes are solved this way – closing off whatever I’m doing and trying it again, or forcibly ending the programme. This is something I know after dealing with ArcMap for over 8 years now. It’s the GIS equivalent of

ArcGIS has a seemingly endless amount of this type of issue, and if I were teaching a total n00b how to use it, I would never even think to mention these things, because dealing with them is a reflex now. From what I can tell, SharePoint is similar, except that it probably has even more of it. Nonetheless, I’m just happy that someone has taken the time to lay out the basics in this format.

Display line geometry in a SharePoint List using ESRI Maps for SharePoint

A while ago I was asked to find out how to display line geometry on a map using SharePoint lists. After some creative googling, I came across an ESRI thread, and another one, which pointed me in the right direction. This example uses a single line feature to demonstrate the methodology I developed.

In ArcGIS:

  1. Convert the line feature to JSON using the tool or using Python (my preferred method):


    #
    # @date 29/04/2015
    # @author Cindy Williams
    #
    # Converts geometry in a feature class to JSON,
    # and writes it to a CSV file.
    #
    # For use in the Python window in ArcCatalog.
    #
    import arcpy
    arcpy.env.workspace = r"C:\Some\Arb\Folder"
    lyr = arcpy.management.MakeFeatureLayer("work.gdb\ftr_line")
    outcsv = r"line_json.csv"
    # Get geometry of first feature as JSON
    lyr_json = arcpy.da.SearchCursor(lyr, "SHAPE@JSON").next()[0]
    # Write JSON to CSV
    with open(outcsv, 'wb') as csvw:
    csvw.write(lyr_json)

    Of course you can save the file immediately as a JSON file, but I am so used to writing it out to CSV that I automatically put that there.

In your SharePoint site:

  1. Create a custom list (or open your existing one).
  2. Add a plain text column called Shape of type Multiple Lines (not sure if this is a requirement, but I figured it couldn’t hurt). As mentioned in the thread, the column must be created with the correct title – renaming an existing column will not work.
  3. Add a ESRI Maps Location column to the list. Under Location Settings > Coordinate Fields, select Shape. The field dropdown should automatically populate the Shapecolumn we added earlier.
  4. Start editing your list.
  5. Create a new record in your list, and populate your attributes. Copy the JSON string from the file created earlier and paste it into the Shape column.

Here is the result (click to enlarge):

SharePoint_JSON

JSON representation of a line in a SharePoint list using ESRI Maps for SharePoint

This is a nice way of storing commonly accessed features such as study area boundaries, in a central list without a dependency on map services hosted on ArcGIS Server or ArcGIS Online.

Uploading and embedding an unlisted YouTube video into a SharePoint site

This doesn’t have anything to do with GIS necessarily, but often I find that in the course of my work I have to do these arbitrary tasks which support our bigger projects. After having previously uploaded certain project video files in a document library on SharePoint, that didn’t seem to be the best way to do it.

After some thinking and Googling, I found that uploading the videos to YouTube and embedding it on a SharePoint wiki page would be the best option. While the videos do not contain sensitive information, we tend to err on the side of caution, so I researched how to make the videos private.

That’s how I came across the unlisted option. After uploading the videos and marking them as unlisted, I then embedded each video into a 3-column wiki page on the SharePoint site using the YouTube embed code.

This process was tedious though. I had to perform this task again recently for a different site. This created a problem in several ways:

  1. There were now videos for two different projects attached to the account. The amount of projects will probably increase in the future
  2. I would need to tag, rename and edit each video description separately (for 22 videos)
  3. Embedding each individual video would be a pain

I fixed number 2 quickly by changing the video upload defaults, so that during a batch upload each video would retain its name, get the correct description and tags, be marked as unlisted and categorised correctly.

I fixed numbers 1 and 3 by creating an unlisted playlist. After creating the playlist, I added the videos in the order I wanted, grabbed the embed code and pasted it into my SharePoint page.