Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

230
Views
A really closed polygon is not accepted by turf.polygon

Defining a method:

drawFragment : function(pFRAGMENT) {
        console.log(pFRAGMENT.coordinates);
        var wPolygon = turf.polygon([pFRAGMENT.coordinates]);
},

results in a turf error in execution:

First and last Position are not equivalent.

The passed coordinates are (first and last pair are identical - as required):

[[8.543590974130666, 47.377830192117756],
[8.543672439897477, 47.377850806388665],
[8.543667400529785, 47.37788614972462],
[8.543582309906242, 47.37791046432616],
[8.543590974130666, 47.377830192117756]]

What's wrong here?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

See

const data = turf.polygon(
  [
    [
      [8.543590974130666, 47.377830192117756],
      [8.543672439897477, 47.377850806388665],
      [8.543667400529785, 47.37788614972462],
      [8.543582309906242, 47.37791046432616],
      [8.543590974130666, 47.377830192117756],
    ],
  ],
  { name: 'poly1' }
);

console.log(data);

I didn't get any errors. have a look https://stackblitz.com/edit/js-jzkxtn?file=index.js

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!