Select to view content in your preferred language

SDE Table as input?

3207
3
Jump to solution
08-06-2015 09:15 AM
AllenScully
Frequent Contributor

Hi - Working with the 30 day demo of GEP to see if it can work for us.  Wondering if it will accept a simple table in an SDE geodatabase as input?  Seems like it needs to be published as a feature service, but this dictates objectid being generated, which blows up our table updating process.  Was thinking we could export the table to xml recordset document since xml files are valid inputs, but my understanding is that this would be a static file, not reading new records from the table once it's created.  Thanks.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AllenScully
Frequent Contributor

After a few very productive conversations with RJ, I have an answer and much new information.

-  The initial question was about using an SDE table as an input, which as RJ states above, is not possible.  However it is quite straightforward to publish that table as part of a Map Service via Server with feature access (not 100% sure if this is necessary for the input but it doesn't hurt) and then use the 'Poll a url for JSON' to access the data in that table.

- When you set up your input connector for this, the url needs to be essentially what RJ posted above, obviously with 'SampleWorldCities/MapServer/0' replaced with your own data.  The query component of the url should be fine as is.  Assuming your table needs geometry calculated, in the 'Advanced' settings of the input connector, you need to check 'Yes' under 'Construct Geometry from fields' and give your attributes for x and y.  You may need to add 'attributes...' in front of the field name (attributes.x_coord, for example) to work with the JSON.

- Due to a bug in version 10.3, we added a second GeoEvent Definition to map to that has identical fields/data types as the initial GeoEv Def, but without the 'attributes.' in front of every field, and adding in a field of type 'Geometry' to store the results of the Field Calculator calculating geometry from x/y fields.

- Then a field mapper is added to map GeoEvent Def 1 (initial input) to the 2nd one, which can then be hooked up to field calculator to geometry, and you are on your way.

- It is extremely helpful to create a simple output connector of type 'Write to a JSON file' in order to get a look at your data to this point.

Thanks RJ for your help here.  I marked this as the correct answer since it has what I ended up doing, but consider RJ's response as part of the 'correct answer' as well.

View solution in original post

0 Kudos
3 Replies
AllenScully
Frequent Contributor

Quick update - i have created a service that has the table we need, with feature access.  Now the issue is that the table has X/Y coordinates but the 'Poll an ArcGIS Server for Features' input does not seem to have a way to convert them into geometry (whereas the 'Receive Text from a TCP Socket allows you to specify X/Y geometry fields). 

0 Kudos
RJSunderman
Esri Regular Contributor

Hello Allen -

The Poll an ArcGIS Server for Featuresinput makes the assumption that the Geometry for your events will come from the features you are polling. So that particular input does not offer a configuration option to Construct Geometry From Fields.

I'd recommend you try using the Poll an External Website for JSONinput. That input connector uses the product's generic JSON adapter (vs. the Esri Feature JSON adapter used by the  Poll an ArcGIS Server for Featuresinput).

When configuring your Poll an External Website for JSONinput you will have to specify the URL that GeoEvent should poll. You will have to include all of the required parameters for polling a Esri feature service as generic JSON. The easiest way to see what these parameters are is to use the ArcGIS REST Services Directory to query your feature service, then copy/paste the URL generated for your query and examine the parameters. Many of the parameters will be unspecified. Examples include:   &text= &objectIds= &time= 

You can omit many of the parameters.

For example:

<code>http://localhost:6080/arcgis/rest/services/SampleWorldCities/MapServer/0/query<br/>?where=1%3D1&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects<br/>&outFields=*&returnGeometry=false&returnTrueCurves=false&returnIdsOnly=false<br/>&returnCountOnly=false&returnZ=false&returnM=false&returnDistinctValues=false<br/>&f=json</code>

You would need to specify the above query as a single line of text ... as the Poll an External Website for JSON input's URL property. You will also need to configure the input to specify 'features' (no quotes) for the input's JSON Object Name parameter so the input knows to look for an array containing features and bring each feature in as a separate event. In my example above, I elected to specify returnGeometry=false since you indicated that you intend to have the input use coordinate values returned from the feature query to construct a Point Geometry.

Hope this information helps -

RJ

AllenScully
Frequent Contributor

After a few very productive conversations with RJ, I have an answer and much new information.

-  The initial question was about using an SDE table as an input, which as RJ states above, is not possible.  However it is quite straightforward to publish that table as part of a Map Service via Server with feature access (not 100% sure if this is necessary for the input but it doesn't hurt) and then use the 'Poll a url for JSON' to access the data in that table.

- When you set up your input connector for this, the url needs to be essentially what RJ posted above, obviously with 'SampleWorldCities/MapServer/0' replaced with your own data.  The query component of the url should be fine as is.  Assuming your table needs geometry calculated, in the 'Advanced' settings of the input connector, you need to check 'Yes' under 'Construct Geometry from fields' and give your attributes for x and y.  You may need to add 'attributes...' in front of the field name (attributes.x_coord, for example) to work with the JSON.

- Due to a bug in version 10.3, we added a second GeoEvent Definition to map to that has identical fields/data types as the initial GeoEv Def, but without the 'attributes.' in front of every field, and adding in a field of type 'Geometry' to store the results of the Field Calculator calculating geometry from x/y fields.

- Then a field mapper is added to map GeoEvent Def 1 (initial input) to the 2nd one, which can then be hooked up to field calculator to geometry, and you are on your way.

- It is extremely helpful to create a simple output connector of type 'Write to a JSON file' in order to get a look at your data to this point.

Thanks RJ for your help here.  I marked this as the correct answer since it has what I ended up doing, but consider RJ's response as part of the 'correct answer' as well.

0 Kudos