优化数据安装效率,更换第三方库
This commit is contained in:
@@ -108,6 +108,7 @@ open class RenderEntity() : RealmObject(), Parcelable {
|
||||
@Index
|
||||
var linkPid: String = "" // RenderEntity关联的linkPid集合(可能会关联多个)
|
||||
var linkRelation: LinkRelation? = null
|
||||
var referenceEntitys: RealmSet<ReferenceEntity>? = RealmSet()//
|
||||
|
||||
constructor(name: String) : this() {
|
||||
this.name = name
|
||||
|
||||
@@ -4,10 +4,13 @@ import static org.oscim.core.MercatorProjection.latitudeToY;
|
||||
import static org.oscim.core.MercatorProjection.longitudeToX;
|
||||
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.navinfo.collect.library.data.entity.RenderEntity;
|
||||
import com.navinfo.collect.library.enums.DataCodeEnum;
|
||||
import com.navinfo.collect.library.utils.GeometryTools;
|
||||
|
||||
import org.locationtech.jts.geom.Coordinate;
|
||||
import org.locationtech.jts.geom.Geometry;
|
||||
@@ -103,7 +106,14 @@ public class OMDBDataDecoder extends TileDecoder {
|
||||
processCoordinateArray(multiPoint.getGeometryN(i).getCoordinates(), false);
|
||||
}
|
||||
} else if (geometry instanceof LineString) {
|
||||
processLineString((LineString) geometry);
|
||||
//将车道中心进行转化面渲染
|
||||
if(layerName!=null&&layerName.equals(DataCodeEnum.OMDB_LANE_LINK_LG.name())){
|
||||
Log.e("qj","车道中心线转化开始");
|
||||
processPolygon((Polygon) GeometryTools.createGeometry(GeometryTools.computeLine(0.000035,0.000035,geometry.toString())));
|
||||
Log.e("qj","车道中心线转化结束");
|
||||
}else{
|
||||
processLineString((LineString) geometry);
|
||||
}
|
||||
} else if (geometry instanceof MultiLineString) {
|
||||
MultiLineString multiLineString = (MultiLineString) geometry;
|
||||
for (int i = 0; i < multiLineString.getNumGeometries(); i++) {
|
||||
|
||||
@@ -71,25 +71,35 @@ public class DeflaterUtil{
|
||||
|
||||
deflater.finish();
|
||||
|
||||
final byte[] bytes = new byte[256];
|
||||
final byte[] bytes = new byte[512];
|
||||
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(256);
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(512);
|
||||
|
||||
while (!deflater.finished()) {
|
||||
try {
|
||||
|
||||
//压缩输入数据并用压缩数据填充指定的缓冲区。
|
||||
while (!deflater.finished()) {
|
||||
|
||||
int length = deflater.deflate(bytes);
|
||||
//压缩输入数据并用压缩数据填充指定的缓冲区。
|
||||
|
||||
outputStream.write(bytes, 0, length);
|
||||
int length = deflater.deflate(bytes);
|
||||
|
||||
outputStream.write(bytes, 0, length);
|
||||
|
||||
}
|
||||
|
||||
deflater.end();
|
||||
|
||||
return Base64.encodeBase64String(outputStream.toByteArray());
|
||||
|
||||
}catch (Exception e){
|
||||
return null;
|
||||
}finally {
|
||||
try {
|
||||
outputStream.close();
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
deflater.end();
|
||||
|
||||
return Base64.encodeBase64String(outputStream.toByteArray());
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,9 +118,9 @@ public class DeflaterUtil{
|
||||
|
||||
inflater.setInput(decode);
|
||||
|
||||
final byte[] bytes = new byte[256];
|
||||
final byte[] bytes = new byte[512];
|
||||
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(256);
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(512);
|
||||
|
||||
try {
|
||||
|
||||
@@ -150,6 +160,12 @@ public class DeflaterUtil{
|
||||
|
||||
return null;
|
||||
|
||||
}finally {
|
||||
try {
|
||||
outputStream.close();
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user