JSONArray lineStrings = geometryObj.getJSONArray("coordinates");
if( null == lineStrings ) {
throw new Exception("A geometry must contain an array called 'coordinates'");
}
MultiLineString multiLineString = new MultiLineString();
for(int lsIndex=0,lsEnd=lineStrings.length(); lsIndex<lsEnd; ++lsIndex){
JSONArray points = lineStrings.getJSONArray(lsIndex);
LineString lineString = new LineString();
for(int pointIndex=0,pointEnd=points.length(); pointIndex<pointEnd; ++pointIndex){
JSONArray coordinates = points.getJSONArray(pointIndex);
Point point = new Point();
for(int coordIndex=0,coordEnd=coordinates.length(); coordIndex<coordEnd; ++coordIndex){
double position = coordinates.getDouble(coordIndex);
point.addPosition(position);
}
lineString.addPoint(point);
}
multiLineString.addLineString(lineString);
}
return multiLineString;
} catch(Exception e) {