AnsweredAssumed Answered

Where is the Text Adapter Documentation?

Question asked by jason.tipton.gis on Aug 3, 2018
Latest reply on Nov 19, 2018 by DCota-esristaff

Is there any documentation on the Text Adapter and what it expects the format to be for certain data types. I'm specifically looking for the format for Geometry objects.

 

I will be receiving WKT and I need to convert the WKT to geometry. Points would be fairly simple, but my features will be lines. I found an answer in this post that linked to Appendix A of the tutorial which I found and followed. I was able to construct the geometry that I needed. Basically, you just need a string that looks like:

"{""paths"":[[[-79, 60]],[[-77, 64],[-75, 62]]]}"

My source WKT looks like:

Linestring(-79 60, -77 64, -75 62)

To convert the WKT to the proper string, I wrote a Field Calculator expression (wkt is the field that holds the input WKT):

replaceAll(
   replaceAll(
      replaceAll( wkt,
                  'Linestring[(](.*)[)]',
                  '{"paths":[[[$1]]]}'),
      ',\s*',
      '],['),
   '(\d) +(\d)',
   '$1, $2')

 

This did the trick, however, the coordinates is missing the CRS.

 

"geometry" : {"type":"MultiLineString","coordinates":[[[-79,60],[-79,60]],[[-77,64],[-75,62]]],"crs":null },

 

How can I set the Spatial Reference? I'm assuming if the spatial reference is the same as my Feature Service that this will work. I have not tried it yet, but I would rather be able to set the spatial reference. The tutorial in Appendix A says to leave the spatial reference piece out.

 

Also, a tutorial is good for 1st time use, but I would like to find better documentation on individual features of GeoEvent Server that gives all of the capabilities of each piece, not just the 1 capability that the tutorial covers. If there is some more thorough documentation, please point me in the right direction.

Outcomes