Follow Eagle

Get Blog Updates By Email

Your email:

Learn More about Eagle Software and Services

Pipeline GIS Softwaredescribe the image

Eagle Pipeline GIS Blog

Current Articles | RSS Feed RSS Feed

Embedding Esri Feature Service Attachments in SSRS Reports

  
  
  
Esri Feature Service Model Diagram

When we create a demo using Eagle technology we always try to show many different ways you can collect and consume data. One thing we did recently was to embed a SSRS (SQL Server Reporting Services) report into a data collection workflow. Essentially when a user creates a new feature, and it is loaded into the database, a PDF report is generated for the feature and stored on the server. One of the key requirements of this report was to embed in it any attachments that were in the form of a photograph. This way if you take a photo as an attachment in the field, you can easily get the photo back in your report. But how could we get an Esri attachment into a SSRS report?

Wordle for ArcGIS Online

  
  
  
ConstitutionWordle

Wordle [wurduhl] noun;

Viewing Coordinate Data from PODS in Google Earth

  
  
  
One of the best things about PODS is that the standard does not depend on any particular GIS technology. The software engineer is left to decide exactly how PODS should be spatialized. As it turns out, this can be a rather complicated process.  One way to quickly visualize a PODS centerline is to extract the data from the coordinate table, and create a KML file.  This KML file can then be easily viewed in Google Earth or many other free and non-free GIS applications.

This post is a little long, if you want to just see how it works, skip to the end and watch the video (the video is a bit long as well, feel free to skip around it)!

Please note that I did all of this in Oracle 10g, the SQL is mostly compatible with SQL Server, but will require a few changes in order to work correctly.

To begin, we first make a query connecting the route table, through series, station_point, and location to the coordinate table.  Some may say that the join through the location table is not required, and technically it is not.  However, some versions of PODS have extra meta-data stored in the location table that you may want to access, so for now we will leave it in.  Now I add the column I am interested in to the select clause, and an order by measure:

select r.route_id,
      r.description,
      s.series,
      sp.station,
      sp.measure,
      c.x_coord,
      c.y_coord,
      c.z_coord
 from route r, series s, station_point sp, location l, coordinate c
where r.route_id = ???
  and s.route_id = r.route_id
  and s.current_indicator_lf = 'Y'
  and sp.series_id = s.series_id
  and l.location_id = sp.location_id
  and c.location_id = l.location_id
  and c.current_indicator_lf = 'Y'
order by sp.measure


Don’t forget your current_indicator_lf flags in the query, and to replace the ??? with the route id!

Some of you may be ready to point out some issues about projections and coordinate systems at this point.  The main assumption that I am making here is the the coordinates (latitudes and longitudes) are stored in WGS 1984, the official projection for a KML file.  If your data is in a different projection you will need to do some preparation work before drawing the KML file.

The next part involves adjusting the query to build the XML that a KML is made up of.  I will not cover the details of the KML specification in this post, but you can get a good description here: http://code.google.com/apis/kml/documentation/kml_tut.html

We first need to construct the point XML tag, which will represent the location.  This takes the form:
<Point><coodinates>LONG,LAT,ELEV</coordinates></Point>


So we can add a column to our select clause that creates this string:
'<Point><coordinates>'||c.x_coord||','||c.y_coord||','||c.z_coord||'</coordinates></Point>' as KML_POINT


This will generate the location data needed for the KML file, now we need to create the rest of “Placemark” tag, which represents the location of each point, like this:
<Placemark><name>A Name</name><description>a Description</description><Point .../></Placemark>


Where the <Point .../> is the same as we defined above.  We can generate this tag by adding this to the Select clause:
'<Placemark><name>'||s.series||','||sp.station||'</name><description>'||sp.measure||'</description>'||'<Point><coordinates>'||c.x_coord||','||c.y_coord||','||c.z_coord||'</coordinates></Point>'||'</Placemark>' as KML_PLACEMARK



One more step to make a KML file, we need to opening and the closing parts of the file.  To do this, we will simply add the following lines at the beginning:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document><name>Route KML</name>
<Folder><name>A route</name>



The results from this query in the middle:

select '<Placemark><name>'||s.series||','||sp.station||'</name><description>'||sp.measure||'</description>'||'<Point><coordinates>'||c.x_coord||','||c.y_coord||','||c.z_coord||'</coordinates></Point>'||'</Placemark>' as KML_PLACEMARK
 from route r, series s, station_point sp, location l, coordinate c
where r.route_id = ???
  and s.route_id = r.route_id
  and s.current_indicator_lf = 'Y'
  and sp.series_id = s.series_id
  and l.location_id = sp.location_id
  and c.location_id = l.location_id
  and c.current_indicator_lf = 'Y'
order by sp.measure


and the following lines at the end:
</Folder>
</Document>
</kml>


You can of course get very fancy with the KML and the formatting.  You could also create a polyline or linestring instead of a series of points, but I will leave that for another time!  When building the KML file the first time, it is easy to get a tag messed up, you can use this website (http://kmlvalidator.com/) to upload and validate your KML as you are creating it.  This site does a really good job, but it is very strict so take the feedback with a grain of salt.  Another way to validate things is to simply validate the XML structure.  There are many sites out there to do that, the one I normally use is: http://validator.w3.org/.


Now simply save the file as a KML and open in Google Earth!

Example KML File for Download.

How to query events on a particular route in PODS

  
  
  

A PODS relational database can be a tricky thing to query especially if you are not familiar with the complicated joins and flags that normally accompany such a complex and rich data model.  In this case, I will show how to construct a query for a PODS 3.2.1 Relational model with history.  I will not cover “inline vs offline” history here since offline is not technically supported by PODS at this time.

Tags: , , ,

Getting Started with ArcGIS Online for Data Collection and Editing

  
  
  
ArcGIS Online home page

At the 2011 GITA GIS for Oil & Gas Pipeline Conference, Eagle will be giving away a new Apple iPad 2. Well, not exactly giving it away; it's a contest to see who can create the coolest pipeline in our ArcGIS Online-driven, gisgap powered pipeline editing application! In order to play, you'll need an ArcGIS Online account. If you already have one, you can skip down to the part where we tell you how to join the Eagle GITA Pipeline Palooza group. If you don't have an ArcGIS Online account, follow these instructions...

Pipeline Data Governance - An Introduction to gisgap

  
  
  

"An ounce of prevention is worth a pound of cure." - Benjamin Franklin

Pipeline Data Governance - Tools for Success

  
  
  

In the previous post we introduced the concept of treating data collection and management as a manufacturing process. We touched on the notion that all data is potentially important, and should be treated as such. Finally, we posited that the first requisite of successful data governance is an attitude that focuses on attention to detail. This is all well and good, but face it, a positive attitude and five bucks won't buy you a non-fat, no-whip, double-shot, mocha macchiato. What you need is some concrete help. That's what we'll discuss here.

Pipeline Data Governance - We Don't Know What We Don't Know

  
  
  
Don't put you head in the sand!

Not the best way to understand your underground assets...

Eagle's Midstream Business Article

  
  
  
Be sure to check out Eagle's article in the March issue of Midstream Business. Our very own Tracy Thorleifson wrote about NTSB's new safety regulations. 

NTSB Urgent Safety Recommendations and Pipeline Data Governance

  
  
  
The pipeline data iceberg

On January 3, 2011, the National Transportation Safety Board (NTSB) issued a series of urgent pipeline safety recommendations based on preliminary findings from the September 9, 2010, gas transmission pipeline rupture in San Bruno, California, which killed eight people and caused extensive property damage. The NTSB investigation determined that pipeline records were inaccurate, and potentially resulted in an inappropriate Maximum Allowable Operating Pressure (MAOP) for the line in question. The resulting urgent safety recommendations "call on pipeline operators and regulators to ensure that the records, surveys, and documents for all pipeline systems accurately reflect the pipeline infrastructure as built throughout the United States so that maximum safe operating pressures are accurately calculated."

All Posts