* @param jsonObject JSON object containing item information
* @return item information
* @throws JSONException if accessing JSON object fails
*/
public ESRI_ItemInformation toItemInfo(JSONObject jsonObject) throws JSONException {
ESRI_ItemInformation itemInfo = new ESRI_ItemInformation();
itemInfo.setId(jsonObject.getString("id"));
itemInfo.setTitle(jsonObject.getString("title"));
itemInfo.setDescription(jsonObject.getString("description"));
itemInfo.setSnippet(jsonObject.getString("snippet"));
itemInfo.setUrl(jsonObject.getString("url"));
itemInfo.setOwner(jsonObject.getString("owner"));
itemInfo.setAccess(jsonObject.getString("access"));
itemInfo.setCulture(jsonObject.getString("culture"));
itemInfo.setType(jsonObject.getString("type"));
itemInfo.setTypeKeywords(makeListFromJsonArray(jsonObject.getJSONArray("typeKeywords")));
itemInfo.setTags(makeListFromJsonArray(jsonObject.getJSONArray("tags")));
JSONArray extentArray = jsonObject.getJSONArray("extent");
if (extentArray!=null && extentArray.length()==2) {
String [] lowerCorner = Val.chkStr(extentArray.getJSONArray(0).toString()).replaceAll("^\\[|\\]$", "").split(",");
String [] upperCorner = Val.chkStr(extentArray.getJSONArray(1).toString()).replaceAll("^\\[|\\]$", "").split(",");
double minx = -180, miny = -90, maxx = 180, maxy = 90;
if (lowerCorner!=null && lowerCorner.length==2) {
minx = Val.chkDbl(lowerCorner[0], minx);
miny = Val.chkDbl(lowerCorner[1], miny);
}
if (upperCorner!=null && upperCorner.length==2) {
maxx = Val.chkDbl(upperCorner[0], maxx);
maxy = Val.chkDbl(upperCorner[1], maxy);
}
itemInfo.setExtent(new Envelope(minx, miny, maxx, maxy));
}
String sModifiedDate = Val.chkStr(jsonObject.getString("modified"));
itemInfo.setModifiedDate(formatDate(sModifiedDate));
return itemInfo;
}