| | |
| | | } |
| | | |
| | | public int getCount(String token, SeDb db, SeLayer layer) { |
| | | Map<String, Object> map = new HashMap<>(4); |
| | | Map<String, Object> map = new HashMap<>(6); |
| | | map.put("token", token); |
| | | map.put("dbid", db.getDbid()); |
| | | map.put("bbox", db.getBbox()); |
| | | map.put("layerid", layer.getId()); |
| | | map.put("returnCountOnly", true); |
| | | map.put("inSR", 4326); |
| | | |
| | | JSONObject obj = restTemplate.postForObject(host + "geo-service/entitydbdata/layer/query", map, JSONObject.class); |
| | | if (null == obj || 200 != obj.getInt("code")) return 0; |
| | |
| | | } |
| | | |
| | | public JSONArray query(String token, SeDb db, SeLayer layer, int start, int count) { |
| | | Map<String, Object> map = new HashMap<>(8); |
| | | Map<String, Object> map = new HashMap<>(9); |
| | | map.put("token", token); |
| | | map.put("start", start); |
| | | map.put("count", count); |
| | |
| | | map.put("containCount", false); |
| | | map.put("layerid", layer.getId()); |
| | | map.put("querytype", layer.getQueryType()); |
| | | map.put("inSR", 4326); |
| | | |
| | | JSONObject obj = restTemplate.postForObject(host + "geo-service/entitydbdata/layer/query", map, JSONObject.class); |
| | | if (null == obj || 200 != obj.getInt("code")) return null; |
| | | |
| | | JSONObject data = obj.getJSONObject("data"); |
| | | |
| | | return data.getJSONArray("items"); |
| | | return data.getJSONArray("features"); |
| | | } |
| | | } |