src/java/m/timeseries/insert/V1_0.java
@@ -75,9 +75,11 @@ |
String data_col = getStringParam("data_column", null); |
JSONObject metadata = getJSONParam("metadata"); |
String date_fmt = getStringParam("date_format"); |
- JSONArray locationArray = getJSONArrayParam("location"); |
- List<Double> location = Arrays.asList(Double.parseDouble(locationArray.get(0).toString()), Double.parseDouble(locationArray.get(1).toString())); |
- |
+ JSONArray locationArray = getJSONArrayParam("location", null); |
+ List<Double> location = null; |
+ if (locationArray != null) { |
+ location = Arrays.asList(Double.parseDouble(locationArray.get(0).toString()), Double.parseDouble(locationArray.get(1).toString())); |
+ } |
run(mongo_uri, mongo_collection, doc_id, data_file, data_col, metadata, date_fmt, location, LOG); |
} |
|
test/service_tests/m/query/V1_0/query-objectid-req.json
@@ -5,7 +5,7 @@ |
"value": "mongodb://eds0.engr.colostate.edu:27017/csip_timeseries" |
}, { |
"name": "mongo_collection", |
- "value": "colab test series" |
+ "value": "test_coll" |
}, { |
"name": "start_date", |
"description": "Start date of query. If not provided, then entire period of record will be returned", |
@@ -20,51 +20,7 @@ |
"value": false |
}, { |
"name": "search_id", |
- "value": "5b786b2bee2a960001661499" |
- }, { |
- "name": "search_feature", |
- "description": "Limit search to a polygon. If not provided, then all locations are returned.", |
- "value": { |
- "type": "FeatureCollection", |
- "features": [ |
- { |
- "geometry": { |
- "type": "MultiPolygon", |
- "coordinates": [ |
- [ |
- [ |
- [ |
- -105.09928580027, |
- 40.701406829918 |
- ], |
- [ |
- -105.09447928172, |
- 40.365324016903 |
- ], |
- [ |
- -104.72849722611, |
- 40.358522384503 |
- ], |
- [ |
- -104.72437735306, |
- 40.701927386425 |
- ], |
- [ |
- -105.09928580027, |
- 40.701406829918 |
- ] |
- ] |
- ] |
- ] |
- }, |
- "type": "Feature", |
- "properties": { |
- "gid": 1, |
- "name": "gid 1" |
- } |
- } |
- ] |
- } |
+ "value": "no_loc" |
} |
] |
} |
\ No newline at end of file |