feat: 杆状物、交通面板3D化测试
This commit is contained in:
@@ -2234,10 +2234,18 @@
|
||||
</m>
|
||||
</m>
|
||||
<m v="OMDB_AREA">
|
||||
<area use="water"></area>
|
||||
<area use="water" repeat="true" src="assets:omdb/area_test.jpg" stroke="#ff0000" stroke-width="2"></area>
|
||||
</m>
|
||||
<m k="type" v="s_2_e">
|
||||
<line use="s2e" />
|
||||
</m>
|
||||
|
||||
<m v="OMDB_POLE">
|
||||
<line stroke="#0000ff" width="0.1" cap="butt"></line>
|
||||
</m>
|
||||
|
||||
<m v="OMDB_TRAFFIC_SIGN">
|
||||
<area use="water" repeat="false" stroke="#ff0000" stroke-width="2"></area>
|
||||
</m>
|
||||
</m>
|
||||
</rendertheme>
|
||||
@@ -19,6 +19,7 @@ import org.locationtech.jts.geom.MultiPolygon;
|
||||
import org.locationtech.jts.geom.Point;
|
||||
import org.locationtech.jts.geom.Polygon;
|
||||
import org.oscim.core.MapElement;
|
||||
import org.oscim.core.MercatorProjection;
|
||||
import org.oscim.core.Tag;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.tiling.ITileDataSink;
|
||||
@@ -139,8 +140,9 @@ public class OMDBDataDecoder extends TileDecoder {
|
||||
private void processCoordinateArray(Coordinate[] coordinates, boolean removeLast) {
|
||||
int length = removeLast ? coordinates.length - 1 : coordinates.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
double z = longitudeToX(MercatorProjection.pixelXToLongitudeWithScale(MercatorProjection.metersToPixelsWithScale((float) coordinates[i].z, coordinates[i].y, mTileScale), mTileScale))* mTileScale/8;
|
||||
mMapElement.addPoint((float) ((longitudeToX(coordinates[i].x) - mTileX) * mTileScale),
|
||||
(float) ((latitudeToY(coordinates[i].y) - mTileY) * mTileScale), (float)coordinates[i].z);
|
||||
(float) ((latitudeToY(coordinates[i].y) - mTileY) * mTileScale), (float) coordinates[i].z);
|
||||
}
|
||||
|
||||
// int length = removeLast ? coordinates.length - 1 : coordinates.length;
|
||||
|
||||
@@ -139,6 +139,8 @@ public class OMDBReferenceDecoder extends TileDecoder {
|
||||
private void processCoordinateArray(Coordinate[] coordinates, boolean removeLast) {
|
||||
int length = removeLast ? coordinates.length - 1 : coordinates.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
// 将Z坐标的米转换为屏幕像素坐标
|
||||
// double z = longitudeToX(MercatorProjection.pixelXToLongitudeWithScale(MercatorProjection.metersToPixelsWithScale((float) coordinates[i].z, coordinates[i].y, mTileScale), mTileScale))* mTileScale/8;
|
||||
mMapElement.addPoint((float) ((longitudeToX(coordinates[i].x) - mTileX) * mTileScale),
|
||||
(float) ((latitudeToY(coordinates[i].y) - mTileY) * mTileScale), (float)coordinates[i].z);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user