Skip to main content
Question

FeatureReader problems...

  • April 17, 2019
  • 1 reply
  • 20 views

I am writing data to a JSON file to get it in proper JSON format for later use of a Web API using HTTPCaller.

The "records" in the JSON file seems to be separated like this:

"description" : ""

}

}, (is this CORRECT separation of JSON features?)

{

"json_featuretype" : "NewFeatureType",

When reading the file later using FeatureReader, I get the expected number of "records". However, the resulting JSON textdata contains all the JSON data for all the records, every time a new record is read. This means, I get a lot of equal database records created in stead of individual records. Any ideas on how to get the right part of JSON data from each "reading"?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, 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.

1 reply

deanatsafe
Safer
Forum|alt.badge.img+6
  • Safer
  • 136 replies
  • April 22, 2019

Yes - comma is a valid element separator. The problem is likely what constitutes a logical record may not obviously map to a default or auto reader setting on the JSON reader. Because of its nested, object oriented structure, if you select a read node too high in the object tree, you may get multiple elements read per feature (usually as lists). To query the JSON at the right node in the tree, likely the tree control is required in this case.

For more information on how to work with JSON and configure the JSON reader, see:

https://knowledge.safe.com/articles/39188/tutorial-getting-started-with-json.html and

https://knowledge.safe.com/articles/42273/json-reader-configuration.html