There may be cases
when you have an existing feature service, either
on ESRI ArcGIS online or on a local ArcGIS server
and you simply want to append live updating
values to that feature
service. For example, for a user who has spent weeks
drawing complicated pipeline layers in a feature
service, it does not make sense to copy that geometry
back into PI AF then publish it into a
brand new feature service. Instead, it makes more
sense to simply append live values from the PI system
to that pre-existing feature service. In this case,
we have a complicated feature service
that already exists called cross country lines.
And it was not created by the integrator
but via other means. For example,
ESRI Arcmap desktop software. And what we want to
do is we want to append it to each feature
in this feature service, new live updating fields.
Additional fields down here that will receive PI system
data via the PI Integrator for
ESRI ArcGIS. And rather than duplicating
every field of the feature service, within AF,
we simply created a simple AF template
that contains only the new fields that we wish to append to the
pre-existing static fields. And to match
up these elements with the existing
features, we are using a field called identifier.
So we have made sure that the values of the identifier
attribute in our elements
match up with the identifier values
for our features.
If you are in a
similar case as this one and you simply want to
append live fields to an existing feature service or if
your PI AF system simply contains no geometry information,
you should create and use a custom geo event
service and the GeoEvent Processor. You use that
custom GeoEvent service to add geometry information
to an existing stream of realtime data from the PI
Integrator for ESRI ArcGIS. That
added geometry information can be provided from a different
ESRI ArcGIS source such as in this case, an existing
feature service. To use a customer GeoEvent service,
you must first create a custom
connector in the GeoEvent Processor which creates the proper
inputs. Normally the custom connector in the geo event
processor must use the JSON adapter,
feature JSON, with HTTP protocol configured
as the transport method. The custom connector
is not configured by default. After the custom
connector is configured, you can then create a new input
in the GeoEvent Processor and start receiving data
from the PI Integrator for ESI ArcGIS.
What follows is we are going to describe how to
create that custom connector, how to create a GeoEvent
definition and how to create the required input in the GeoEvent Processor.
So these following steps must be
performed one time for each GeoEvent
Processor in your configuration. The procedure is as
follows, first I will log into my GeoEvent Processor
Manager and I will click on the
site tab and then I will click on the
connectors menu item.
And I am going to go ahead and click the create connector button.
I have already gone ahead and done that, so I am
going to show you what I have created. I have actually gone ahead and
created a connector right now. Let me show you all of the
settings for it. When you are creating this new connector,
you use the exact same settings. So in the name
field, enter a name such as in this
case, http FJSON
no off. Under the label field, we will also enter a label
which is identical here. And a description if we want to.
In the type field, we are going to select that this is going to be
an input connector. We will select the input radio button.
In the adapter field, we will select JSON.
And in the transport, we will select HTTP. Now in the
default input name field, we will enter the name to be used as
default such as in this case,
HTTP-FJSON-NO-AUTH. And having
done this, we'll select the remaining default values and click create.
Now I have already gone ahead and done that. And this is
exactly the results that I arrived with.
So this is actually creating the custom connector. Now
next, we are going to have to create a geo event
definition. This must be performed for each
data stream that you want to do this procedure for.
So I am going to take a data stream from my AF
server that only contains these limited
attributes. I can send that to a pre-existing feature service.
So I am going to have to do this procedure once in this case to
create the custom GeoEvent definition.
So what I am going to do first is I am going to go to the PI Integrator
for ESRI ArcGIS Manager. And I go to the layer
detail page of the layer and I am
going to get the field information from it. So I am
basically I am going to take off the fields and
use those to create my GeoEvent definition.
I have not created the layer yet, I will do that for you now
because I just want you to see what happens when you try to create a
layer without geometry because as you noticed
here, there is no geometry in my AF template. I am simply
going to use the geometry that already exists
here in my destination feature service.
So I have already gone ahead and created a service in the configuration
portal, and now let me go ahead and
create a layer. I am going to call
this cross country
lines.
I will give it a
description. I
will select my AF database and
my template. Specify
search route. Go
ahead and click preview. As you can see, it is
bringing in the live values that I want to append.
These are all going to be new fields appended to the existing feature service. And
of course we have the identifier attribute which we will use to
match up this data with the correct existing
feature. So this right now is
continuing as usual. I am going to go ahead and
specify that this identifier is going to be the key. And
I will go ahead and hit continue. You will notice
that there was no geometry. And do receive a pop-up letting me know that I have not
specified any fields that supply geometry information.
I will mention that this is going to prevent
me from using the built in wizard to publish
my layered ArcGIS. That is totally fine because I am using a
pre-existing feature service and I am simply
appending this data to it. So this pop up is
totally acceptable. I will go ahead and click
create layer.
And I am not going to open the wizard, so go ahead and click no thanks.
So as we mentioned before, I am going to be
creating a geo event definition.
And I am going to start by making the Geo Event definition
that matches up with the fields of this data
stream. So let me go ahead and click fields here for that data stream we
just created and I can create a GeoEvent definition that has
all of these matching fields. I will
start creating this in the GeoEvent
Processor. So go ahead to create that new
GeoEvent definition, I will go to the Geo Event Processor.
I will go to the site tab which is where I am right now
and I will click on GeoEvent definitions. What I want is
I want to create a new GeoEvent definition.
It will ask me for my title,
let me call this cross
country
transmission. Go ahead and hit create.
And in the name
field, I have entered a nice descriptive name here. I will leave
that the way it is. And now for each field
that I find in my
data stream in the Integrator, I will go ahead and click the new
field button and perform the following steps.
So there is the current power field.
So go ahead and copy this name.
Let me go ahead and click new
field. And you enter the field
name and I am going to enter the type. The type
here is a double. And I am going
to leave the cardinality as one which is right below type.
Now all attribute names should be specified
in lower case letters. This is very important. The PI Integrator
for ESRI ArcGIS uses all lower case
attribute names when sending data to the GeoEvent Processor.
And you will notice below that there is available tags and
added tags field. I am only going to use this
for fields that identify a feature. And for those
fields, the track ID tag should be moved
to the added tag section of the screen. The current
power field is not the one that I am using to
identify a feature. That is going to be my identifier
which we discussed earlier. So for this, I will leave this as it is
and I will simply go ahead and click OK.
I will repeat these procedures for all of the
other fields.
I will make sure it is lower case.
I will make the type correct. I will leave cardinality as one.
And this is not an identifier so
simply go ahead and click create.
Now this is actually my
identifier, so I will leave this as a string, but
since it is what I used to identify my
features, I will move
over the track ID.
Now you see that this has track ID.
And I am almost done, need to do just one more.
I have finished my
custom GeoEvent definition.
And each of these fields here, current
power through name, all six of these match up with the
fields that I see here in the Integrator
Configuration Portal. The types match and the names
match and I have made sure that all of the names are indeed lower case.
So I will go ahead and hit save.
Now
having done that, I am going to go ahead
and start creating the necessary objects on the
GeoEvent Processor to obtain data from the
layer that I created in the configuration portal,
and send that to my target feature service.
So first we need to obtain the URL
for that layer that I created. So as you saw
earlier, we went ahead and created the service and we created the layer in the
configuration portal. So let's
go ahead and obtain the URL
for the layer. So I will go to the configuration portal, I
will click on the stream service hyperlink. And
click services directory.
And I am going to be using HTTP. So let me
copy the URL for using
polled HTTP which is this URL right here.
When choosing the HTTPS URL, please ensure that the
PI Integrator for ESRI ArcGIS HTTPS certificate
is trusted in this GeoEvent Processor instance.
And we have some documentation
at the OSIsoft live library for describing that.
So let me go ahead and head back to my
GeoEvent Processor. So now that I am in the GeoEvent
Processor, let me go ahead and start creating that
input. So to create the input, I will go to
services. I will click inputs.
Go ahead
and add an input.
In the input connector screen displays I am going to
locate the input name that I just created earlier. In this
case it is this one, HTTP-FJSON-NO-AUTH.
And I will click the select button.
So the creating input
screen displays. And the name field, I will enter a descriptive name
for this input. In this case let me call it
cross country lines input. Under
create geo event definition, I am going to select
no. And I am going to use the geo event definition that I just
created. So I will scroll down and I will find that one that I
made which is cross country lines transmission which is the one I just
created and saved. And now I am going to get to the
part where I insert the URL. So here is
the URL that we mentioned. I copied this from my
layer and I will go ahead and paste this in here. And I
actually am going to append something to the end of this.
I am going to append ?F
equals JSON.
This suffix here.
Now I am going to go
ahead and click save.
And so I have properly created an input that uses that
new geo event definition that I just created.
So we need to create the remaining two objects
of the geo event processor, the output and the service.
So we will begin with the output, so we will go ahead and click outputs
and
on the outputs screen I will put add output.
And I want to scroll down and I specifically
want to use the type of output
called update a feature.
I am going to give it a
new name for my output. I will call
it cross country lines
output. And I will specify
the data store.
And the actual feature service that I want to write data
to. Again, this is the
ArcGIS online account in this case
and a feature service. So this is the account that I used
to login and this is my feature service cross country
lines- the one that exists right here.
And I need to specify what the
unique feature identifier field is.
In this case, it is going to be the identifier
field and not the name. So I will change that and I will go
ahead and click save.
So now I have created the input and I
have created the output. The input reads data, the output
writes data and I am going to put a service
in between to connect the input to the output. So I will
go ahead and click add service. I will
call this cross country lines
service.
I will give it a particular description.
Go ahead and hit create. And I am going
to add the input and output that I
just created. So I will scroll down and under inputs you can
see I have cross country lines input, I will drag that
and I will find the output that I just created as well.
So now that these are both dragged on, I will mouse over
and I will see this triangle. I click
that and draw connector to my output. Now I have created a
service that links this input with this output. I can go
ahead and click publish.
So this process will append
new live updating fields to an existing feature
service. So the last step that we will do is to actually
add these new fields to our service after which we will
see those fields begin to update with live data.
So to begin, let's locate our feature
service. Again, in my case, it is in ArcGIS online
and let's add it to a new map with editing enabled
So I will select the option add layers,
new map with editing enabled. And that will allow me to
actually add the new fields to the feature service. And
specifically what do I mean? If you look
here, the fields for this feature service are
name, rating, drawn by last updated and identified. But I am going to be
adding on new fields based on my AF template.
The new fields are going to be current power, current
power average, another average and a minimum. So you
need to add in some new fields. So I will show you what
happens when I add a new field, current power.
So in order to actually add those, the first thing to
do is set the refresh interval. So let me
set the refresh interval so we can see the results of our
work. So I will mouse over, select refresh interval and set this
to be 0.1 minutes.
And I will go ahead and save my map.
I will give it a title and I have to specify some
tags. I then save the map.
So now when I want to add those fields, I will go ahead and
mouse over and select
show table.
I go ahead and select show table and
what I am going to do here is I am going to add a field.
Now I am going to add a field and I am going to specify
its name and its type. And here I have to make sure the name
matches up exactly with the name of the field
in my geo event definition which means
using all lower case and the exact same name as that field.
So current power
as an example.. current
power and remember it is
of type double. And this matches up exactly with the
current power field. And again, it does not necessarily
match up with the attribute, it matches
up with the geo event definition.
So I will go ahead and hit add new field. And
after doing that when it refreshes, I will see this
new field appended to this table. Now if I
click on one of these, I will see the new field. And
sure enough, I will also see values from the PI
system. This let's us know that the procedure has indeed
been successful. Following all of this, I
have manually performed the configuration to
simply append new live updating fields to
an existing feature service. I can click on all of the
other features within
this feature service and I can see that they too
are receiving those new values. So just to show
another, I will go ahead and add another field. And
this one is going to be
called.. I will define what it is going to be called, I will go
to fields and
it will be this particular field name. Go back, I will
paste it and I remember that it needs to be lower
case. And I will select the correct type
to double and I will add new field. That new field
will indeed show up- current power average. Now I can see for all of
these that we are getting both the current power
and the current power average. So I did not need to bring this
existing feature service into AF, I simply used this
procedure to append new values, new live updating
fields, to an existing feature service that had
been created in some other manner, not
via the Integrator. The procedure that I followed for all of
this is outlined in great detail in the OSIsoft
live library. So if you navigate to
livelibrary.osisoft.com,
there is a section called Integrators. If you
click on Integrators, then the PI Integrator
for ESRI ArcGIS 2014, you
will see there is some other interesting information
here. The specific procedure that I have been running through
is under user configuration and custom configuration.
These are the steps that I
walked through. If you have any questions,
feel free to contact us at OSIsoft tech support.