Skip to main content

hello! I am currently working on an API integration project. My task involves reading data stored in an ArcSDE geodatabase, selecting specific data, and posting it to a website. The website accepts data in JSON format, which should follow a specific structure:

{

  "type": "Feature",

  "properties": {

    "id": <id>,

    "name": <name>

  },

  "geometry": {

    "type": "<geometry_type>",

    "coordinates": <coordinates>

  }

}

I read data from ArcSDE geodatabase and the option that converts data into the format above is GeoJSON writer. however, this writer saves the GeoJSON file to a directory, which I do not want. Instead, I need to convert the data into the required JSON format using a transformer, Extract specific parts like geometry and property from the JSON format that can connect with an HTTP caller to POST the data. I'm not sure which transformer would be suitable for generating the desired output. I would greatly appreciate any advice or help! Thanks!

I think you are close. If you use the featurewriter to write into the desired format you can read it back in and work from there. you can also jazz it up a bit with temppathnamecreators and writing out to temp space.
Question of the Week: The TempPathnameCreator and how it helps us read JPEG exif tags | Community

Hope this helps.


Hi

I would do it like:

  1. GeometryExtractor - pull the geometry to GeoJSON
  2. JSON Templater - construct the complete JSON 
  3. HTTPCaller - fire the JSON on the Api-Endpoint

Adding some screens

Workspace
Construct desired JSON from attributes
Shoot JSON on Api

Hope that helps :)


@frro  Thanks! I applied the same approach to construct the JSON. However, when I routed the formatted JSON to the body, I encountered a 500 Internal Server Error. I also changed the workspace and attempted to upload the body through the text editor, but it still didn’t work. It’s strange because the data works perfectly in another application and successfully generates a response.