|
@@ -8,7 +8,9 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.locationtech.jts.geom.Coordinate;
|
|
|
import org.locationtech.jts.geom.Geometry;
|
|
|
import org.locationtech.jts.io.ParseException;
|
|
|
+import org.locationtech.jts.io.WKBReader;
|
|
|
import org.locationtech.jts.io.WKTReader;
|
|
|
+import org.locationtech.jts.io.WKTWriter;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
|
import javax.imageio.ImageIO;
|
|
@@ -309,6 +311,7 @@ public class ShapeUtils {
|
|
|
|
|
|
private static void drawShape(ShapeStyle shapeStyle, Map<String, Object> poi, double[] bbox, Graphics2D graphics, String shapeKey) {
|
|
|
// Geometry shape = GeoUtils.getGeoUtils().createGeometry(poi.get(shapeKey));
|
|
|
+
|
|
|
Geometry shape;
|
|
|
try {
|
|
|
shape = WKT_READER.read(poi.get(shapeKey).toString());
|
|
@@ -320,6 +323,16 @@ public class ShapeUtils {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static Geometry convertWKBtoGeometry(byte[] wkbBytes) {
|
|
|
+ WKBReader reader = new WKBReader();
|
|
|
+ try {
|
|
|
+ return reader.read(wkbBytes);
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static BufferedImage drawImage(String bboxStr, List<Map<String, Object>> dataList, String shapeKey, List<LayerStyleView> layerStyleViews) {
|
|
|
BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_ARGB);
|
|
|
renderShape(image, bboxStr, dataList, getShapeStyle(layerStyleViews), shapeKey);
|