fix: 修改在线多线数据在点击开始采集后程序崩溃的问题,原因为未针对此类型数据为POIEntity赋代表点X和Y值
This commit is contained in:
@@ -9,8 +9,8 @@ android {
|
|||||||
applicationId "com.navinfo.outdoor"
|
applicationId "com.navinfo.outdoor"
|
||||||
minSdkVersion 22
|
minSdkVersion 22
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 13
|
versionCode 14
|
||||||
versionName "8.220128"
|
versionName "8.220308"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
lintOptions {
|
lintOptions {
|
||||||
@@ -97,7 +97,7 @@ dependencies {
|
|||||||
//三级选择
|
//三级选择
|
||||||
implementation 'com.airsaid.library:pickerview:1.0.3'
|
implementation 'com.airsaid.library:pickerview:1.0.3'
|
||||||
//省市区 https://github.com/Bigkoo/Android-PickerView
|
//省市区 https://github.com/Bigkoo/Android-PickerView
|
||||||
compile 'com.contrarywind:Android-PickerView:4.1.6'
|
implementation 'com.contrarywind:Android-PickerView:4.1.6'
|
||||||
implementation 'com.contrarywind:Android-PickerView:4.1.8'
|
implementation 'com.contrarywind:Android-PickerView:4.1.8'
|
||||||
/*加载html
|
/*加载html
|
||||||
implementation 'com.github.sendtion:XRichText:1.9.4'
|
implementation 'com.github.sendtion:XRichText:1.9.4'
|
||||||
|
|||||||
@@ -393,21 +393,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
chargingStationEntity.setGeoWkt(stationBean.getGeo());
|
chargingStationEntity.setGeoWkt(stationBean.getGeo());
|
||||||
String encodeStr = stationBean.getGeo();
|
String encodeStr = stationBean.getGeo();
|
||||||
String geo = Geohash.getInstance().decode(encodeStr);
|
String geo = Geohash.getInstance().decode(encodeStr);
|
||||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
// 生成对应的x和y poiEntity.setX
|
||||||
switch (geometry.getGeometryType()) {
|
GeometryTools.obitainPoiEntityXY(geo, chargingStationEntity);
|
||||||
case "Point": //点
|
|
||||||
LatLng latLng = GeometryTools.createLatLng(geo);
|
|
||||||
chargingStationEntity.setX(latLng.longitude + "");
|
|
||||||
chargingStationEntity.setY(latLng.latitude + "");
|
|
||||||
break;
|
|
||||||
case "LineString": //线
|
|
||||||
case "Polygon": //面
|
|
||||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
|
||||||
assert latLineString != null;
|
|
||||||
chargingStationEntity.setX(latLineString.get(0).longitude + "");
|
|
||||||
chargingStationEntity.setY(latLineString.get(0).latitude + "");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
//充电桩
|
//充电桩
|
||||||
List<ReceivedBean.BodyBean.CsTaskListBean> csTaskList = response.getBody().getCsTaskList();
|
List<ReceivedBean.BodyBean.CsTaskListBean> csTaskList = response.getBody().getCsTaskList();
|
||||||
if (csTaskList != null && !csTaskList.isEmpty()) {
|
if (csTaskList != null && !csTaskList.isEmpty()) {
|
||||||
@@ -521,21 +508,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
polygonEntity.setGeoWkt(listBean.getGeo());
|
polygonEntity.setGeoWkt(listBean.getGeo());
|
||||||
String encodeStr = listBean.getGeo();
|
String encodeStr = listBean.getGeo();
|
||||||
String geo = Geohash.getInstance().decode(encodeStr);
|
String geo = Geohash.getInstance().decode(encodeStr);
|
||||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
// 生成对应的x和y poiEntity.setX
|
||||||
switch (geometry.getGeometryType()) {
|
GeometryTools.obitainPoiEntityXY(geo, polygonEntity);
|
||||||
case "Point": //点
|
|
||||||
LatLng latLng = GeometryTools.createLatLng(geo);
|
|
||||||
polygonEntity.setX(latLng.longitude + "");
|
|
||||||
polygonEntity.setY(latLng.latitude + "");
|
|
||||||
break;
|
|
||||||
case "LineString": //线
|
|
||||||
case "Polygon": //面
|
|
||||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
|
||||||
assert latLineString != null;
|
|
||||||
polygonEntity.setX(latLineString.get(0).longitude + "");
|
|
||||||
polygonEntity.setY(latLineString.get(0).latitude + "");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
polygonEntity.setTaskStatus(1);
|
polygonEntity.setTaskStatus(1);
|
||||||
}
|
}
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@@ -816,21 +790,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
poiListEntity.setGeoWkt(listBean.getGeo());
|
poiListEntity.setGeoWkt(listBean.getGeo());
|
||||||
String encodeStr = listBean.getGeo();
|
String encodeStr = listBean.getGeo();
|
||||||
String geo = Geohash.getInstance().decode(encodeStr);
|
String geo = Geohash.getInstance().decode(encodeStr);
|
||||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
// 生成对应的x和y poiEntity.setX
|
||||||
switch (geometry.getGeometryType()) {
|
GeometryTools.obitainPoiEntityXY(geo, poiListEntity);
|
||||||
case "Point": //点
|
|
||||||
LatLng latLng = GeometryTools.createLatLng(geo);
|
|
||||||
poiListEntity.setX(latLng.longitude + "");
|
|
||||||
poiListEntity.setY(latLng.latitude + "");
|
|
||||||
break;
|
|
||||||
case "LineString": //线
|
|
||||||
case "Polygon": //面
|
|
||||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
|
||||||
assert latLineString != null;
|
|
||||||
poiListEntity.setX(latLineString.get(0).longitude + "");
|
|
||||||
poiListEntity.setY(latLineString.get(0).latitude + "");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (statusId == 1 || statusId == 5) {
|
if (statusId == 1 || statusId == 5) {
|
||||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
||||||
}
|
}
|
||||||
@@ -946,21 +907,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
poiListEntity.setGeoWkt(listBean.getGeo());
|
poiListEntity.setGeoWkt(listBean.getGeo());
|
||||||
String encodeStr = listBean.getGeo();
|
String encodeStr = listBean.getGeo();
|
||||||
String geo = Geohash.getInstance().decode(encodeStr);
|
String geo = Geohash.getInstance().decode(encodeStr);
|
||||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
// 生成对应的x和y poiEntity.setX
|
||||||
switch (geometry.getGeometryType()) {
|
GeometryTools.obitainPoiEntityXY(geo, poiListEntity);
|
||||||
case "Point": //点
|
|
||||||
LatLng latLng = GeometryTools.createLatLng(geo);
|
|
||||||
poiListEntity.setX(latLng.longitude + "");
|
|
||||||
poiListEntity.setY(latLng.latitude + "");
|
|
||||||
break;
|
|
||||||
case "LineString": //线
|
|
||||||
case "Polygon": //面
|
|
||||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
|
||||||
assert latLineString != null;
|
|
||||||
poiListEntity.setX(latLineString.get(0).longitude + "");
|
|
||||||
poiListEntity.setY(latLineString.get(0).latitude + "");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (statusId == 1 || statusId == 5) {
|
if (statusId == 1 || statusId == 5) {
|
||||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2100,21 +2100,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
poiListEntity.setIsExclusive(listBean.getIsExclusive());
|
poiListEntity.setIsExclusive(listBean.getIsExclusive());
|
||||||
String beanGeo = listBean.getGeo();
|
String beanGeo = listBean.getGeo();
|
||||||
String geo = Geohash.getInstance().decode(beanGeo);
|
String geo = Geohash.getInstance().decode(beanGeo);
|
||||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
// 生成对应的x和y poiEntity.setX
|
||||||
switch (geometry.getGeometryType()) {
|
GeometryTools.obitainPoiEntityXY(geo, poiListEntity);
|
||||||
case "Point": //点
|
|
||||||
LatLng lng = GeometryTools.createLatLng(geo);
|
|
||||||
poiListEntity.setX(lng.longitude + "");
|
|
||||||
poiListEntity.setY(lng.latitude + "");
|
|
||||||
break;
|
|
||||||
case "LineString": //线
|
|
||||||
case "Polygon": //面
|
|
||||||
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
|
||||||
assert latLineString != null;
|
|
||||||
poiListEntity.setX(latLineString.get(0).longitude + "");
|
|
||||||
poiListEntity.setY(latLineString.get(0).latitude + "");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (isBack) {
|
if (isBack) {
|
||||||
initMarker(poiListEntity, true);
|
initMarker(poiListEntity, true);
|
||||||
switch (poiListEntity.getType()) {
|
switch (poiListEntity.getType()) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.navinfo.outdoor.util;
|
|||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
import com.vividsolutions.jts.geom.Coordinate;
|
import com.vividsolutions.jts.geom.Coordinate;
|
||||||
import com.vividsolutions.jts.geom.Geometry;
|
import com.vividsolutions.jts.geom.Geometry;
|
||||||
@@ -1162,4 +1163,28 @@ public class GeometryTools {
|
|||||||
private static boolean isEmpty(String str) {
|
private static boolean isEmpty(String str) {
|
||||||
return str == null || str.trim().equals("");
|
return str == null || str.trim().equals("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据geometry的string生成PoiEntity的代表点经纬度x和y
|
||||||
|
* */
|
||||||
|
public static void obitainPoiEntityXY(String geo, PoiEntity poiEntity) {
|
||||||
|
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||||
|
switch (geometry.getGeometryType()) {
|
||||||
|
case "Point": //点
|
||||||
|
LatLng lng = GeometryTools.createLatLng(geo);
|
||||||
|
poiEntity.setX(lng.longitude + "");
|
||||||
|
poiEntity.setY(lng.latitude + "");
|
||||||
|
break;
|
||||||
|
case "LineString": //线
|
||||||
|
case "MultiLineString": // 多线
|
||||||
|
case "Polygon": //面
|
||||||
|
case "MultiPolygon": //多面
|
||||||
|
case "MultiPoint": //多点
|
||||||
|
List<LatLng> latLineString = GeometryTools.getLatLags(geo);
|
||||||
|
assert latLineString != null;
|
||||||
|
poiEntity.setX(latLineString.get(0).longitude + "");
|
||||||
|
poiEntity.setY(latLineString.get(0).latitude + "");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,12 +114,12 @@
|
|||||||
6.3 本软件依据参与者的活动基本不同,设置不同的奖励标准、结算和支付方式,参与者须按照相应的奖励标准、结算和支付方式完成奖励兑现操作。\n\n
|
6.3 本软件依据参与者的活动基本不同,设置不同的奖励标准、结算和支付方式,参与者须按照相应的奖励标准、结算和支付方式完成奖励兑现操作。\n\n
|
||||||
6.4 参与者可以选择奖励支付,活动参与者兑现奖励后,本软件将从参与者的活动帐号中扣除相应奖励。如参与者的活动帐号奖励不足,兑现申请自动失效。\n\n
|
6.4 参与者可以选择奖励支付,活动参与者兑现奖励后,本软件将从参与者的活动帐号中扣除相应奖励。如参与者的活动帐号奖励不足,兑现申请自动失效。\n\n
|
||||||
6.5 如您作为图新授权的代理帐号参与本活动,您不能向您发展的本软件用户做出任何超出本条款内容的承诺或许可,否则由您自行承担该等承诺或许可导致的后果。\n\n
|
6.5 如您作为图新授权的代理帐号参与本活动,您不能向您发展的本软件用户做出任何超出本条款内容的承诺或许可,否则由您自行承担该等承诺或许可导致的后果。\n\n
|
||||||
6.6 您理解并同意,图新仅按照本条款内容向您兑现有关奖励,除本条款外,高德未向您做出任何其他承诺和许可,因信任其他承诺和许可而导致的任何损失由您自行承担或
|
6.6 您理解并同意,图新仅按照本条款内容向您兑现有关奖励,除本条款外,图新未向您做出任何其他承诺和许可,因信任其他承诺和许可而导致的任何损失由您自行承担或
|
||||||
向相应责任人主张。\n\n
|
向相应责任人主张。\n\n
|
||||||
|
|
||||||
七、通知和送达\n\n
|
七、通知和送达\n\n
|
||||||
7.1 您在此同意,图新关于本软件、本活动。本条款内容变化的所有通知均可以通过本软件界面、微信公众/服务号公告等方式进行。\n\n
|
7.1 您在此同意,图新关于本软件、本活动。本条款内容变化的所有通知均可以通过本软件界面、微信公众/服务号公告等方式进行。\n\n
|
||||||
7.2 上述通知于公布或发送之日起即视为已送达收件人(及您)。您有责任通过上述方式查看任何此类通知。\\n\nn
|
7.2 上述通知于公布或发送之日起即视为已送达收件人(及您)。您有责任通过上述方式查看任何此类通知。\n\n
|
||||||
|
|
||||||
八、知识产权\n\n
|
八、知识产权\n\n
|
||||||
8.1.本活动、软件以及相关内容的一切版权、商标权、专利权、商业秘密等知识产权,均受中华人民共和国著作权法、商标法、专利法、
|
8.1.本活动、软件以及相关内容的一切版权、商标权、专利权、商业秘密等知识产权,均受中华人民共和国著作权法、商标法、专利法、
|
||||||
|
|||||||
Reference in New Issue
Block a user