Skip to main content
Solved

Need to convert ESRI data into JSON

  • February 7, 2025
  • 3 replies
  • 97 views

fme_can_do_it
Enthusiast
Forum|alt.badge.img+9

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!

Best answer by frro

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 :)

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

crutledge
Enthusiast
Forum|alt.badge.img+30
  • Enthusiast
  • February 10, 2025

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.


frro
Contributor
Forum|alt.badge.img+13
  • Contributor
  • Best Answer
  • February 10, 2025

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 :)


fme_can_do_it
Enthusiast
Forum|alt.badge.img+9
  • Author
  • Enthusiast
  • February 12, 2025

@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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings