Skip to main content
Dear All , 

 

 

I use geometry replace to convert json to feature , but it doesn't work it give an error , I tried geojson and esrijson both give an error , below is the json text which stored in a feature class . 

 

 

{

 

    "geometryType": "esriGeometryPolygon",

 

    "hasZ": false,

 

    "hasM": false,

 

    "features": &

 

        {

 

            "geometry": {

 

                "rings": p

 

                     

 

                        Â

 

                            6055422.478793681,

 

                            2809493.0711957584

 

                        ],

 

                        4

 

                            6055818.269231402,

 

                            2809235.807411239

 

                        ],

 

                         

 

                            6055646.760041723,

 

                            2808978.5436267196

 

                        ],

 

                         

 

                            6055293.8469014205,

 

                            2808998.333148606

 

                        ],

 

                        Â

 

                            6055211.390560228,

 

                            2809206.12312841

 

                        ],

 

                         

 

                            6055422.478793681,

 

                            2809493.0711957584

 

                        ]

 

                    ]

 

                ]

 

            },

 

            "attributes": {

 

                "GraphicType": "ProposedPlot",

 

                "IsSaved": "False"

 

            }

 

        }

 

    ]

 

}
Hi,

 

 

I copied your json adn paste it to a txt file. I read it with esrijson and get a 5 sided ploygon...no errors.

 

How have u stored this json object?
Thanks GIO , We are storing the features in to SQL server within ntext attribute 
I read that ntext is a single variable length string.

 

I made it one string and removed all spaces. It still works fine.

 

 

 

Maybe one or more json objects have a character count wich is too long for the field written too?

 

(i understand that the format definition is written ntext(n) where n is legth)

 

You could do a character count to see wath max. legth is of json objects.

 

 

You could go for nvarchar instead of ntext? Wich is what everyone advises.

 

ntext seems to be a depricated format btw.
Hi,

 

 

you can use this to count characters

 

use a creator to make

 

char_count = @Evaluate(allength gsplit @Value(col0) {}]])

 


Hi , 

 

 

It is not a problem of charcter length , I tried it for the record I sent and still I am getting an error . Thanks , 
Hi,

 

 

I myself have no practical experience on JSON, but possibly the JSONFragmenter transformer with this query helps you to extract geometry objects from the full JSON document.

 

-----

 

JSON Query: jsonj"features"]
  • ]"geometry"]

     

    -----

     

     

    Takashi
  • Then maybe a faulty object (json incorrect) is in the dataset?

     

     

    The only way i get it to yield an error is by remoinge somee brace, bracket or other punctuation mark so it can't parse it no more...

    Reply