Skip to content

Commit 96decf4

Browse files
committed
Remove underscore; Order geometries decending; Change calc for grid #53 #42
1 parent fbdfb60 commit 96decf4

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

BExIS.Pmm.Model/Plotchart.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ private SharpMap.Map InitializeMap(Size outputsize, Plot plot, int zoom = 1, boo
497497
if (!beyondPlot)
498498
map = AddGridToMap(map, plot, zoom, beyondPlot, gridSize);
499499

500-
500+
plot.Geometries = plot.Geometries.OrderByDescending(p => p.Geometry.Length).ToList();
501501

502502
foreach (var geometry in plot.Geometries)
503503
{
@@ -523,23 +523,23 @@ private SharpMap.Map InitializeMap(Size outputsize, Plot plot, int zoom = 1, boo
523523
if(geometry.GeometryType.Equals("rectangle"))
524524
{
525525
string[] xy = geometry.Coordinate.Split(',');
526-
newRow["Label"] = xy[2] + "," + xy[3] + " _";
526+
newRow["Label"] = xy[2] + "," + xy[3];
527527
}
528528

529529
if (geometry.GeometryType.Equals("polygon"))
530530
{
531531
string[] tmpXY = geometry.Coordinate.Split(new[] { "),(" }, StringSplitOptions.None);
532532
string[] x = tmpXY[0].Split(',');
533533
string[] y = tmpXY[1].Split(',');
534-
newRow["Label"] = x[2] + "," + y[2] + " _";
534+
newRow["Label"] = x[2] + "," + y[2];
535535
}
536536
if (geometry.GeometryType.Equals("linestring"))
537537
{
538538
string[] tmpXY = geometry.Coordinate.Split(new[] { "),(" }, StringSplitOptions.None);
539539
string[] x = tmpXY[0].Split(',');
540540
string[] y = tmpXY[1].Split(',');
541541

542-
newRow["Label"] = x[0].Substring(1) + "," + y[0] + " _";
542+
newRow["Label"] = x[0].Substring(1) + "," + y[0];
543543
}
544544

545545
if (geometry.GeometryType.Equals("circle"))
@@ -798,10 +798,10 @@ private SharpMap.Map AddGridToMap(SharpMap.Map map, Plot plot, int zoom, bool be
798798
SharpMap.Layers.VectorLayer areaLayer = new SharpMap.Layers.VectorLayer("area");
799799
double[] bb = { Convert.ToDouble(plot.Longitude), Convert.ToDouble(plot.Latitude) };
800800

801-
float X1 = (float)Math.Round(((plot.Geometry.EnvelopeInternal.MinX - bb[0]) * 108800)); //plot.Area.X1 * 1.2f;
802-
X1 = Convert.ToInt32(X1) / gridSize * gridSize;
803-
float X2 = (float)Math.Round(((plot.Geometry.EnvelopeInternal.MaxX - bb[0]) * 108800)); //plot.Area.X3 * 1.2f;
804-
X2 = Convert.ToInt32(X2) / gridSize * gridSize;
801+
float X1 = (float)Math.Round(((plot.Geometry.EnvelopeInternal.MinX - bb[0]) * 100000)); //plot.Area.X1 * 1.2f;
802+
X1 = Convert.ToInt32(X1) / 10 * 10;
803+
float X2 = (float)Math.Round(((plot.Geometry.EnvelopeInternal.MaxX - bb[0]) * 100000)); //plot.Area.X3 * 1.2f;
804+
X2 = Convert.ToInt32(X2) / 10 * 10;
805805
float Y1 = X1; //plot.Area.Y1 * 1.2f;
806806
float Y2 = X2; //plot.Area.Y3 * 1.2f;
807807
if (beyondPlot)

0 commit comments

Comments
 (0)