Skip to main content
Solved

How can i store _Packed attribute by AttributejSonPacker?

  • September 20, 2017
  • 5 replies
  • 25 views

Forum|alt.badge.img

Hi,

How can i store _packed attributes which is having multiple attributes packed by AttributejSonPacker?

Can i store that _packed attribute as BLOB type attribute in File Geodatabase?

Thanks in advance.

Best answer by david_r

Here's a small workspace that demonstrates reading and writing JSON-packed attributes to a text attribute in a file geodatabase.

Disable either one of the bookmarks to test either reading or writing to the fgdb (don't leave both enabled).

attributejsonpacker.fmwt

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.

5 replies

david_r
Celebrity
  • September 20, 2017

Since JSON is text, the easiest is just to store it in a text attribute.

You can store a maximum of 2,147,483,647 characters in a text attribute in a File Geodatabase, which I guess should be more than enough.


Forum|alt.badge.img
  • Author
  • September 20, 2017

Since JSON is text, the easiest is just to store it in a text attribute.

You can store a maximum of 2,147,483,647 characters in a text attribute in a File Geodatabase, which I guess should be more than enough.

Ok, and second part is i want to read that packed attributes in another workbench using AttributeJsonUnpacker followd by Filegeodatabase Reader.

 

How can i unpacked those attributes and use that as attr1, attr2, attr3 packed in _packed?

 

 


Forum|alt.badge.img
  • Author
  • September 20, 2017

Since JSON is text, the easiest is just to store it in a text attribute.

You can store a maximum of 2,147,483,647 characters in a text attribute in a File Geodatabase, which I guess should be more than enough.

Getting the following error while storing it as text.

 

 

Python Exception <ValueError>: end is out of bounds
Error encountered while calling function `unpackAttributes'
f_21(PythonFactory): PythonFactory failed to process feature

 

 


david_r
Celebrity
  • September 21, 2017
Getting the following error while storing it as text.

 

 

Python Exception <ValueError>: end is out of bounds
Error encountered while calling function `unpackAttributes'
f_21(PythonFactory): PythonFactory failed to process feature

 

 

That looks more like a Python error than a writer error. What are the values of attr1, attr2 and attr3?

david_r
Celebrity
  • Best Answer
  • September 21, 2017

Here's a small workspace that demonstrates reading and writing JSON-packed attributes to a text attribute in a file geodatabase.

Disable either one of the bookmarks to test either reading or writing to the fgdb (don't leave both enabled).

attributejsonpacker.fmwt