Skip to main content
Question

Can I change the default formats read by the Generic Reader?

  • November 23, 2017
  • 5 replies
  • 29 views

Forum|alt.badge.img

Hi all,

I'm using the Generic Reader to read incoming data that can be one of several data formats, including GeoJSON. The problem I'm having is it seems the Generic Reader defaults to Esri JSON for files with a .json extension. This causes the workspace to fail because the GeoJSON data structure coming in is different from what is expected by the Esri JSON reader used by the Generic Reader for .json files. Is there a way I can change the defaults on the Generic Reader or do I have to modify the extension of the incoming file to .geojson?

Thanks

Rob

5 replies

david_r
Evangelist
  • November 23, 2017

I suspect you'll have to rename the file, at least I don't know of any other way.

Personally I've moved away completely from the Generic reader and now only use a TestFilter followed by a FeatureReader for each format that I'm supporting.

I find that a lot more flexible and easier to maintain (less guesswork), even though it does clutter the workspace a bit.


Forum|alt.badge.img
  • Author
  • November 23, 2017
david_r wrote:

I suspect you'll have to rename the file, at least I don't know of any other way.

Personally I've moved away completely from the Generic reader and now only use a TestFilter followed by a FeatureReader for each format that I'm supporting.

I find that a lot more flexible and easier to maintain (less guesswork), even though it does clutter the workspace a bit.

Thanks David

 

I think I'll take your suggestion. It's a nice idea having one reader for all and does make for a less cluttered workspace but I've found the Generic Reader fiddly to work with too. I'd prefer not to change the extension anyway...I've never seen a geojson with a .geojson extension.

 

 

 


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • November 23, 2017

If you are using a featureReader set to the Generic format, if you go into the parameters, you change change the setting from <Guess format name from extension> to point to an attribute containing the name of the desired format.

 

 

I use it in a scenario where I can accept 15 different formats, and the testFilter/specific reader scenario was becoming cumbersome.

Forum|alt.badge.img
  • Author
  • November 24, 2017
jdh wrote:

If you are using a featureReader set to the Generic format, if you go into the parameters, you change change the setting from <Guess format name from extension> to point to an attribute containing the name of the desired format.

 

 

I use it in a scenario where I can accept 15 different formats, and the testFilter/specific reader scenario was becoming cumbersome.
Great suggestion @jdh, I'll give it a try. Thanks.

 


helmoet
Forum|alt.badge.img+8
  • July 12, 2019

There goes flexibility... I'm running into a strange message from the generic reader that interprets a .json file as CESIUM3DTILES, which is not what I want. @fmelizard?


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