156 {
157 int pc = roi.PointsD.Count;
158 if (roi.PointsD.Last() != roi.PointsD.First())
159 pc = roi.PointsD.Count + 1;
160 GeoJsonPolygon g = new GeoJsonPolygon();
161 double[][][] dds = new double[1][][];
162 double[][] ds = new double[pc][];
163 for (int i = 0; i < pc; i++)
164 {
165 if (i >= roi.PointsD.Count)
166 {
167 PointD po = b.ToImageSpace(roi.PointsD[0]);
168 ds[i] = new double[2] { (int)po.X, (int)po.Y };
169 }
170 else
171 {
172 PointD po = b.ToImageSpace(roi.PointsD[i]);
173 ds[i] = new double[2] { (int)po.X, (int)po.Y };
174 }
175 }
176
177 dds[0] = ds;
178 g.coordinates = dds;
179 g.type = "Polygon";
180 g.plane = new GeoJsonPlane();
181 g.plane.z = roi.coord.Z;
182 g.plane.c = roi.coord.C;
183 g.plane.t = roi.coord.T;
184 return g;
185 }