Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

236
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda