Alternative to If Statements for dynamic use - c#

I'm attempting to add a conditional test to the onpaint method using the Quantower API. While I'm not asking specific questions about that API, my query relates to the correct use for conditional tests.
What i'm trying to achieve is:
If current price is above a target price, draw a line;
if current price is above the line drawn in 1 above, draw another line; and so on.
At the moment, I have the code below (simplified for this post) which is nested if statements. What I was looking for was 1) is there a more efficient way of achieving the same result without nested if statements; and 2) how to make it dynamic (i.e. so its not limited to only 5 if statements and therefore 5 lines - if price increased significantly, 10 lines might need to be drawn)
double PTLevel = 10.5;
double PT1 = this.HighPrice.Value + PTLevel;
double PT2 = PT1 + PTLevel;
double PT3 = PT2 + PTLevel;
double PT4 = PT3 + PTLevel;
double PT5 = PT4 + PTLevel;
if (bar.Close > this.HighPrice.Value)
{
float PT1 = (float)this.CurrentChart.MainWindow.CoordinatesConverter.GetChartY(PT1);
graphics.DrawLine(Pen.Purple, X1, PT1, X2, PT1);
if (bar.Close > PT1)
{
float PT2 = (float)this.CurrentChart.MainWindow.CoordinatesConverter.GetChartY(PT2);
graphics.DrawLine(Pen.Purple, X1, PT2, X2, PT2);
if (bar.Close > PT2)
{
float PT3 = (float)this.CurrentChart.MainWindow.CoordinatesConverter.GetChartY(PT3);
graphics.DrawLine(Pen.Purple, X1, PT3, X2, PT3);
if (bar.Close > PT3)
{
float PT4 = (float)this.CurrentChart.MainWindow.CoordinatesConverter.GetChartY(PT4);
graphics.DrawLine(Pen.Purple, X1, PT4, X2, PT4);
if (bar.Close > PT4)
{
float PT5 = (float)this.CurrentChart.MainWindow.CoordinatesConverter.GetChartY(PT5);
graphics.DrawLine(Pen.Purple, X1, PT5, X2, PT5);
}
}
}
}
}

Xerillo's answer is good, but doesn't express the intent of your code.
This seems more what you are trying to do.
var pricePoint = HighPrice.Value;
while (bar.Close > pricePoint )
{
pricePoint += 10.5;
var y = CurrentChart.MainWindow.CoordinatesConverter.GetChartY(pricePoint);
graphics.DrawLine(Pen.Purple, X1, y, X2, y);
}
Do any casting if you deem necessary. Often it's not.

That's where loops come in handy. Put your prices in a list (in whichever order you need to check them in) and then loop through them updating the target whenever there's a higher value:
var prices = new [] { PT1, PT2, PT3, PT4, PT5 };
var currentTarget = this.HighPrice.Value;
foreach (var price in prices)
{
if (price > currentTarget)
{
currentTarget = this.CurrentChart
.MainWindow
.CoordinatesConverter
.GetChartY(price);
graphics.DrawLine(Pen.Purple, X1, currentTarget, X2, currentTarget);
}
}

Related

How to convert the following C++ code to C#

