2025.10.21
修改高德地图地理逆编码结果,让地理位置信息更加详细
| | |
| | | var streetNumber:String? = null |
| | | // 处于该门牌号的方向 |
| | | var direction:String? = null |
| | | // 处于该门牌号的方向距离 |
| | | var distance: String? = null |
| | | // 所处最近交叉路口的方向和距离 |
| | | var roadinter:String? = null |
| | | // 所处最近交叉路口的距离 |
| | | var distance2: String? = null |
| | | |
| | | // 污染范围扇形区域(经纬度多边形) |
| | | var polygon: List<Pair<Double, Double>>? = null |
| | |
| | | this.street = address.street |
| | | this.streetNumber = address.streetNumber |
| | | this.direction = address.direction |
| | | this.distance = address.distance |
| | | this.roadinter = address.roadinter |
| | | this.distance2 = address.distance2 |
| | | Thread.sleep(100) |
| | | } catch (e: Exception) { |
| | | e.printStackTrace() |
| | |
| | | val streetNumber: String, |
| | | // 处于该门牌号的方向 |
| | | val direction:String, |
| | | // 所处最近交叉路口的方向和距离 |
| | | val roadinter: String, |
| | | // 处于该门牌号的方向距离 |
| | | val distance:String, |
| | | // 所处最近交叉路口的方向 |
| | | val roadinter: String?, |
| | | // 所处最近交叉路口的距离 |
| | | val distance2: String?, |
| | | ) |
| | | |
| | | data class AMapDirection( |
| | |
| | | getJsonString(streetNumber["street"]), |
| | | getJsonString(streetNumber["number"]), |
| | | getJsonString(streetNumber["direction"]), |
| | | // + streetNumber["distance"].asDouble.toInt() + "米", |
| | | if(roadinter == null) "" else getJsonString(roadinter.get("first_name")) +"和" + getJsonString(roadinter.get("second_name")) + "交叉口" |
| | | + getJsonString(roadinter.get("direction")) + getJsonString(roadinter.get("distance")) + "米", |
| | | getJsonString(streetNumber["distance"]), |
| | | if(roadinter == null) null else getJsonString(roadinter.get("first_name")) +"和" + getJsonString(roadinter.get("second_name")) + "交叉口" |
| | | + getJsonString(roadinter.get("direction")), |
| | | if(roadinter == null) null else getJsonString(roadinter["distance"]) |
| | | ) |
| | | } catch (e: Exception) { |
| | | val regeocode = obj["regeocode"].asJsonObject |