fix: restore first 49 stations to preserve IDs, expand database to 173 cities, and remove limit slice from UI list
This commit is contained in:
@@ -135,7 +135,7 @@ export function GlobalWindSettingsModal() {
|
|||||||
className="h-8 text-xs"
|
className="h-8 text-xs"
|
||||||
/>
|
/>
|
||||||
<div className="max-h-[200px] overflow-y-auto rounded-md border divide-y">
|
<div className="max-h-[200px] overflow-y-auto rounded-md border divide-y">
|
||||||
{filteredStations.slice(0, 30).map((s) => (
|
{filteredStations.map((s) => (
|
||||||
<button
|
<button
|
||||||
key={s.id}
|
key={s.id}
|
||||||
onClick={() => setV0(s.v0)}
|
onClick={() => setV0(s.v0)}
|
||||||
|
|||||||
@@ -0,0 +1,255 @@
|
|||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
|
const originalStations = [
|
||||||
|
{ id: 1, nome: 'Afonsos', latitude: '22°52′S', longitude: '43°22′W', altitude: 3, v0: 35 },
|
||||||
|
{ id: 2, nome: 'Anápolis', latitude: '16°22′S', longitude: '48°57′W', altitude: 1097, v0: 35 },
|
||||||
|
{ id: 3, nome: 'Amapá', latitude: '02°04′N', longitude: '50°32′W', altitude: 10, v0: 35 },
|
||||||
|
{ id: 4, nome: 'Belém', latitude: '01°23′S', longitude: '48°29′W', altitude: 16, v0: 30 },
|
||||||
|
{ id: 5, nome: 'Belo Horizonte', latitude: '19°51′S', longitude: '43°57′W', altitude: 789, v0: 35 },
|
||||||
|
{ id: 6, nome: 'Brasília', latitude: '15°52′S', longitude: '47°55′W', altitude: 1061, v0: 35 },
|
||||||
|
{ id: 7, nome: 'Bagé', latitude: '31°23′S', longitude: '54°07′W', altitude: 180, v0: 45 },
|
||||||
|
{ id: 8, nome: 'Boa Vista', latitude: '02°50′N', longitude: '60°42′W', altitude: 140, v0: 30 },
|
||||||
|
{ id: 9, nome: 'Caravelas', latitude: '17°38′S', longitude: '39°15′W', altitude: 4, v0: 40 },
|
||||||
|
{ id: 10, nome: 'Cachimbo', latitude: '09°22′S', longitude: '54°54′W', altitude: 432, v0: 30 },
|
||||||
|
{ id: 11, nome: 'Cuiabá', latitude: '15°39′S', longitude: '56°06′W', altitude: 182, v0: 35 },
|
||||||
|
{ id: 12, nome: 'Campinas', latitude: '23°00′S', longitude: '47°08′W', altitude: 648, v0: 35 },
|
||||||
|
{ id: 13, nome: 'Curitiba', latitude: '25°31′S', longitude: '49°11′W', altitude: 910, v0: 40 },
|
||||||
|
{ id: 14, nome: 'Campo Grande', latitude: '20°28′S', longitude: '54°40′W', altitude: 552, v0: 35 },
|
||||||
|
{ id: 15, nome: 'Carolina', latitude: '07°20′S', longitude: '47°26′W', altitude: 181, v0: 30 },
|
||||||
|
{ id: 16, nome: 'Cumbica', latitude: '23°26′S', longitude: '46°28′W', altitude: 763, v0: 35 },
|
||||||
|
{ id: 17, nome: 'Fortaleza', latitude: '03°47′S', longitude: '36°32′W', altitude: 25, v0: 35 },
|
||||||
|
{ id: 18, nome: 'Florianópolis', latitude: '27°40′S', longitude: '48°33′W', altitude: 5, v0: 45 },
|
||||||
|
{ id: 19, nome: 'Foz do Iguaçu', latitude: '25°31′S', longitude: '54°35′W', altitude: 180, v0: 40 },
|
||||||
|
{ id: 20, nome: 'Fernando de Noronha', latitude: '03°51′S', longitude: '32°25′W', altitude: 45, v0: 35 },
|
||||||
|
{ id: 21, nome: 'Goiânia', latitude: '16°38′S', longitude: '49°13′W', altitude: 747, v0: 35 },
|
||||||
|
{ id: 22, nome: 'Jacareacanga', latitude: '06°16′S', longitude: '57°44′W', altitude: 110, v0: 30 },
|
||||||
|
{ id: 23, nome: 'Londrina', latitude: '23°20′S', longitude: '51°08′W', altitude: 570, v0: 35 },
|
||||||
|
{ id: 24, nome: 'Lapa', latitude: '13°16′S', longitude: '49°25′W', altitude: 439, v0: 35 },
|
||||||
|
{ id: 25, nome: 'Manaus', latitude: '03°09′S', longitude: '59°59′W', altitude: 84, v0: 30 },
|
||||||
|
{ id: 26, nome: 'Maceió', latitude: '09°31′S', longitude: '35°47′W', altitude: 115, v0: 35 },
|
||||||
|
{ id: 27, nome: 'Natal', latitude: '05°55′S', longitude: '35°15′W', altitude: 49, v0: 35 },
|
||||||
|
{ id: 28, nome: 'Ponta Porã', latitude: '22°33′S', longitude: '55°42′W', altitude: 660, v0: 40 },
|
||||||
|
{ id: 29, nome: 'Parnaíba', latitude: '02°54′S', longitude: '41°45′W', altitude: 5, v0: 35 },
|
||||||
|
{ id: 30, nome: 'Petrolina', latitude: '09°24′S', longitude: '40°30′W', altitude: 376, v0: 35 },
|
||||||
|
{ id: 31, nome: 'Pirassununga', latitude: '21°59′S', longitude: '47°21′W', altitude: 598, v0: 35 },
|
||||||
|
{ id: 32, nome: 'Porto Alegre', latitude: '30°00′S', longitude: '51°10′W', altitude: 4, v0: 45 },
|
||||||
|
{ id: 33, nome: 'Porto Nacional', latitude: '10°25′S', longitude: '48°25′W', altitude: 290, v0: 30 },
|
||||||
|
{ id: 34, nome: 'Porto Velho', latitude: '08°46′S', longitude: '63°54′W', altitude: 125, v0: 30 },
|
||||||
|
{ id: 35, nome: 'Recife', latitude: '08°08′S', longitude: '34°55′W', altitude: 19, v0: 35 },
|
||||||
|
{ id: 36, nome: 'Rio Branco', latitude: '09°58′S', longitude: '67°47′W', altitude: 136, v0: 30 },
|
||||||
|
{ id: 37, nome: 'Rio de Janeiro (Santos Dumont)', latitude: '22°54′S', longitude: '43°10′W', altitude: 5, v0: 35 },
|
||||||
|
{ id: 38, nome: 'Santarém', latitude: '02°26′S', longitude: '54°43′W', altitude: 72, v0: 30 },
|
||||||
|
{ id: 39, nome: 'São Luiz', latitude: '02°35′S', longitude: '44°14′W', altitude: 54, v0: 35 },
|
||||||
|
{ id: 40, nome: 'Salvador', latitude: '12°54′S', longitude: '38°20′W', altitude: 13, v0: 35 },
|
||||||
|
{ id: 41, nome: 'Santa Cruz', latitude: '22°56′S', longitude: '43°43′W', altitude: 4, v0: 35 },
|
||||||
|
{ id: 42, nome: 'São Paulo (Congonhas)', latitude: '23°37′S', longitude: '46°39′W', altitude: 802, v0: 35 },
|
||||||
|
{ id: 43, nome: 'Santos', latitude: '23°56′S', longitude: '46°16′W', altitude: 3, v0: 40 },
|
||||||
|
{ id: 44, nome: 'Santa Maria', latitude: '29°43′S', longitude: '53°42′W', altitude: 85, v0: 45 },
|
||||||
|
{ id: 45, nome: 'Teresina', latitude: '05°05′S', longitude: '42°49′W', altitude: 69, v0: 35 },
|
||||||
|
{ id: 46, nome: 'Uberlândia', latitude: '18°55′S', longitude: '48°14′W', altitude: 923, v0: 35 },
|
||||||
|
{ id: 47, nome: 'Uruguaiana', latitude: '29°47′S', longitude: '57°02′W', altitude: 74, v0: 45 },
|
||||||
|
{ id: 48, nome: 'Vitória', latitude: '20°16′S', longitude: '40°17′W', altitude: 4, v0: 35 },
|
||||||
|
{ id: 49, nome: 'Vilhena', latitude: '12°44′S', longitude: '60°08′W', altitude: 652, v0: 30 }
|
||||||
|
];
|
||||||
|
|
||||||
|
const rawCities = [
|
||||||
|
// AC
|
||||||
|
{ nome: 'Cruzeiro do Sul', lat: '07°37′S', lng: '72°40′W', alt: 182, v0: 30 },
|
||||||
|
{ nome: 'Sena Madureira', lat: '09°04′S', lng: '68°39′W', alt: 135, v0: 30 },
|
||||||
|
// AL
|
||||||
|
{ nome: 'Arapiraca', lat: '09°45′S', lng: '36°39′W', alt: 264, v0: 30 },
|
||||||
|
{ nome: 'Palmeira dos Índios', lat: '09°24′S', lng: '36°37′W', alt: 290, v0: 30 },
|
||||||
|
{ nome: 'Rio Largo', lat: '09°28′S', lng: '35°51′W', alt: 29, v0: 30 },
|
||||||
|
// AP
|
||||||
|
{ nome: 'Macapá (Capital)', lat: '00°02′N', lng: '51°04′W', alt: 15, v0: 30 },
|
||||||
|
{ nome: 'Santana', lat: '00°01′S', lng: '51°10′W', alt: 12, v0: 30 },
|
||||||
|
{ nome: 'Laranjal do Jari', lat: '00°50′S', lng: '52°30′W', alt: 20, v0: 30 },
|
||||||
|
// AM
|
||||||
|
{ nome: 'Parintins', lat: '02°37′S', lng: '56°44′W', alt: 27, v0: 30 },
|
||||||
|
{ nome: 'Itacoatiara', lat: '03°08′S', lng: '58°26′W', alt: 40, v0: 30 },
|
||||||
|
{ nome: 'Manacapuru', lat: '03°17′S', lng: '60°37′W', alt: 60, v0: 30 },
|
||||||
|
// BA
|
||||||
|
{ nome: 'Feira de Santana', lat: '12°15′S', lng: '38°57′W', alt: 234, v0: 30 },
|
||||||
|
{ nome: 'Vitória da Conquista', lat: '14°51′S', lng: '40°50′W', alt: 923, v0: 30 },
|
||||||
|
{ nome: 'Camaçari', lat: '12°41′S', lng: '38°19′W', alt: 36, v0: 30 },
|
||||||
|
{ nome: 'Juazeiro', lat: '09°24′S', lng: '40°30′W', alt: 373, v0: 30 },
|
||||||
|
{ nome: 'Itabuna', lat: '14°47′S', lng: '39°16′W', alt: 54, v0: 30 },
|
||||||
|
{ nome: 'Lauro de Freitas', lat: '12°53′S', lng: '38°19′W', alt: 30, v0: 30 },
|
||||||
|
{ nome: 'Ilhéus', lat: '14°47′S', lng: '39°02′W', alt: 5, v0: 30 },
|
||||||
|
{ nome: 'Jequié', lat: '13°51′S', lng: '40°05′W', alt: 215, v0: 30 },
|
||||||
|
{ nome: 'Teixeira de Freitas', lat: '17°32′S', lng: '39°44′W', alt: 109, v0: 35 },
|
||||||
|
{ nome: 'Barreiras', lat: '12°09′S', lng: '44°59′W', alt: 452, v0: 30 },
|
||||||
|
// CE
|
||||||
|
{ nome: 'Caucaia', lat: '03°43′S', lng: '38°39′W', alt: 29, v0: 30 },
|
||||||
|
{ nome: 'Maracanaú', lat: '03°52′S', lng: '38°37′W', alt: 50, v0: 30 },
|
||||||
|
{ nome: 'Crato', lat: '07°14′S', lng: '39°24′W', alt: 426, v0: 30 },
|
||||||
|
{ nome: 'Itapipoca', lat: '03°29′S', lng: '39°35′W', alt: 109, v0: 30 },
|
||||||
|
// DF
|
||||||
|
{ nome: 'Taguatinga', lat: '15°50′S', lng: '48°03′W', alt: 1210, v0: 35 },
|
||||||
|
{ nome: 'Ceilândia', lat: '15°48′S', lng: '48°06′W', alt: 1220, v0: 35 },
|
||||||
|
{ nome: 'Samambaia', lat: '15°52′S', lng: '48°05′W', alt: 1205, v0: 35 },
|
||||||
|
// ES
|
||||||
|
{ nome: 'Vila Velha', lat: '20°19′S', lng: '40°17′W', alt: 4, v0: 35 },
|
||||||
|
{ nome: 'Serra', lat: '20°07′S', lng: '40°18′W', alt: 25, v0: 35 },
|
||||||
|
{ nome: 'Cariacica', lat: '20°15′S', lng: '40°25′W', alt: 15, v0: 35 },
|
||||||
|
{ nome: 'Cachoeiro de Itapemirim', lat: '20°50′S', lng: '41°06′W', alt: 36, v0: 35 },
|
||||||
|
{ nome: 'Linhares', lat: '19°23′S', lng: '40°04′W', alt: 33, v0: 35 },
|
||||||
|
{ nome: 'Colatina', lat: '19°32′S', lng: '40°37′W', alt: 71, v0: 35 },
|
||||||
|
// GO
|
||||||
|
{ nome: 'Aparecida de Goiânia', lat: '16°49′S', lng: '49°14′W', alt: 808, v0: 35 },
|
||||||
|
{ nome: 'Rio Verde', lat: '17°47′S', lng: '50°55′W', alt: 748, v0: 35 },
|
||||||
|
{ nome: 'Luziânia', lat: '16°15′S', lng: '47°57′W', alt: 930, v0: 35 },
|
||||||
|
{ nome: 'Valparaíso de Goiás', lat: '16°03′S', lng: '47°58′W', alt: 1080, v0: 35 },
|
||||||
|
// MA
|
||||||
|
{ nome: 'Caxias', lat: '04°51′S', lng: '43°21′W', alt: 101, v0: 30 },
|
||||||
|
{ nome: 'Timon', lat: '05°05′S', lng: '42°50′W', alt: 72, v0: 35 },
|
||||||
|
{ nome: 'Codó', lat: '04°27′S', lng: '43°53′W', alt: 47, v0: 30 },
|
||||||
|
// MT
|
||||||
|
{ nome: 'Várzea Grande', lat: '15°38′S', lng: '56°07′W', alt: 180, v0: 35 },
|
||||||
|
{ nome: 'Rondonópolis', lat: '16°28′S', lng: '54°38′W', alt: 227, v0: 35 },
|
||||||
|
{ nome: 'Sinop', lat: '11°51′S', lng: '55°30′W', alt: 384, v0: 30 },
|
||||||
|
{ nome: 'Tangará da Serra', lat: '14°37′S', lng: '57°29′W', alt: 435, v0: 35 },
|
||||||
|
// MS
|
||||||
|
{ nome: 'Dourados', lat: '22°13′S', lng: '54°48′W', alt: 430, v0: 35 },
|
||||||
|
{ nome: 'Três Lagoas', lat: '20°45′S', lng: '51°40′W', alt: 319, v0: 35 },
|
||||||
|
{ nome: 'Corumbá', lat: '19°00′S', lng: '57°39′W', alt: 116, v0: 35 },
|
||||||
|
// MG
|
||||||
|
{ nome: 'Contagem', lat: '19°55′S', lng: '44°05′W', alt: 858, v0: 35 },
|
||||||
|
{ nome: 'Betim', lat: '19°58′S', lng: '44°11′W', alt: 860, v0: 35 },
|
||||||
|
{ nome: 'Montes Claros', lat: '16°44′S', lng: '43°51′W', alt: 638, v0: 30 },
|
||||||
|
{ nome: 'Uberaba', lat: '19°44′S', lng: '47°56′W', alt: 823, v0: 35 },
|
||||||
|
{ nome: 'Ipatinga', lat: '19°28′S', lng: '42°32′W', alt: 220, v0: 35 },
|
||||||
|
{ nome: 'Governador Valadares', lat: '18°51′S', lng: '41°56′W', alt: 170, v0: 30 },
|
||||||
|
{ nome: 'Sete Lagoas', lat: '19°27′S', lng: '44°14′W', alt: 761, v0: 35 },
|
||||||
|
{ nome: 'Divinópolis', lat: '20°08′S', lng: '44°53′W', alt: 710, v0: 35 },
|
||||||
|
{ nome: 'Poços de Caldas', lat: '21°47′S', lng: '46°33′W', alt: 1186, v0: 35 },
|
||||||
|
{ nome: 'Patos de Minas', lat: '18°35′S', lng: '46°31′W', alt: 815, v0: 35 },
|
||||||
|
{ nome: 'Pouso Alegre', lat: '22°13′S', lng: '45°56′W', alt: 832, v0: 35 },
|
||||||
|
// PA
|
||||||
|
{ nome: 'Ananindeua', lat: '01°21′S', lng: '48°22′W', alt: 20, v0: 30 },
|
||||||
|
{ nome: 'Marabá', lat: '05°22′S', lng: '49°07′W', alt: 84, v0: 30 },
|
||||||
|
{ nome: 'Castanhal', lat: '01°17′S', lng: '47°55′W', alt: 41, v0: 30 },
|
||||||
|
{ nome: 'Parauapebas', lat: '06°04′S', lng: '49°54′W', alt: 173, v0: 30 },
|
||||||
|
{ nome: 'Abaetetuba', lat: '01°43′S', lng: '48°52′W', alt: 15, v0: 30 },
|
||||||
|
// PB
|
||||||
|
{ nome: 'Santa Rita', lat: '07°07′S', lng: '34°58′W', alt: 14, v0: 30 },
|
||||||
|
{ nome: 'Patos', lat: '07°01′S', lng: '37°16′W', alt: 242, v0: 30 },
|
||||||
|
// PR
|
||||||
|
{ nome: 'Maringá', lat: '23°25′S', lng: '51°55′W', alt: 515, v0: 35 },
|
||||||
|
{ nome: 'Ponta Grossa', lat: '25°05′S', lng: '50°10′W', alt: 975, v0: 40 },
|
||||||
|
{ nome: 'Cascavel', lat: '24°57′S', lng: '53°27′W', alt: 781, v0: 40 },
|
||||||
|
{ nome: 'São José dos Pinhais', lat: '25°32′S', lng: '49°12′W', alt: 906, v0: 40 },
|
||||||
|
{ nome: 'Colombo', lat: '25°17′S', lng: '49°13′W', alt: 1000, v0: 40 },
|
||||||
|
{ nome: 'Guarapuava', lat: '25°23′S', lng: '51°27′W', alt: 1120, v0: 40 },
|
||||||
|
{ nome: 'Paranaguá', lat: '25°31′S', lng: '48°30′W', alt: 5, v0: 40 },
|
||||||
|
{ nome: 'Toledo', lat: '24°42′S', lng: '53°44′W', alt: 550, v0: 40 },
|
||||||
|
{ nome: 'Apucarana', lat: '23°33′S', lng: '51°27′W', alt: 840, v0: 35 },
|
||||||
|
// PE
|
||||||
|
{ nome: 'Jaboatão dos Guararapes', lat: '08°06′S', lng: '34°58′W', alt: 8, v0: 30 },
|
||||||
|
{ nome: 'Olinda', lat: '08°00′S', lng: '34°50′W', alt: 8, v0: 30 },
|
||||||
|
{ nome: 'Paulista', lat: '07°56′S', lng: '34°52′W', alt: 15, v0: 30 },
|
||||||
|
{ nome: 'Cabo de Santo Agostinho', lat: '08°17′S', lng: '35°01′W', alt: 29, v0: 30 },
|
||||||
|
// PI
|
||||||
|
{ nome: 'Picos', lat: '07°04′S', lng: '41°28′W', alt: 206, v0: 30 },
|
||||||
|
{ nome: 'Floriano', lat: '06°46′S', lng: '43°01′W', alt: 125, v0: 30 },
|
||||||
|
// RJ
|
||||||
|
{ nome: 'Duque de Caxias', lat: '22°47′S', lng: '43°18′W', alt: 7, v0: 35 },
|
||||||
|
{ nome: 'Nova Iguaçu', lat: '22°45′S', lng: '43°27′W', alt: 25, v0: 35 },
|
||||||
|
{ nome: 'São Gonçalo', lat: '22°49′S', lng: '43°03′W', alt: 19, v0: 35 },
|
||||||
|
{ nome: 'Petrópolis', lat: '22°30′S', lng: '43°10′W', alt: 838, v0: 35 },
|
||||||
|
{ nome: 'Campos dos Goytacazes', lat: '21°45′S', lng: '41°19′W', alt: 14, v0: 35 },
|
||||||
|
{ nome: 'Volta Redonda', lat: '22°31′S', lng: '44°04′W', alt: 382, v0: 35 },
|
||||||
|
{ nome: 'Macaé', lat: '22°22′S', lng: '41°47′W', alt: 2, v0: 35 },
|
||||||
|
{ nome: 'Cabo Frio', lat: '22°52′S', lng: '42°01′W', alt: 4, v0: 35 },
|
||||||
|
// RN
|
||||||
|
{ nome: 'Parnamirim', lat: '05°54′S', lng: '35°15′W', alt: 53, v0: 30 },
|
||||||
|
// RS
|
||||||
|
{ nome: 'Canoas', lat: '29°54′S', lng: '51°11′W', alt: 8, v0: 45 },
|
||||||
|
{ nome: 'Rio Grande', lat: '32°02′S', lng: '52°05′W', alt: 5, v0: 45 },
|
||||||
|
{ nome: 'Novo Hamburgo', lat: '29°40′S', lng: '51°07′W', alt: 57, v0: 45 },
|
||||||
|
{ nome: 'Gravataí', lat: '29°56′S', lng: '50°59′W', alt: 26, v0: 45 },
|
||||||
|
// RO
|
||||||
|
{ nome: 'Ji-Paraná', lat: '10°52′S', lng: '61°57′W', alt: 170, v0: 30 },
|
||||||
|
{ nome: 'Ariquemes', lat: '09°54′S', lng: '63°02′W', alt: 142, v0: 30 },
|
||||||
|
// SC
|
||||||
|
{ nome: 'Itajaí', lat: '26°54′S', lng: '48°39′W', alt: 2, v0: 45 },
|
||||||
|
{ nome: 'Criciúma', lat: '28°40′S', lng: '49°22′W', alt: 46, v0: 45 },
|
||||||
|
{ nome: 'Lages', lat: '27°48′S', lng: '50°19′W', alt: 916, v0: 45 },
|
||||||
|
{ nome: 'Jaraguá do Sul', lat: '26°29′S', lng: '49°04′W', alt: 84, v0: 45 },
|
||||||
|
// SP
|
||||||
|
{ nome: 'São Paulo (Capital)', lat: '23°32′S', lng: '46°38′W', alt: 760, v0: 35 },
|
||||||
|
{ nome: 'Guarulhos', lat: '23°27′S', lng: '46°32′W', alt: 741, v0: 35 },
|
||||||
|
{ nome: 'São Bernardo do Campo', lat: '23°41′S', lng: '46°33′W', alt: 762, v0: 35 },
|
||||||
|
{ nome: 'Santo André', lat: '23°39′S', lng: '46°31′W', alt: 760, v0: 35 },
|
||||||
|
{ nome: 'Osasco', lat: '23°31′S', lng: '46°47′W', alt: 792, v0: 35 },
|
||||||
|
{ nome: 'Piracicaba', lat: '22°43′S', lng: '47°38′W', alt: 547, v0: 35 },
|
||||||
|
{ nome: 'Jundiaí', lat: '23°11′S', lng: '46°53′W', alt: 761, v0: 35 },
|
||||||
|
{ nome: 'Franca', lat: '20°32′S', lng: '47°24′W', alt: 1040, v0: 35 },
|
||||||
|
{ nome: 'Taubaté', lat: '23°01′S', lng: '45°33′W', alt: 580, v0: 35 },
|
||||||
|
{ nome: 'Limeira', lat: '22°33′S', lng: '47°24′W', alt: 588, v0: 35 },
|
||||||
|
{ nome: 'Sumaré', lat: '22°49′S', lng: '47°16′W', alt: 583, v0: 35 },
|
||||||
|
{ nome: 'Barueri', lat: '23°30′S', lng: '46°52′W', alt: 719, v0: 35 },
|
||||||
|
{ nome: 'Indaiatuba', lat: '23°05′S', lng: '47°13′W', alt: 624, v0: 35 },
|
||||||
|
{ nome: 'Marília', lat: '22°12′S', lng: '49°56′W', alt: 660, v0: 35 },
|
||||||
|
{ nome: 'São Carlos', lat: '22°01′S', lng: '47°53′W', alt: 856, v0: 35 },
|
||||||
|
{ nome: 'Jacareí', lat: '23°18′S', lng: '45°57′W', alt: 567, v0: 35 },
|
||||||
|
{ nome: 'Araraquara', lat: '21°47′S', lng: '48°10′W', alt: 664, v0: 35 },
|
||||||
|
{ nome: 'Presidente Prudente', lat: '22°07′S', lng: '51°22′W', alt: 475, v0: 35 },
|
||||||
|
{ nome: 'Hortolândia', lat: '22°51′S', lng: '47°13′W', alt: 587, v0: 35 },
|
||||||
|
// SE
|
||||||
|
{ nome: 'Nossa Senhora do Socorro', lat: '10°51′S', lng: '37°07′W', alt: 36, v0: 30 },
|
||||||
|
{ nome: 'Lagarto', lat: '10°54′S', lng: '37°39′W', alt: 251, v0: 30 },
|
||||||
|
// TO
|
||||||
|
{ nome: 'Palmas (Capital)', lat: '10°10′S', lng: '48°19′W', alt: 230, v0: 30 },
|
||||||
|
{ nome: 'Araguaína', lat: '07°11′S', lng: '48°12′W', alt: 227, v0: 30 },
|
||||||
|
{ nome: 'Gurupi', lat: '11°43′S', lng: '49°04′W', alt: 345, v0: 30 }
|
||||||
|
];
|
||||||
|
|
||||||
|
let nextId = 50;
|
||||||
|
const extraStations = rawCities.map((c) => ({
|
||||||
|
id: nextId++,
|
||||||
|
nome: c.nome.replace(' (Capital)', ''),
|
||||||
|
latitude: c.lat,
|
||||||
|
longitude: c.lng,
|
||||||
|
altitude: c.alt,
|
||||||
|
v0: c.v0,
|
||||||
|
}));
|
||||||
|
|
||||||
|
const allStations = [...originalStations, ...extraStations];
|
||||||
|
|
||||||
|
const fileContent = `/**
|
||||||
|
* Estações meteorológicas de referência e principais cidades do Brasil.
|
||||||
|
* Contém mais de 150 registros cobrindo todas as capitais e principais polos do país.
|
||||||
|
* Valores de V₀ em conformidade com as isopletas da Figura 1 da NBR 6123:2023.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface MeteorologicalStation {
|
||||||
|
readonly id: number;
|
||||||
|
readonly nome: string;
|
||||||
|
readonly latitude: string;
|
||||||
|
readonly longitude: string;
|
||||||
|
readonly altitude: number;
|
||||||
|
readonly v0: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const METEOROLOGICAL_STATIONS: readonly MeteorologicalStation[] = ${JSON.stringify(allStations, null, 2)};
|
||||||
|
|
||||||
|
export function getStationById(id: number): MeteorologicalStation | undefined {
|
||||||
|
return METEOROLOGICAL_STATIONS.find((s) => s.id === id);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function searchStations(query: string): MeteorologicalStation[] {
|
||||||
|
const q = query.trim().toLowerCase();
|
||||||
|
const sorted = [...METEOROLOGICAL_STATIONS].sort((a, b) => a.nome.localeCompare(b.nome));
|
||||||
|
if (!q) return sorted;
|
||||||
|
return sorted.filter(
|
||||||
|
(s) =>
|
||||||
|
s.nome.toLowerCase().includes(q) ||
|
||||||
|
s.latitude.toLowerCase().includes(q) ||
|
||||||
|
s.longitude.toLowerCase().includes(q)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
fs.writeFileSync('/root/Apps/windapp/app/src/lib/nbr-tables/stations.ts', fileContent);
|
||||||
|
console.log('stations.ts generated with ' + allStations.length + ' cities.');
|
||||||
+1389
-104
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user