| | |
| | | * @param ids 元数据ID集合 |
| | | * @return 元数据文件集合 |
| | | */ |
| | | public List<MetaEntity> selectMetaFiles(List<Integer> ids); |
| | | public List<MetaEntity> selectMetaFiles(String ids); |
| | | |
| | | /** |
| | | * 查询Excel元数据 |
| | |
| | | continue; |
| | | } |
| | | |
| | | String field = convertFiled(str.substring(0, start).trim()); |
| | | String field = camelToUnderline(str.substring(0, start).trim()); |
| | | String express = str.substring(start + 1, end).trim().toLowerCase(); |
| | | String value = str.substring(end + 1).trim(); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 字段转换 |
| | | * 驼峰转换为下划线 |
| | | */ |
| | | private String convertFiled(String field) { |
| | | public static String camelToUnderline(String str) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (int i = 0, c = field.length(); i < c; i++) { |
| | | char ch = field.charAt(i); |
| | | for (int i = 0, c = str.length(); i < c; i++) { |
| | | char ch = str.charAt(i); |
| | | if (Character.isUpperCase(ch)) { |
| | | sb.append('_'); |
| | | sb.append(Character.toLowerCase(ch)); |
| | | sb.append('_').append(Character.toLowerCase(ch)); |
| | | } else { |
| | | sb.append(ch); |
| | | } |
| | | } |
| | | |
| | | return sb.toString().replaceAll("_+", "_"); |
| | | } |
| | | |
| | | /** |
| | | * 下划线转换为驼峰 |
| | | */ |
| | | public static String underlineToCamel(String str) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | |
| | | boolean nextIsCapitalized = false; |
| | | for (int i = 0, c = str.length(); i < c; i++) { |
| | | char ch = str.charAt(i); |
| | | if (ch == '_') { |
| | | nextIsCapitalized = true; |
| | | continue; |
| | | } |
| | | if (nextIsCapitalized) { |
| | | sb.append(Character.toUpperCase(ch)); |
| | | nextIsCapitalized = false; |
| | | } else { |
| | | sb.append(Character.toLowerCase(c)); |
| | | } |
| | | } |
| | | |
| | | return sb.toString(); |
| | | } |
| | | |
| | |
| | | return metaMapper.selectByIdsForTab(ids); |
| | | } |
| | | |
| | | @Override |
| | | public List<MetaEntity> selectMetaFiles(List<Integer> ids) { |
| | | return metaMapper.selectMetaFiles(StringHelper.join(ids, StaticData.COMMA)); |
| | | } |
| | | |
| | | @Override |
| | | public List<MetaEntity> selectMetaFiles(String ids) { |
| | | return metaMapper.selectMetaFiles(ids); |
| | | } |
| | | |
| | |
| | | for (int j = 1; j <= bandCount; j++) { |
| | | double[] pixelValues = new double[1]; |
| | | ds.GetRasterBand(j).ReadRaster(xPixel, yPixel, 1, 1, pixelValues); |
| | | if (!Double.isNaN(pixelValues[0])) { |
| | | if (isValid(pixelValues[0])) { |
| | | vals.add(WebHelper.round(pixelValues[0], 3)); |
| | | } |
| | | } |
| | |
| | | for (Integer x : xList) { |
| | | for (Integer y : yList) { |
| | | ds.GetRasterBand(i).ReadRaster(x, y, 1, 1, pixelValues); |
| | | if (!Double.isNaN(pixelValues[0])) { |
| | | if (isValid(pixelValues[0])) { |
| | | list.add(pixelValues[0]); |
| | | } |
| | | } |
| | |
| | | |
| | | List<Double> list = new ArrayList<>(); |
| | | for (double val : pixelValues) { |
| | | if (!Double.isNaN(val)) { |
| | | if (isValid(val)) { |
| | | list.add(val); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 值是否有效 |
| | | */ |
| | | public static boolean isValid(Double val) { |
| | | return !Double.isNaN(val) && val > Integer.MIN_VALUE; |
| | | } |
| | | |
| | | /** |
| | | * 设置Band值 |
| | | */ |
| | | private void setBandVals(AnalysisResultEntity entity, List<Double> list) { |
| | |
| | | <select id="selectMetaFiles" resultType="com.moon.server.entity.data.MetaEntity"> |
| | | select a.*, fn_uname(a.create_user) createName, fn_uname(a.update_user) updateName, fn_get_fullname(a.depcode, 1) depName, fn_ver(a.verid) verName, fn_get_fullname(a.dircode, 2) dirName |
| | | from lf.sys_meta a |
| | | where id in |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | where id in (#{ids}) or guid in (select guid from lf.sys_meta where type = 'gdb' and id in (#{ids})) |
| | | order by a.id desc |
| | | </select> |
| | | |