Polygons and Lines in GEP

3345
5
11-28-2013 04:48 AM
R_Spitzer
Esri Contributor
Hi,

I'm trying to get Polygons and Lines into GEP. Unfortunately I did not find any hint in the resource-center about getting polygons and lines into GEP.
Right now I tried with a Json Input Adapter and I tried to fill in a polygon with the Json Geometry Object Notation, which you can find here:
http://resources.arcgis.com/en/help/rest/apiref/geometry.html

So far I tried to feed the GEP with the following Json:
[{"geometry": {"hasZ":true,"rings": [[10.114760188242185,49.44835148727626,0],[10.114760188242385,49.44835148727626,0],[10.114760188242085,49.44835148727326,0],[10.114760188242485,49.44835148727426,0],[10.114760188242185,49.44835148727626,0]],"spatialReference":{"wkid":4326}},"attributes":{"Alpha":"alpha"}]


But I get
[ATTACH=CONFIG]29438[/ATTACH]
the geometry is not recognized.

Is there any documentation about the formatting of Polygons and Lines?

Kind regards,
Rainer
0 Kudos
5 Replies
RyanElliott
New Contributor III
There were some bugs with the 10.2.0 version of the JSON Feature parser.  The known issues were fixed in version 10.2.1, and so it should be able to read an array of features like the sample below, or you can omit the square brackets and send an individual feature.  I noticed that in your posted sample JSON, you were missing a curly bracket "}" near the end.  Your screenshot shows a GeoEvent Definition that does not match the JSON data, though.  It should have 2 fields, a Geometry and a String field.  The geometry field can be named anything you like, but need to have the GEOMETRY tag on it.  The string field needs to have the name "Alpha" in order to get the parser to populate the field correctly.  Hope that helps.
[
  {
    "geometry": 
    {
      "rings": 
      [
        [10.114760188242185,49.44835148727626,0],
        [10.114760188242385,49.44835148727626,0],  
        [10.114760188242085,49.44835148727326,0],
        [10.114760188242485,49.44835148727426,0],
        [10.114760188242185,49.44835148727626,0]
      ],
      "spatialReference":
      {
        "wkid":4326
      }
    },
    "attributes":
    {
      "Alpha":"alpha"
    }
  }
]
KennethTriplett
New Contributor
I have a very similar situation, but I would like to create the line or polygon through a comma separated message.  Is that possible?  If yes, is there an example or documentation?

Thanks,
Ken
0 Kudos
RyanElliott
New Contributor III
Yes, that is possible.  You would have to embed the JSON structure above into a single quoted text value in your csv message.  The quotes in the JSON structure have to be escaped.  Newline characters (carriage returns) need to be removed.  So the message in my previous post would look something like this:

"{\"rings\":[[[10.114760188242185,49.44835148727626,0],[10.114760188242385,49.44835148727626,0],[10.114760188242085,49.44835148727326,0],[10.114760188242485,49.44835148727426,0],[10.114760188242185,49.44835148727626,0]]],\"spatialReference\":{\"wkid\":4326}}",alpha


If you need to know what a polyline looks like (or just want the complete spec for geometry objects, Take a look here
0 Kudos
R_Spitzer
Esri Contributor
Thank you for the link.
Is the GEP able to handle all this kind of geometries listed there? Specially Envelopes?

Kind regards
0 Kudos
RyanElliott
New Contributor III
Yes, Envelopes should be recognized as well.
0 Kudos