Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

TechGiant
2012-02-01 13:47:41

Can you please share the screenshot for the XML tree for tWriteJSONField components?

sagarkohli01
2012-02-01 10:42:59

forgot to attach screen shot smile, pls find it.

sagarkohli01
2012-01-31 17:00:04

Hi,

Thanks for the response, basically i am using "tWriteJSONField" to create json objects.
it works good first time but when i tried to use it in chain all values other than o/p of first "tWriteJSONField" becomes "null".

pls find attached screen shot of the job.

saravanadel
2012-01-31 16:46:19

Can you tell what issue you are facing ?

I would probably use java/groovy Code comp. to create and format the Json model you are expecting.

Csv input ->filter rows based on id-> execute java code to create Json str->store temp result in buffer .

sagarkohli01
2012-01-31 13:21:48

Hi,

I have a csv file having structure like

id, latitude, longitude
1,lat1,long1
1,lat2,long2
2,lat1,long1
3,lat1,long1
1,lat3,long3

here id is vehicle id and latitude and longitude are the coordinates of the vehicle. I want to produce a json file having structure like

{
   "geometry": {       
       "coordinates": [
           [
               lat1,
               long1
           ],
           [
               lat2,
               long2
           ]
           [
               lat3,
               long3
           ]
       ]
   },
   "properties":{
        "id": "1"
   }
}
{
   "geometry": {       
       "coordinates": [
           [
               lat1,
               long1
           ]           
       ]
   },
   "properties":{
        "id": "2"
   }
}

{
   "geometry": {       
       "coordinates": [
           [
               lat3,
               long3
           ]           
       ]
   },
   "properties":{
        "id": "3"
   }
}

I have completed most of the part, but the main issue i am facing is creation of  following '2D' array of vehicle co-ordinates.

           [
               lat1,
               long1
           ],
           [
               lat2,
               long2
           ]
           [
               lat3,
               long3
           ]
       ]

Any pointer will be a great help smile.

Regards
Sagar

Board footer

Powered by FluxBB