1. sort(arr1.begin(), arr1.end(), [](Point2f lhs, Point2f rhs) { return lhs.x<rhs.x; } );
2. sort(arr1.begin(), arr1.begin()+2, [](Point2f lhs, Point2f rhs) { return lhs.y<rhs.y; });
3. sort(arr1.begin()+2, arr1.end(), [](Point2f lhs, Point2f rhs) { return lhs.y<rhs.y; });
I'm attempting to sort an array of points (top-left --> bottom-left --> top-right --> bottom-right). I'd like to convert the above to C# but I'm unsure how to accomplish the above. I have done the following so far:
var sortedArr1 = arr1.OrderBy(r => r.X).ThenBy(r=>r.Y).ToList();
Which I believe accomplishes statements 1 and 2, but doesn't solve the last statement.
[EDIT]
Based on the comments below I have added a snippet from source code.
public List<Point2d> DetectCorners(Mat src)
{
var lines = src.HoughLines(1, Cv2.PI / 180, 50, 0, 0);
Mat labels = new Mat();
Mat centers = new Mat();
List<Point2f> data = new List<Point2f>();
for (uint i = 0; i < lines.Length; i++)
{
float rho = lines[i].Rho;
float theta = lines[i].Theta;
float x = rho * (float)Math.Cos(theta);
float y = rho * (float)Math.Sin(theta);
data.Add(new Point2f(x, y));
}
Cv2.Kmeans(InputArray.Create(data), 4, labels,
new TermCriteria(CriteriaType.Eps & CriteriaType.Count, 10, 1.0), 5, KMeansFlags.PpCenters, centers);
List<Point2f> fourPoints = new List<Point2f>();
List<Point2f> xyPoints = new List<Point2f>();
for (int i = 0; i < 4; i++)
{
float x = centers.At<float>(i, 0);
float y = centers.At<float>(i, 1);
float rho = (float)Math.Sqrt(x * x + y * y);
float theta = (float)Math.Atan2(y, x);
xyPoints.Add(new Point2f(x, y));
fourPoints.Add(new Point2f(rho, theta));
}
var sortedXyPoints = xyPoints.OrderBy(r => Math.Abs(r.Y / r.X)).ToArray();
List<Point2d> ans = new List<Point2d>();
for (uint i = 0; i < 2; i++)
{
float x0 = sortedXyPoints[i].X;
float y0 = sortedXyPoints[i].Y;
for (uint j = 2; j < 4; j++)
{
float x1 = sortedXyPoints[j].X;
float y1 = sortedXyPoints[j].Y;
float x = (y0 * (x1 * x1 + y1 * y1) - y1 * (x0 * x0 + y0 * y0)) / (y0 * x1 - x0 * y1);
float y = (x0 * (x1 * x1 + y1 * y1) - x1 * (x0 * x0 + y0 * y0)) / (y1 * x0 - x1 * y0);
ans.Add(new Point2d(x, y));
}
}
// order of points (top-left, bottom-left, top-right, bottom-right)
var sortedAns = ans.OrderBy(r => r.X).ThenBy(r=>r.Y).ToArray();
//TODO: convert sort(arr1.begin()+2, arr1.end(), [](Point2f lhs, Point2f rhs) { return lhs.y<rhs.y; }); to c#
return new List<Point2d>(sortedAns);
}
If you want to replicate the exact behavior you can use Array.Sort or List.Sort that takes a start and length of the range to sort. You will need to implement an IComparer<T> instead of using a delegate, but it is fairly trivial to make a implementation that takes a delegate to compare a property of the object. This should let you replicate the exact behavior:
public class KeyComparer<T, TKey> : IComparer<T> where TKey : IComparable<TKey>
{
private readonly Func<T, TKey> selector;
public KeyComparer(Func<T, TKey> selector) => this.selector = selector;
public int Compare(T x, T y) => selector(x).CompareTo(selector(y));
}
...
var xComparer = new KeyComparer<Point, float>(p => p.X);
var yComparer = new KeyComparer<Point, float>(p => p.Y);
myList.Sort(xComparer);
myList.Sort(0, 2, yComparer);
myList.Sort(2, myList.Length -2, yComparer);
However, I would be very hesitant to just use such a solution without understanding why this is done. I would see if I could find the description of the implemented algorithm, and see if that matches the implementation, or look for other implementations and see if they uses the same kind of sorting.
There is a useful tool for converting short snippets of codes like that.
Notice that the free edition limits output to 100 lines per file (no limit on the number of files).
visit:
https://www.tangiblesoftwaresolutions.com/product_details/cplusplus_to_csharp_converter_details.html

Function that calculates diffrent positions from an array c#

