<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Grid on windy map?]]></title><description><![CDATA[<p dir="auto">Hello, I'm developing a tool to display a csv routing in a windy map. I'm getting points, places with precise geographical positions but it's on a grid, the links of these points too. How can I solve this problem? I speak french. I put my code and a screen.</p>
<p dir="auto">I should have 1 point every 10 minutes, i.e. 1975 points with csv, but I only have about hundred.</p>
<p dir="auto">Discord : joko___</p>
<p dir="auto"><img src="/assets/uploads/files/1731155404324-capture-d-%C3%A9cran-2024-11-09-132530.jpg" alt="Capture d’écran 2024-11-09 132530.jpg" class=" img-fluid img-markdown" /></p>
<pre><code>document.getElementById('csvFile').addEventListener('change', handleFileSelect, false);

let map;
let result = [];

function handleFileSelect(event) {
    const file = event.target.files[0];

    if (!file) {
        return;
    }

    const reader = new FileReader();
    reader.onload = function (e) {
        const contents = e.target.result;
        parseCSV(contents);
    };

    reader.readAsText(file);
}

function parseCSV(data) {
    const lines = data.split("\n");
    const headers = lines[0].split(";");

    console.log("Entêtes : ", headers);

    for (let i = 1; i &lt; lines.length; i++) {
        const cells = lines[i].split(";");

        if (cells.length &lt; headers.length) {
            console.log("Ligne ignorée (incomplète) : ", lines[i]);
            continue;
        }

        const entry = {
            DateHeureUTC: cells[0],
            Latitude: parseFloat(cells[3]),
            Longitude: parseFloat(cells[4])
        };

        if (isNaN(entry.Latitude) || isNaN(entry.Longitude)) {
            console.log(`Coordonnées invalides pour le point: ${cells}`);
            continue;
        }

        console.log(`Point valide : ${entry.DateHeureUTC} - Latitude: ${entry.Latitude} - Longitude: ${entry.Longitude}`);
        result.push(entry);
    }

    console.log("Les points : ", result);

    if (map) {
        addPointsAndLinesToMap(result);
    } else {
        console.log("La carte n'est pas encore initialisée.");
    }
}

const options = {
    key: 'c4kP9ZCKUUlyOwoJnq5PYxr7OanKYCiY',
    verbose: true,
    lat: 50.4,
    lon: 14.3,
    zoom: 5,
};

function addPointsAndLinesToMap(points) {
    if (!points || points.length === 0) {
        console.log("Aucun point à afficher sur la carte.");
        return;
    }

    const latLngs = [];

    points.forEach((point, index) =&gt; {
        const { Latitude, Longitude, DateHeureUTC } = point;

        if (isNaN(Latitude) || isNaN(Longitude)) {
            console.log(`Coordonnées invalides pour le point: ${point}`);
            return;
        }

        L.circleMarker([Latitude, Longitude], {
            color: 'blue',
            radius: 5,
            fillColor: 'blue',
            fillOpacity: 0.6
        }).addTo(map).bindTooltip(DateHeureUTC);

        latLngs.push([Latitude, Longitude]);

        if (index &gt; 0) {
            const prevPoint = points[index - 1];
            const prevTime = new Date(prevPoint.DateHeureUTC).getTime();
            const currTime = new Date(DateHeureUTC).getTime();

            if (currTime - prevTime &gt;= 600000) {
                L.polyline([latLngs[latLngs.length - 2], [Latitude, Longitude&rsqb;&rsqb;, {
                    color: 'red',
                    weight: 2,
                    opacity: 0.7
                }).addTo(map);
            }
        }
    });

    if (latLngs.length &gt; 1) {
        L.polyline(latLngs, { color: 'green', weight: 2, opacity: 0.7 }).addTo(map);
    }
}

windyInit(options, windyAPI =&gt; {
    map = windyAPI.map;
    console.log("Carte Windy initialisée");

    if (result.length &gt; 0) {
        addPointsAndLinesToMap(result);
    }
});

</code></pre>
]]></description><link>https://community.windy.com/topic/37487/grid-on-windy-map</link><generator>RSS for Node</generator><lastBuildDate>Tue, 10 Mar 2026 22:38:01 GMT</lastBuildDate><atom:link href="https://community.windy.com/topic/37487.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 09 Nov 2024 12:32:37 GMT</pubDate><ttl>60</ttl></channel></rss>