title: Create custom JSON string from JSON
body: <p>I have an external JSON file and for internal use in the web application I have to create a custom and separte JSON string with all selected objects in the main JSON from the external Server.</p>
  
  <p>the output string should look like this, but with more objects:</p>
  
  <pre><code>{"geometry": {"type": "Point", "coordinates": [78.454, 22.643]}, "type": "Feature", "properties": {}}
  </code></pre>
  
  <p>the jquery code to create the string looks like this:</p>
  
  <pre><code>$.getJSON(getshowObjectReportExtern, function(data) {
  $.each(data, function(key, value) {
  
  // loop html table
  
  }   
  
  var llrealTimeObj = {
  geometry: {
      type: 'FeatureCollection',
      features: [
          { // loop from here
          type: 'Feature',
          geometry: {
              type: 'Point',
              coordinates: [ value.latitude_mdeg, value.longitude_mdeg]
              },
          properties: {
              Number: value.objectno,
              Plate: value.objectname,
              Location: value.postext_short
              }
          }, // till there
      ]
    }
  }
  
  
  var llrealTimeJSONString = JSON.stringify(llrealTimeObj);
      console.log(llrealTimeJSONString);
  
  });
  </code></pre>
  
  <p>to create the string for each single object works fine, but for now the problem is, that I don't know how to create a single string which contains all selected objects from the external JSON.</p>
  
  <p>has anybody any advice for me? thanks in advance!</p>
  
  <p>edit:
  the final output should look similar like this, but with the objects from my main JSON file.</p>
  
  <pre><code>{
   "type": "FeatureCollection",
   "features": [
      {
        "type": "Feature",
    "geometry": {
      "type": "Point",
      "coordinates": [
        -22.054688930511475,
        29.53522956294847
      ]
    },
    "properties": {}
  },
  {
    "type": "Feature",
    "geometry": {
      "type": "Point",
      "coordinates": [
        -22.933595180511475,
        19.642587534013032
      ]
    },
    "properties": {}
  },
  {
    "type": "Feature",
    "geometry": {
      "type": "Point",
      "coordinates": [
        -25.394532680511475,
        28.76765910569123
      ]
    },
    "properties": {}
  }
    ]
  }
  </code></pre>
  
  <p>link to the online editor: <a href="https://google-developers.appspot.com/maps/documentation/utils/geojson/" rel="nofollow noreferrer">https://google-developers.appspot.com/maps/documentation/utils/geojson/</a></p>