I have a problem that I need help solving. Im supposed to create a function that calculates the distance between two positions. The positions are stored in two arrays, I can use as many parameters that I need to do this calculation
static double[] Latitudes = new double[] {
59.3261917, 57.7010496, 59.8939529, 65.5867395, 60.11021, 52.5069312, 48.859
};
static double[] Longitudes = new double[] {
17.7018773, 11.6136602, 10.6450348, 22.0422998, 24.7385057, 13.1445521, 2.2069765
};
I have been given an equation that will help me calculate the distance
distance = Math.sqrt( (x1 - x2)2 + (y1 - y2)2 )
My problem is that I can't get the elements from the arrays to the variables inside the function
Extract methods, split you problem into minor ones:
// Initial step:
// Distance between points
private static double Distance(double x1, double y1, double x2, double y2) {
return Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
// Next step:
// Distance between points given as arrays' items indexes
private static double Distance(double[] xs, double[] ys, int indexFrom, indexTo) {
return Distance(xs[indexFrom], ys[indexFrom], xs[indexTo], ys[indexTo]);
}
Then use
// What is the distance between 0-th and 2-nd point?
double result = Distance(Latitudes, Longitudes, 0, 2);
Console.WriteLine(result);
// What is the distance between all the points?
for (int from = 0; from < Math.Min(Latitudes.Length, Longitudes.Length); ++from)
for (int to = from + 1; to < Math.Min(Latitudes.Length, Longitudes.Length); ++to) {
Console.WriteLine($"Distance from item #{from} to item #{to} is {Distance(Latitudes, Longitudes, from, to)}");
}
Well first you need to decide which positions you want to compare. This would be done by index. Lets says you want to compare positions at index 0 with positions at index 2. Then the code to get the correct variables would be:
double x1 = Latitudes[0];
double y1 = Longitudes[0];
double x2 = Latitudes[2];
double y2 = Longitudes[2];
You can then feed those values into your function. Your function code is wrong and won't compile. The correct call for the function would be:
double distance = Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2));
In the interest of providing a more complete function for your class, and keeping in mind that your arrays are static, this will allow you to get the distance from any two given points based on index. Also, I expect this is a homework assignment so I am leaning towards your requirement to be creating a function similar to this:
double CalculateDistance(int index1, int index2)
{
double x1 = Latitudes[index1];
double y1 = Longitudes[index1];
double x2 = Latitudes[index2];
double y2 = Longitudes[index2];
return Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2));
}
You can then call this function as follows:
double distance = CalculateDistance(0, 2);
Show distance for all pairs
if (Latitudes.Length == Longitudes.Length)
{
for (int i = 0; i < Latitudes.Length - 1; i = i + 2)
{
double x1 = Longitudes[i];
double x2 = Longitudes[i + 1];
double y1 = Latitudes[i];
double y2 = Latitudes[i + 1];
double distance = Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2));
Console.WriteLine($"x1 = {x1}; x2 = {x2}; y1 = {y1}; y2 = {y2}; distance {distance}");
}
}

Determine If Two Points Are Near

I have the following:
bool AreNear(Point Old, Point Current)
{
int x1 = Convert.ToInt32(Old.X);
int x2 = Convert.ToInt32(Current.X);
int y1 = Convert.ToInt32(Old.Y);
int y2 = Convert.ToInt32(Current.Y);
if (x1 == x2) {
if (y1 == y2) {
return true;
}
}
return false;
}
I want to return true in the function if the current point is in 25 pixels radius of the old point. Can anyone tell me how to do that?
You can use the Pythagorean formula to calculate the distance between two points. In C#:
var d = Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2))
Why does this work? Have a look at the following diagram and remember that a^2 + b^2 = c^2 holds for right triangles:
Just calculate the square of the distance using Pythagoras' theorem, and compare to the square of the radius:
bool ComparePoints(Point Old, Point Current)
{
int x1 = Convert.ToInt32(Old.X);
int x2 = Convert.ToInt32(Current.X);
int y1 = Convert.ToInt32(Old.Y);
int y2 = Convert.ToInt32(Current.Y);
int dx = x1 - x2;
int dy = y1 - y2;
return (dx*dx + dy*dy) < 25*25;
}
You can use Math.Abs to get the distance:
public static bool InDistance(Point Old, Point Current, int distance)
{
int diffX = Math.Abs(Old.X - Current.X);
int diffY = Math.Abs(Old.Y - Current.Y);
return diffX <= distance && diffY <= distance;
}
use it:
bool arePointsInDistance = InDistance(new Point(100, 120), new Point(120, 99), 25);
Try using the distance formula http://www.purplemath.com/modules/distform.htm and compare the distance <=25

Detect if circle A is completely inside circle B

