Question

FeatureReader problems...

  • 17 April 2019
  • 1 reply
  • 1 view

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"?


1 reply

Badge +6

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

Reply