增加车道中心线扩充面业务
This commit is contained in:
@@ -1587,12 +1587,12 @@
|
||||
|
||||
<!--车道中心线-->
|
||||
<m v="OMDB_LANE_LINK_LG">
|
||||
<m k="width" v="~">
|
||||
<line stroke="#7A88A0" width="2.8" />
|
||||
<!--
|
||||
<line stroke="#7A88A0" width="2.5" />
|
||||
-->
|
||||
<m k="widthProperties">
|
||||
<area use="obj-area" stroke="#7A88A0" repeat="true" src="assets:omdb/icon_5001_1.png" longEdge="t"></area>
|
||||
</m>
|
||||
<!-- <m k="width" v="~">
|
||||
<line stroke="#4624FF" width="0.1" />
|
||||
</m>-->
|
||||
</m>
|
||||
|
||||
<!-- 检查点 -->
|
||||
|
||||
BIN
collect-library/src/main/assets/omdb/icon_5001_1.png
Normal file
BIN
collect-library/src/main/assets/omdb/icon_5001_1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
@@ -2,6 +2,7 @@ package com.navinfo.collect.library.utils;
|
||||
|
||||
import android.graphics.Point;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import org.locationtech.jts.geom.Coordinate;
|
||||
@@ -13,6 +14,8 @@ import org.locationtech.jts.geom.MultiPoint;
|
||||
import org.locationtech.jts.geom.MultiPolygon;
|
||||
import org.locationtech.jts.geom.Polygon;
|
||||
import org.locationtech.jts.io.WKTReader;
|
||||
import org.locationtech.jts.operation.buffer.BufferOp;
|
||||
import org.locationtech.jts.operation.buffer.BufferParameters;
|
||||
import org.locationtech.jts.operation.linemerge.LineMerger;
|
||||
import org.oscim.core.GeoPoint;
|
||||
import org.oscim.core.MercatorProjection;
|
||||
@@ -1505,6 +1508,28 @@ public class GeometryTools {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param distLeft 单位km
|
||||
* @param distRight 单位km
|
||||
* @param wkt 几何
|
||||
* @return
|
||||
*/
|
||||
public static String computeLine(Double distLeft,Double distRight,String wkt){
|
||||
if(!TextUtils.isEmpty(wkt)){
|
||||
Geometry lineString1 = GeometryTools.createGeometry(wkt);
|
||||
BufferParameters parameters1 = new BufferParameters();
|
||||
parameters1.setEndCapStyle(BufferParameters.CAP_FLAT);
|
||||
parameters1.setSingleSided(true);
|
||||
|
||||
Geometry buffer = BufferOp.bufferOp(lineString1, distLeft, parameters1);
|
||||
Geometry buffer2 = BufferOp.bufferOp(lineString1, -distRight, parameters1);
|
||||
String bufferWkt = buffer.union(buffer2).toString();
|
||||
Log.e("qj",bufferWkt);
|
||||
return bufferWkt;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static FootAndDistance pointToLineDistance(GeoPoint point, Geometry geometry) {
|
||||
//定义垂线
|
||||
FootAndDistance pointPairDistance = new FootAndDistance(point);
|
||||
|
||||
Reference in New Issue
Block a user