Below is a function that detects if two circles intersect. I want to change it to only detect if the periferi of the circles intersect. Hence, if circle A is completely inside circle B, there is no collision!
How?
private bool IsCircleCollision(
int x1, int y1, int radius1,
int x2, int y2, int radius2)
{
int dx = x2 - x1;
int dy = y2 - y1;
int distance = (dx * dx) + (dy * dy);
int radii = radius1 + radius2;
if (distance < radii * radii)
{
return true;
}
else
{
return false;
}
}
You work this out by calculating the distance between the two centres, D say. There is an intersection if
abs(R1-R2) < D < R1+R2
where R1 and R2 are the radii of the two circles.
The first test, abs(R1-R2) < D handles the case when one circle's centre is inside the other's. And the second test, D < R1+R2, handles the case when neither circle contains the other's centre.
So, adapting your code we have:
private bool IsCircleCollision(
int x1, int y1, int radius1,
int x2, int y2, int radius2)
{
int dx = x2 - x1;
int dy = y2 - y1;
double D = Math.Sqrt(dx*dx + dy*dy);
return Math.Abs(radius1-radius2)<D && D<radius1+radius2;
}
If performance is important here, you can do without the call to Math.Sqrt like this:
private bool IsCircleCollision(
int x1, int y1, int radius1,
int x2, int y2, int radius2)
{
int dx = x2 - x1;
int dy = y2 - y1;
int Dsqr = dx*dx + dy*dy;
int rdiff = Math.Abs(radius1-radius2);
int rsum = radius1+radius2
return rdiff*rdiff<Dsqr && D<rsum*rsum;
}
The perimeters will be intersecting if and only if the distance between the two centers is less than or equal to the sum of the two radii but greater than or equal to their absolute difference. With this fact, it shouldn't be hard to re-write the function.
You could add a check to see if the distance + radius1 is less than radius2 or distance + radius2 is less than radius1, but then you'll need distance to be the actual distance rather than its square.
else if (Math.Sqrt(dx * dx + dy * dy) < Math.Abs(radius1 - radius2))

Calculating Area of Irregular Polygon in C#

