Working with GeoJSon

3198
1
06-17-2014 04:19 AM
ChristopherThompson
Occasional Contributor III
I have an input that reads a GeoJson feed from a source and initially I want have that output to a REST cache.  The geoevent definition has the fields organized as groups - features, geometry, properties, and coordinate system.  However, the output doesn't appear to be parsing the several fields into these groups and is creating output that looks like the following:

[INDENT]GeoJason_IncidentPoints,Feature,,,"0.0,0.0,0.0"[/INDENT]

I had thought GEP would parse the fields contained in the groups - is this not the case?
0 Kudos
1 Reply
RJSunderman
Esri Regular Contributor
Hello Christopher -

The Wikipedia article [url=http://en.wikipedia.org/wiki/GeoJSON]here[/url] gives a good example of different types of geoJSON. The GeoEvent Processor is able to parse and accept geoJSON containing "Point" data using the out-of-the-box generic JSON adapter. GEP cannot ingest "LineString" or "Polygon" geoJSON at the 10.2.x release.

Can you indicate the URL you are using to query the GeoEvent cache for data? I think the formatting you are looking for is part of the standard REST API query syntax.

For example, you might post the following geoJSON to a �??Receive JSON on a REST endpoint�?? inbound connector:
{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    102,
                    0.6
                ]
            },
            "properties": {
                "prop0": "value0"
            }
        }
    ]
}

You could then direct the constructed GeoEvent to a �??Publish GeoEvents on a REST endpoint�?? output. At the 10.2.2 release, if you click to open an existing event cache output and review its configuration, you will see links for viewing the cache�??s contents as either �??Text�?? or �??JSON�?? as shown in the following illustration:

[ATTACH=CONFIG]34970[/ATTACH]
(Click to enlarge)

If you browse to the cache�??s REST endpoint and append the formatting f=text you will get the following:
Generated-GeoJSON-Example,Feature,"{""type"":""Point""}"," {""type"":""value0""}"


If you browse to the same endpoint and append the formatting f=generic-json you will get a representation of the GeoEvent matching the illustration below.

[ATTACH=CONFIG]34971[/ATTACH]

Hope this information helps -
RJ
0 Kudos