public static TwitterBoundingBox Parse(JsonObject obj)
        {
            // Check whether "obj" is NULL
            if (obj == null)
            {
                return(null);
            }

            // Get the array
            JsonArray coordinates = obj.GetArray("coordinates");

            // Initialize the bounding box
            TwitterBoundingBox boundingBox = new TwitterBoundingBox {
                Type        = obj.GetString("type"),
                Coordinates = new TwitterCoordinates[coordinates.Length][]
            };

            // Parse the coordinates
            for (int i = 0; i < coordinates.Length; i++)
            {
                boundingBox.Coordinates[i] = TwitterCoordinates.ParseMultiple(coordinates.GetArray(i));
            }

            // Return the building box
            return(boundingBox);
        }
Beispiel #2
0
 public static TwitterCoordinates[] ParseMultiple(JsonArray array)
 {
     if (array == null)
     {
         return(new TwitterCoordinates[0]);
     }
     TwitterCoordinates[] temp = new TwitterCoordinates[array.Length];
     for (int i = 0; i < array.Length; i++)
     {
         temp[i] = Parse(array.GetArray(i));
     }
     return(temp);
 }