1、增加增强过滤算法剔除坏点
This commit is contained in:
parent
0d1ddfb8c5
commit
8646c8b700
@ -10,6 +10,7 @@ public class GnssGroupCalc {
|
|||||||
Integer filter_hour;
|
Integer filter_hour;
|
||||||
Float xy_threshold;
|
Float xy_threshold;
|
||||||
Float z_threshold;
|
Float z_threshold;
|
||||||
|
Boolean adv_filter;
|
||||||
Boolean auto_filter;
|
Boolean auto_filter;
|
||||||
Integer filter_min_hour;
|
Integer filter_min_hour;
|
||||||
Float auto_threshold;
|
Float auto_threshold;
|
||||||
|
|||||||
@ -33,7 +33,6 @@ public class GNSSCalcFilterService {
|
|||||||
static final float XY_THRESHOLD = 30; //水平异常点30mm
|
static final float XY_THRESHOLD = 30; //水平异常点30mm
|
||||||
static final float Z_THRESHOLD = 30; //高程异常点30mm
|
static final float Z_THRESHOLD = 30; //高程异常点30mm
|
||||||
static final float AUTO_THRESHOLD = 50; //触发自适应滤波的门限50mm
|
static final float AUTO_THRESHOLD = 50; //触发自适应滤波的门限50mm
|
||||||
static final double MIN_CHANGE = 0.01;
|
|
||||||
|
|
||||||
static class VaryFilterCycle{
|
static class VaryFilterCycle{
|
||||||
public LocalDateTime startTime;
|
public LocalDateTime startTime;
|
||||||
@ -64,7 +63,7 @@ public class GNSSCalcFilterService {
|
|||||||
|
|
||||||
// 平滑处理
|
// 平滑处理
|
||||||
calcFilterLocation(locationRecord, filterCycle, groupCalc.getFilter_min_hour(),
|
calcFilterLocation(locationRecord, filterCycle, groupCalc.getFilter_min_hour(),
|
||||||
groupCalc.getXy_threshold(), groupCalc.getZ_threshold());
|
groupCalc.getXy_threshold(), groupCalc.getZ_threshold(), groupCalc.getAdv_filter());
|
||||||
|
|
||||||
repository.insert(locationRecord);
|
repository.insert(locationRecord);
|
||||||
|
|
||||||
@ -93,7 +92,7 @@ public class GNSSCalcFilterService {
|
|||||||
* 计算东北天的最近融合数据的加权平均, 刘畅20230725 copy 自 avgEND; id>20, 滤波参数6h 或 25h
|
* 计算东北天的最近融合数据的加权平均, 刘畅20230725 copy 自 avgEND; id>20, 滤波参数6h 或 25h
|
||||||
*/
|
*/
|
||||||
public boolean calcFilterLocation(GnssCalcData newRecord, int filterCycleHour, int minCycleHour,
|
public boolean calcFilterLocation(GnssCalcData newRecord, int filterCycleHour, int minCycleHour,
|
||||||
float xyThreshold, float zThreshold){
|
float xyThreshold, float zThreshold, boolean isAdvFilter){
|
||||||
String deviceId = newRecord.getDeviceid();
|
String deviceId = newRecord.getDeviceid();
|
||||||
// 选取[newRecordTime-filterCycleHour, newRcordTime]之间的记录做平滑
|
// 选取[newRecordTime-filterCycleHour, newRcordTime]之间的记录做平滑
|
||||||
// 如果这个时间段的记录数少于FILTER_MIN_RECORD_NUM,本次不做平滑
|
// 如果这个时间段的记录数少于FILTER_MIN_RECORD_NUM,本次不做平滑
|
||||||
@ -125,11 +124,16 @@ public class GNSSCalcFilterService {
|
|||||||
newRecord.setEnabled(false); //记录为坏点,下次不参与滤波
|
newRecord.setEnabled(false); //记录为坏点,下次不参与滤波
|
||||||
logger.info(deviceId + " abnormal gnss data");
|
logger.info(deviceId + " abnormal gnss data");
|
||||||
}
|
}
|
||||||
else if (Math.abs(newRecord.getB562e() - record0.getB562e()) < MIN_CHANGE &&
|
else if(isAdvFilter){
|
||||||
Math.abs(newRecord.getB562n() - record0.getB562n()) < MIN_CHANGE &&
|
GnssCalcData record1 = null;
|
||||||
Math.abs(newRecord.getB562d() - record0.getB562d()) < MIN_CHANGE) {
|
if(gnssDeviceLocationRecords.size()>1) record1 = gnssDeviceLocationRecords.get(1);
|
||||||
newRecord.setEnabled(false); //如果两次解算结果相等,数据有被冻住的嫌疑,记录为坏点,下次不参与滤波
|
if(record1 == null ||
|
||||||
logger.info(deviceId + " abnormal gnss data");
|
Math.abs(newRecord.getB562e() - record1.getB562e()) > xyThreshold*2 ||
|
||||||
|
Math.abs(newRecord.getB562n() - record1.getB562n()) > xyThreshold*2 ||
|
||||||
|
Math.abs(newRecord.getB562d() - record1.getB562d()) > zThreshold*2) {
|
||||||
|
newRecord.setEnabled(false); //记录为坏点,下次不参与滤波
|
||||||
|
logger.info(deviceId + " abnormal gnss data by adv filter");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// 求本组和最近recordNum组原始值的平均值
|
// 求本组和最近recordNum组原始值的平均值
|
||||||
@ -234,7 +238,7 @@ public class GNSSCalcFilterService {
|
|||||||
List<GnssCalcData> calcDataListToUpdate = repository.selectList(query);
|
List<GnssCalcData> calcDataListToUpdate = repository.selectList(query);
|
||||||
for(GnssCalcData calcData:calcDataListToUpdate){
|
for(GnssCalcData calcData:calcDataListToUpdate){
|
||||||
calcFilterLocation(calcData, groupCalc.getFilter_hour(), groupCalc.getFilter_min_hour(),
|
calcFilterLocation(calcData, groupCalc.getFilter_hour(), groupCalc.getFilter_min_hour(),
|
||||||
groupCalc.getXy_threshold(), groupCalc.getZ_threshold());
|
groupCalc.getXy_threshold(), groupCalc.getZ_threshold(), groupCalc.getAdv_filter());
|
||||||
repository.updateById(calcData);
|
repository.updateById(calcData);
|
||||||
lastTime = calcData.getCreatetime();
|
lastTime = calcData.getCreatetime();
|
||||||
logger.info(deviceId + " update rpos");
|
logger.info(deviceId + " update rpos");
|
||||||
|
|||||||
@ -77,6 +77,7 @@ CREATE TABLE IF NOT EXISTS `gnssgroupcalc` (
|
|||||||
`filter_hour` int DEFAULT NULL COMMENT '平滑窗口',
|
`filter_hour` int DEFAULT NULL COMMENT '平滑窗口',
|
||||||
`xy_threshold` float DEFAULT NULL COMMENT '坏点水平门限',
|
`xy_threshold` float DEFAULT NULL COMMENT '坏点水平门限',
|
||||||
`z_threshold` float DEFAULT NULL COMMENT '坏点垂直门限',
|
`z_threshold` float DEFAULT NULL COMMENT '坏点垂直门限',
|
||||||
|
`adv_filter` bit(1) DEFAULT 0 COMMENT '增强坏点剔除',
|
||||||
`auto_filter` bit(1) DEFAULT 0,
|
`auto_filter` bit(1) DEFAULT 0,
|
||||||
`filter_min_hour` int DEFAULT NULL COMMENT '最小平滑窗口',
|
`filter_min_hour` int DEFAULT NULL COMMENT '最小平滑窗口',
|
||||||
`auto_threshold` float DEFAULT NULL,
|
`auto_threshold` float DEFAULT NULL,
|
||||||
|
|||||||
@ -146,6 +146,7 @@
|
|||||||
{field: 'filter_hour', title: '滤波周期(小时)'},
|
{field: 'filter_hour', title: '滤波周期(小时)'},
|
||||||
{field: 'xy_threshold', title: '水平异常门限(mm)'},
|
{field: 'xy_threshold', title: '水平异常门限(mm)'},
|
||||||
{field: 'z_threshold', title: '垂直异常门限(mm)'},
|
{field: 'z_threshold', title: '垂直异常门限(mm)'},
|
||||||
|
{field: 'adv_filter', title: '增强异常过滤', templet: "<div>{{d.adv_filter==1?'启用':'禁用'}}</div>"},
|
||||||
{field: 'auto_filter', title: '自适应滤波', templet: "<div>{{d.auto_filter==1?'启用':'禁用'}}</div>"},
|
{field: 'auto_filter', title: '自适应滤波', templet: "<div>{{d.auto_filter==1?'启用':'禁用'}}</div>"},
|
||||||
{field: 'filter_min_hour', title: '最小滤波周期'},
|
{field: 'filter_min_hour', title: '最小滤波周期'},
|
||||||
{field: 'auto_threshold', title: '触发门限(mm)'},
|
{field: 'auto_threshold', title: '触发门限(mm)'},
|
||||||
|
|||||||
@ -41,6 +41,15 @@
|
|||||||
<input type="number" name="z_threshold" id="z_threshold" lay-verify="required" lay-reqtext="不能为空" class="layui-input">
|
<input type="number" name="z_threshold" id="z_threshold" lay-verify="required" lay-reqtext="不能为空" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label">增强异常过滤</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<select name="adv_filter" id="adv_filter" lay-filter="adv_filter">
|
||||||
|
<option value="0">禁用</option>
|
||||||
|
<option value="1">启用</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">自适应滤波</label>
|
<label class="layui-form-label">自适应滤波</label>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
@ -119,6 +128,7 @@
|
|||||||
$('#filter_hour').val(data.filter_hour);
|
$('#filter_hour').val(data.filter_hour);
|
||||||
$('#xy_threshold').val(data.xy_threshold);
|
$('#xy_threshold').val(data.xy_threshold);
|
||||||
$('#z_threshold').val(data.z_threshold);
|
$('#z_threshold').val(data.z_threshold);
|
||||||
|
$('#adv_filter').val(data.adv_filter?'1':'0');
|
||||||
$('#auto_filter').val(data.auto_filter?'1':'0');
|
$('#auto_filter').val(data.auto_filter?'1':'0');
|
||||||
$('#filter_min_hour').val(data.filter_min_hour);
|
$('#filter_min_hour').val(data.filter_min_hour);
|
||||||
$('#auto_threshold').val(data.auto_threshold);
|
$('#auto_threshold').val(data.auto_threshold);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user