I've managed to write a 'for dummies' how to calculate the area of irregular polygon in C#, but I need it to be dynamic for any amount of verticies.
Can someone please help?
Class:
public class Vertex
{
private int _vertexIdx;
private double _coordX;
private double _coordY;
private double _coordZ;
public Vertex()
{ }
public Vertex(int vertexIdx, double coordX, double coordY, double coordZ)
{
_vertexIdx = vertexIdx;
_coordX = coordX;
_coordY = coordY;
_coordZ = coordZ;
}
public int VertexIdx
{
get { return _vertexIdx; }
set { _vertexIdx = value; }
}
public double X
{
get { return _coordX; }
set { _coordX = value; }
}
public double Y
{
get { return _coordY; }
set { _coordY = value; }
}
public double Z
{
get { return _coordZ; }
set { _coordZ = value; }
}
}
Form_Load:
List<Vertex> verticies = new List<Vertex>();
verticies.Add(new Vertex(1, 930.9729, 802.8789, 0));
verticies.Add(new Vertex(2, 941.5341, 805.662, 0));
verticies.Add(new Vertex(3, 946.5828, 799.271, 0));
verticies.Add(new Vertex(4, 932.6215, 797.0548, 0));
dataGridView1.DataSource = verticies;
Code to calculate when button is pressed: (hard-coded for 4 points polygon - should be for any amount...)
// X-coords
double x1;
double x2;
double x3;
double x4;
double x5;
// Y-coords
double y1;
double y2;
double y3;
double y4;
double y5;
// Xn * Yn++
double x1y2;
double x2y3;
double x3y4;
double x4y5;
// Yn * Xn++
double y1x2;
double y2x3;
double y3x4;
double y4x5;
// XnYn++ - YnXn++
double x1y2my1x2;
double x2y3my2x3;
double x3y4my3x4;
double x4y5my4x5;
double result;
double area;
x1 = Convert.ToDouble(dataGridView1.Rows[0].Cells[1].Value.ToString());
y1 = Convert.ToDouble(dataGridView1.Rows[0].Cells[2].Value.ToString());
txtLog.Text += String.Format("X1 = {0}\tY1 = {1}\r\n", x1, y1);
x2 = Convert.ToDouble(dataGridView1.Rows[1].Cells[1].Value.ToString());
y2 = Convert.ToDouble(dataGridView1.Rows[1].Cells[2].Value.ToString());
txtLog.Text += String.Format("X2 = {0}\tY2 = {1}\r\n", x2, y2);
x3 = Convert.ToDouble(dataGridView1.Rows[2].Cells[1].Value.ToString());
y3 = Convert.ToDouble(dataGridView1.Rows[2].Cells[2].Value.ToString());
txtLog.Text += String.Format("X3 = {0}\tY3 = {1}\r\n", x3, y3);
x4 = Convert.ToDouble(dataGridView1.Rows[3].Cells[1].Value.ToString());
y4 = Convert.ToDouble(dataGridView1.Rows[3].Cells[2].Value.ToString());
txtLog.Text += String.Format("X4 = {0}\tY4 = {1}\r\n", x4, y4);
// add the start point again
x5 = Convert.ToDouble(dataGridView1.Rows[0].Cells[1].Value.ToString());
y5 = Convert.ToDouble(dataGridView1.Rows[0].Cells[2].Value.ToString());
txtLog.Text += String.Format("X5 = {0}\tY5 = {1}\r\n", x5, y5);
txtLog.Text += "\r\n";
// Multiply
x1y2 = x1 * y2;
x2y3 = x2 * y3;
x3y4 = x3 * y4;
x4y5 = x4 * y5;
y1x2 = y1 * x2;
y2x3 = y2 * x3;
y3x4 = y3 * x4;
y4x5 = y4 * x5;
// Subtract from each other
x1y2my1x2 = x1y2 - y1x2;
x2y3my2x3 = x2y3 - y2x3;
x3y4my3x4 = x3y4 - y3x4;
x4y5my4x5 = x4y5 - y4x5;
// Sum all results
result = x1y2my1x2 + x2y3my2x3 + x3y4my3x4 + x4y5my4x5;
area = Math.Abs(result / 2);
txtLog.Text += String.Format("Area = {0}\r\n", area);
Example output:
X1 = 930.9729
Y1 = 802.8789
X2 = 941.5341
Y2 = 805.662
X3 = 946.5828
Y3 = 799.271
X4 = 932.6215
Y4 = 797.0548
X5 = 930.9729
Y5 = 802.8789
Area = 83.2566504099523
Using lambda expressions this becomes trivial!
var points = GetSomePoints();
points.Add(points[0]);
var area = Math.Abs(points.Take(points.Count - 1)
.Select((p, i) => (points[i + 1].X - p.X) * (points[i + 1].Y + p.Y))
.Sum() / 2);
The algorithm is explained here:
[This method adds] the areas of the trapezoids defined by the polygon's edges dropped
to the X-axis. When the program considers a bottom edge of a polygon,
the calculation gives a negative area so the space between the polygon
and the axis is subtracted, leaving the polygon's area.
The total calculated area is negative if the polygon is oriented clockwise [so the] function simply returns the absolute value.
This method
gives strange results for non-simple polygons (where edges cross).
public float Area(List<PointF> vertices)
{
vertices.Add(vertices[0]);
return Math.Abs(vertices.Take(vertices.Count - 1).Select((p, i) => (p.X * vertices[i + 1].Y) - (p.Y * vertices[i + 1].X)).Sum() / 2);
}
Something like that for a plane polygon (compiled with notepad):
static double GetDeterminant(double x1, double y1, double x2, double y2)
{
return x1 * y2 - x2 * y1;
}
static double GetArea(IList<Vertex> vertices)
{
if(vertices.Count < 3)
{
return 0;
}
double area = GetDeterminant(vertices[vertices.Count - 1].X, vertices[vertices.Count - 1].Y, vertices[0].X, vertices[0].Y);
for (int i = 1; i < vertices.Count; i++)
{
area += GetDeterminant(vertices[i - 1].X, vertices[i - 1].Y, vertices[i].X, vertices[i].Y);
}
return area / 2;
}
Although your approach doesn't pay attention to Z-axis. Therefore I'd advice to apply some transformation to get rid of it: you won't be able to get area if the polygon is not plane, whereas if it is plane you are able to get rid of the third dimension.
I've found that when calculating the area for approx 600,000 polygons, the basic formulae shown above worked for some polygons, but a lot were out by a huge degree. I was spot checking my results against https://geojson.io/ - which returned correct results for very complex polygons with holes in them (e.g. lakes in the middle). In order to calculate the correct area for a complex polygon, I ended up using the same system that geojson.io uses - a client side js library Turf.js see here https://turfjs.org/docs/#area
In this image, you can see my first try, then my second using Turf.js - there is a column there showing a ratio of how correct the first try was compared to the second where 1 is the same calculation. You can see that they are mostly close, but some are out by a factor of 10 or worse.
Here is some sample code to do the calculation. I had it load 200 onto the screen, then run the calculation in JS, and ajax the result back to the server side database.
$(document).ready(function () {
var items = $('.geojson');
for (var sc = 0; sc < items.length; sc++) {
var id = $(items[sc]).attr('data-id');
var polyData = JSON.parse($(items[sc]).find('.geojson-data').html());
//console.log('[' + polyData + ']');
var polygon = turf.polygon(polyData.coordinates);
var area = turf.area(polygon);
console.log('id[' + id + ']sqm[' + area + ']');
$(items[sc]).closest('tr').find('.data-id').html(id);
var answerDom = $(items[sc]).closest('tr').find('.answer');
if (true) {
$.ajax({
url: 'calc-poly-area-from-geojson-turf-scheduled.aspx',
type: "get",
data: {id:id, area: area },
invokedata: { answerDom: answerDom, area: area },
async: true,//run all at the same time
cache: false,
success: function (data) {
//console.log('test email done');
$(this.invokedata.answerDom).html('ok:' + this.invokedata.area);
$(this.invokedata.answerDom).removeClass('answer');
if ($('.answer').length == 0) {
window.location.reload();
}
},
error: function (msg) {
console.log("call failed: " + msg.responseText);
$(el).html('error in call');
//prompt('copy this',url+'?'+qs)
}
});
}
}
});
window.setTimeout(function () { window.location.reload(); }, 10000);
where an example polygon is here
{"type":"Polygon", "coordinates":[[[171.519147876006,-43.809111826162],[171.519264282931,-43.8094307100015],[171.519615782201,-43.8097268361192],[171.519874096036,-43.8097860548424],[171.525264107563,-43.8176887926426],[171.525356625489,-43.8179845471556],[171.525750029905,-43.8185636705947],[171.526002901974,-43.8187934292356],[171.526154917292,-43.8189686576417],[171.526249645477,-43.8191111884506],[171.526245660987,-43.819269203656],[171.526032299227,-43.8200263808647],[171.524134038501,-43.8268225827224],[171.523301803308,-43.8297987275054],[171.523129147529,-43.8301621243769],[171.522991616155,-43.8300725313285],[171.52248605771,-43.8302181414427],[171.522128893843,-43.8304084928376],[171.521558488905,-43.8304389785399],[171.521371202269,-43.830481916342],[171.521023295734,-43.8309120441211],[171.520774217465,-43.8310054055632],[171.520589483523,-43.8311387384524],[171.515210823266,-43.8294163992962],[171.514763136723,-43.8292736695248],[171.496256757791,-43.8233680542711],[171.494338310605,-43.8227558913632],[171.493450128779,-43.8224739752289],[171.493221517911,-43.8223838125259],[171.493001278557,-43.8222877021167],[171.492654147639,-43.821801588707],[171.491048512765,-43.8200169686591],[171.488157604579,-43.8168246695455],[171.488051808197,-43.8166695752984],[171.487648717141,-43.8162207994268],[171.486147094889,-43.8145461538075],[171.482241975825,-43.8101769774879],[171.481683765874,-43.8095751045999],[171.480858016595,-43.8085443728491],[171.481124633337,-43.8086557677844],[171.481334008334,-43.8085534985925],[171.481540735171,-43.8083379086683],[171.4815994175,-43.8077828104991],[171.481763314624,-43.8074471226617],[171.481812168914,-43.8064706917151],[171.48196041271,-43.8063093336607],[171.482260412185,-43.8062322290662],[171.482916004007,-43.8059780008537],[171.494844864468,-43.8013540958407],[171.501308718774,-43.7988446798756],[171.506019390319,-43.797017657826],[171.508275460952,-43.7961421972998],[171.508430707528,-43.7960805551645],[171.509117292333,-43.7963432108869],[171.510511038963,-43.7968679021071],[171.513299102675,-43.8007637699317],[171.513465917258,-43.8010892007185],[171.513696634335,-43.8013818859084],[171.513929550742,-43.8016136793445],[171.514114411714,-43.8018826827151],[171.514305634465,-43.8021912982997],[171.51440028511,-43.8024789426394],[171.514828618996,-43.8028429251794],[171.51494106207,-43.8031623582355],[171.515852739466,-43.8044825303059],[171.516111930457,-43.8047763591375],[171.517116748697,-43.8062534995253],[171.517374596163,-43.8065473602078],[171.517549793874,-43.8068229401963],[171.5176213721,-43.8070824951625],[171.517796573697,-43.8073580748019],[171.518070610117,-43.8076087983324],[171.518880109148,-43.8088563353488],[171.519147876006,-43.809111826162]]]}
you can paste that into geojson.io to check their area (click on poly, then 'properties' tab)

Categories

Resources