package com.sysu.admin.utils.shape.vo;

import lombok.Data;
import org.locationtech.jts.geom.Coordinate;

@Data
public class PolygonVo {
    public PolygonVo(){}
    public PolygonVo(Coordinate[] coordinates, String type){
        this.type = type;
        this.coordinates = new double[1][][];
        double[][] doubles = new double[coordinates.length][];
        for(int i=0;i< coordinates.length ;i++){
            double[] coordinate = new double[2];
            coordinate[0] = coordinates[i].getX();
            coordinate[1] = coordinates[i].getY();
            doubles[i] = coordinate;
        }
        this.coordinates[0] = doubles;
    }


    private String type;
    private double[][][] coordinates;

}
