Commit 4374ac3e authored by Rodrigo Tapia-McClung's avatar Rodrigo Tapia-McClung

Read original data and transpose. Use geojson instead of mbtiles

parent b4935b0b
This source diff could not be displayed because it is too large. You can view the blob instead.
Catalogo de estaciones,,,,,,
cve_estac,nom_estac,longitud,latitud,alt,obs_estac,id_station
ACO,Acolman,-98.912003,19.635501,2198,,484150020109
AJU,Ajusco,-99.162611,19.154286,2942,,484090120400
AJM,Ajusco Medio,-99.207744,19.272161,2548,,484090120609
ARA,Aragón,-99.074549,19.470218,2200,Finalizó operación en 2010,484090050301
ATI,Atizapan,-99.254133,19.576963,2341,,484150130101
AZC,Azcapotzalco,-99.198657,19.487728,2279,Finalizó operación en 2010,484090020201
BJU,Benito Juárez,-99.159596,19.370464,2249,Finalizó operación en 2005,484090140201
CAM,Camarones,-99.169794,19.468404,2233,,484090020301
CCA,Centro de Ciencias de la Atmósfera,-99.176111,19.326111,2294,,484090030501
CES,Cerro de la Estrella,-99.074678,19.334731,2219,Finalizó operación en 2010,484090070111
CFE,Museo Tecnológico de la CFE,-99.194279,19.414393,2287,Finalizó operación en 1996,484090160102
CHO,Chalco,-98.886088,19.266948,2253,,484150250109
COR,CORENA,-99.02604,19.265346,2242,,484090130204
COY,Coyoacán,-99.157101,19.350258,2260,,484090030303
CUA,Cuajimalpa,-99.291705,19.365313,2704,,484090040109
CUI,Cuitláhuac,-99.165849,19.469859,2255,Finalizó operación en 1993,484090020101
CUT,Cuautitlán,-99.198602,19.722186,2263,,484150950109
DIC,Diconsa,-99.185774,19.298819,2305,,484090120304
EAJ,Ecoguardas Ajusco,-99.203971,19.271222,2584,,484090120404
EDL,Exconv. Desierto Leones,-99.310635,19.313357,2980,,484090040204
FAC,FES Acatlán,-99.243524,19.482473,2299,,484150570109
FAN,Felipe Ángeles,-99.17492,19.299126,2279,Finalizó operación en 1996,484090120102
GAM,Gustavo A. Madero,-99.094517,19.4827,2227,,484090050809
HAN,Hangares,-99.083623,19.420518,2235,Finalizó operación en 2006,484090170209
HGM,Hospital General de México,-99.152207,19.411617,2234,,484090150409
IBM,Legaria,-99.21536,19.443319,2314,,484090160504
IMP,Inst. Mexicano del Petróleo,-99.147294,19.487561,2250,Finalizó operación en 2010,484090050209
INN,Investigaciones Nucleares,-99.38052,19.291968,3082,,484150620109
IZT,Iztacalco,-99.117641,19.384413,2238,,484090060101
LAA,Lab. de Analisis Ambiental,-99.147312,19.483781,2255,,484090050604
LAG,Lagunilla,-99.135183,19.44242,2223,Finalizó operación en 2010,484090150101
LLA,Los Laureles,-99.039644,19.578792,2230,,484150330201
LOM,Lomas,-99.242062,19.403,2434,,484090160406
LPR,La Presa,-99.11772,19.534727,2302,,484151040203
LVI,La Villa,-99.117749,19.46789,2228,Finalizó operación en 2010,484090050101
MCM,Museo de la Cd. de México,-99.131924,19.429071,2237,,484090150304
MER,Merced,-99.119594,19.42461,2245,,484090170127
MGH,Mguel Hidalgo,-99.20266,19.40405,2327,,484090160609
MIN,Metro Insurgentes,-99.162885,19.42144,2231,Finalizó operación en 2007,484090150201
MON,Montecillo,-98.902853,19.460415,2252,,484150990113
MPA,Milpa Alta,-98.990189,19.1769,2594,,484090090104
NET,Netzahualcoyotl,-99.026119,19.42115,2230,Finalizó operación en 2000,484150580201
NEZ,Nezahualcóyotl,-99.028212,19.393734,2235,,484150580115
PED,Pedregal,-99.204136,19.325146,2326,,484090100127
PER,La Perla,-98.991858,19.38286,2237,Finalizó operación en 2011,484150580303
PLA,Plateros,-99.200109,19.365869,2345,Finalizó operación en 2010,484090100209
POT,Portales,-99.145766,19.376494,2237,Finalizó operación en 1996,484090140102
SAG,San Agustín,-99.030324,19.532968,2241,,484150330327
SFE,Santa fe,-99.262865,19.357357,2599,,484090040309
SHA,Secretaría de Hacienda,-99.207868,19.446203,2272,,484090160202
SJA,San Juan Aragón,-99.086095,19.452592,2258,,484090050701
SNT,San Nicolas Totolapan,-99.256462,19.250385,2946,,484090080104
SUR,Santa Ursula,-99.149994,19.31448,2279,,484090030109
TAC,Tacuba,-99.202455,19.453907,2275,Finalizó operación en 2010,484090160309
TAH,Tlahuac,-99.010564,19.246459,2297,,484090130309
TAX,Taxqueña,-99.123204,19.335689,2242,Finalizó operación en 2010,484090030201
TEC,Cerro del Tepeyac,-99.114229,19.487227,2265,,484090050404
TLA,Tlalnepantla,-99.204597,19.529077,2311,,484151040115
TLI,Tultitlán,-99.177173,19.602542,2313,,484151090101
TPN,Tlalpan,-99.184177,19.257041,2522,,484090120209
UAX,UAM Xochimilco,-99.103629,19.304441,2246,,484090030401
UIZ,UAM Iztapalapa,-99.07388,19.360794,2221,,484090070219
UNM,Unidad Movil,-99.147137,19.482238,,,484090000099
VAL,Vallejo,-99.165702,19.522437,2248,Finalizó operación en 2010,484090050501
VIF,Villa de las Flores,-99.09659,19.658223,2242,,484150200109
XAL,Xalostoc,-99.0824,19.525995,2160,,484150330415
XCH,Xochimilco,-99.118252,19.267066,2243,Finalizó operación en 1999,484090130102
FAR,FES Aragón,-99.046176,19.473692,2230,,484800150584
SAC,Santiago Acahualtepec,-99.009381,19.34561,2293,,484800090073
{
"type": "FeatureCollection",
"name": "estaciones",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "cve_estac": "ACO", "nom_estac": "Acolman", "longitud": "-98.912003", "latitud": "19.635501", "alt": "2198", "obs_estac": null, "id_station": "484150020109" }, "geometry": { "type": "Point", "coordinates": [ -98.912003, 19.635501 ] } },
{ "type": "Feature", "properties": { "cve_estac": "AJU", "nom_estac": "Ajusco", "longitud": "-99.162611", "latitud": "19.154286", "alt": "2942", "obs_estac": null, "id_station": "484090120400" }, "geometry": { "type": "Point", "coordinates": [ -99.162611, 19.154286 ] } },
{ "type": "Feature", "properties": { "cve_estac": "AJM", "nom_estac": "Ajusco Medio", "longitud": "-99.207744", "latitud": "19.272161", "alt": "2548", "obs_estac": null, "id_station": "484090120609" }, "geometry": { "type": "Point", "coordinates": [ -99.207744, 19.272161 ] } },
{ "type": "Feature", "properties": { "cve_estac": "ARA", "nom_estac": "Aragón", "longitud": "-99.074549", "latitud": "19.470218", "alt": "2200", "obs_estac": "Finalizó operación en 2010", "id_station": "484090050301" }, "geometry": { "type": "Point", "coordinates": [ -99.074549, 19.470218 ] } },
{ "type": "Feature", "properties": { "cve_estac": "ATI", "nom_estac": "Atizapan", "longitud": "-99.254133", "latitud": "19.576963", "alt": "2341", "obs_estac": null, "id_station": "484150130101" }, "geometry": { "type": "Point", "coordinates": [ -99.254133, 19.576963 ] } },
{ "type": "Feature", "properties": { "cve_estac": "AZC", "nom_estac": "Azcapotzalco", "longitud": "-99.198657", "latitud": "19.487728", "alt": "2279", "obs_estac": "Finalizó operación en 2010", "id_station": "484090020201" }, "geometry": { "type": "Point", "coordinates": [ -99.198657, 19.487728 ] } },
{ "type": "Feature", "properties": { "cve_estac": "BJU", "nom_estac": "Benito Juárez", "longitud": "-99.159596", "latitud": "19.370464", "alt": "2249", "obs_estac": "Finalizó operación en 2005", "id_station": "484090140201" }, "geometry": { "type": "Point", "coordinates": [ -99.159596, 19.370464 ] } },
{ "type": "Feature", "properties": { "cve_estac": "CAM", "nom_estac": "Camarones", "longitud": "-99.169794", "latitud": "19.468404", "alt": "2233", "obs_estac": null, "id_station": "484090020301" }, "geometry": { "type": "Point", "coordinates": [ -99.169794, 19.468404 ] } },
{ "type": "Feature", "properties": { "cve_estac": "CCA", "nom_estac": "Centro de Ciencias de la Atmósfera", "longitud": "-99.176111", "latitud": "19.326111", "alt": "2294", "obs_estac": null, "id_station": "484090030501" }, "geometry": { "type": "Point", "coordinates": [ -99.176111, 19.326111 ] } },
{ "type": "Feature", "properties": { "cve_estac": "CES", "nom_estac": "Cerro de la Estrella", "longitud": "-99.074678", "latitud": "19.334731", "alt": "2219", "obs_estac": "Finalizó operación en 2010", "id_station": "484090070111" }, "geometry": { "type": "Point", "coordinates": [ -99.074678, 19.334731 ] } },
{ "type": "Feature", "properties": { "cve_estac": "CFE", "nom_estac": "Museo Tecnológico de la CFE", "longitud": "-99.194279", "latitud": "19.414393", "alt": "2287", "obs_estac": "Finalizó operación en 1996", "id_station": "484090160102" }, "geometry": { "type": "Point", "coordinates": [ -99.194279, 19.414393 ] } },
{ "type": "Feature", "properties": { "cve_estac": "CHO", "nom_estac": "Chalco", "longitud": "-98.886088", "latitud": "19.266948", "alt": "2253", "obs_estac": null, "id_station": "484150250109" }, "geometry": { "type": "Point", "coordinates": [ -98.886088, 19.266948 ] } },
{ "type": "Feature", "properties": { "cve_estac": "COR", "nom_estac": "CORENA", "longitud": "-99.02604", "latitud": "19.265346", "alt": "2242", "obs_estac": null, "id_station": "484090130204" }, "geometry": { "type": "Point", "coordinates": [ -99.02604, 19.265346 ] } },
{ "type": "Feature", "properties": { "cve_estac": "COY", "nom_estac": "Coyoacán", "longitud": "-99.157101", "latitud": "19.350258", "alt": "2260", "obs_estac": null, "id_station": "484090030303" }, "geometry": { "type": "Point", "coordinates": [ -99.157101, 19.350258 ] } },
{ "type": "Feature", "properties": { "cve_estac": "CUA", "nom_estac": "Cuajimalpa", "longitud": "-99.291705", "latitud": "19.365313", "alt": "2704", "obs_estac": null, "id_station": "484090040109" }, "geometry": { "type": "Point", "coordinates": [ -99.291705, 19.365313 ] } },
{ "type": "Feature", "properties": { "cve_estac": "CUI", "nom_estac": "Cuitláhuac", "longitud": "-99.165849", "latitud": "19.469859", "alt": "2255", "obs_estac": "Finalizó operación en 1993", "id_station": "484090020101" }, "geometry": { "type": "Point", "coordinates": [ -99.165849, 19.469859 ] } },
{ "type": "Feature", "properties": { "cve_estac": "CUT", "nom_estac": "Cuautitlán", "longitud": "-99.198602", "latitud": "19.722186", "alt": "2263", "obs_estac": null, "id_station": "484150950109" }, "geometry": { "type": "Point", "coordinates": [ -99.198602, 19.722186 ] } },
{ "type": "Feature", "properties": { "cve_estac": "DIC", "nom_estac": "Diconsa", "longitud": "-99.185774", "latitud": "19.298819", "alt": "2305", "obs_estac": null, "id_station": "484090120304" }, "geometry": { "type": "Point", "coordinates": [ -99.185774, 19.298819 ] } },
{ "type": "Feature", "properties": { "cve_estac": "EAJ", "nom_estac": "Ecoguardas Ajusco", "longitud": "-99.203971", "latitud": "19.271222", "alt": "2584", "obs_estac": null, "id_station": "484090120404" }, "geometry": { "type": "Point", "coordinates": [ -99.203971, 19.271222 ] } },
{ "type": "Feature", "properties": { "cve_estac": "EDL", "nom_estac": "Exconv. Desierto Leones", "longitud": "-99.310635", "latitud": "19.313357", "alt": "2980", "obs_estac": null, "id_station": "484090040204" }, "geometry": { "type": "Point", "coordinates": [ -99.310635, 19.313357 ] } },
{ "type": "Feature", "properties": { "cve_estac": "FAC", "nom_estac": "FES Acatlán", "longitud": "-99.243524", "latitud": "19.482473", "alt": "2299", "obs_estac": null, "id_station": "484150570109" }, "geometry": { "type": "Point", "coordinates": [ -99.243524, 19.482473 ] } },
{ "type": "Feature", "properties": { "cve_estac": "FAN", "nom_estac": "Felipe Ángeles", "longitud": "-99.17492", "latitud": "19.299126", "alt": "2279", "obs_estac": "Finalizó operación en 1996", "id_station": "484090120102" }, "geometry": { "type": "Point", "coordinates": [ -99.17492, 19.299126 ] } },
{ "type": "Feature", "properties": { "cve_estac": "GAM", "nom_estac": "Gustavo A. Madero", "longitud": "-99.094517", "latitud": "19.4827", "alt": "2227", "obs_estac": null, "id_station": "484090050809" }, "geometry": { "type": "Point", "coordinates": [ -99.094517, 19.4827 ] } },
{ "type": "Feature", "properties": { "cve_estac": "HAN", "nom_estac": "Hangares", "longitud": "-99.083623", "latitud": "19.420518", "alt": "2235", "obs_estac": "Finalizó operación en 2006", "id_station": "484090170209" }, "geometry": { "type": "Point", "coordinates": [ -99.083623, 19.420518 ] } },
{ "type": "Feature", "properties": { "cve_estac": "HGM", "nom_estac": "Hospital General de México", "longitud": "-99.152207", "latitud": "19.411617", "alt": "2234", "obs_estac": null, "id_station": "484090150409" }, "geometry": { "type": "Point", "coordinates": [ -99.152207, 19.411617 ] } },
{ "type": "Feature", "properties": { "cve_estac": "IBM", "nom_estac": "Legaria", "longitud": "-99.21536", "latitud": "19.443319", "alt": "2314", "obs_estac": null, "id_station": "484090160504" }, "geometry": { "type": "Point", "coordinates": [ -99.21536, 19.443319 ] } },
{ "type": "Feature", "properties": { "cve_estac": "IMP", "nom_estac": "Inst. Mexicano del Petróleo", "longitud": "-99.147294", "latitud": "19.487561", "alt": "2250", "obs_estac": "Finalizó operación en 2010", "id_station": "484090050209" }, "geometry": { "type": "Point", "coordinates": [ -99.147294, 19.487561 ] } },
{ "type": "Feature", "properties": { "cve_estac": "INN", "nom_estac": "Investigaciones Nucleares", "longitud": "-99.38052", "latitud": "19.291968", "alt": "3082", "obs_estac": null, "id_station": "484150620109" }, "geometry": { "type": "Point", "coordinates": [ -99.38052, 19.291968 ] } },
{ "type": "Feature", "properties": { "cve_estac": "IZT", "nom_estac": "Iztacalco", "longitud": "-99.117641", "latitud": "19.384413", "alt": "2238", "obs_estac": null, "id_station": "484090060101" }, "geometry": { "type": "Point", "coordinates": [ -99.117641, 19.384413 ] } },
{ "type": "Feature", "properties": { "cve_estac": "LAA", "nom_estac": "Lab. de Analisis Ambiental", "longitud": "-99.147312", "latitud": "19.483781", "alt": "2255", "obs_estac": null, "id_station": "484090050604" }, "geometry": { "type": "Point", "coordinates": [ -99.147312, 19.483781 ] } },
{ "type": "Feature", "properties": { "cve_estac": "LAG", "nom_estac": "Lagunilla", "longitud": "-99.135183", "latitud": "19.44242", "alt": "2223", "obs_estac": "Finalizó operación en 2010", "id_station": "484090150101" }, "geometry": { "type": "Point", "coordinates": [ -99.135183, 19.44242 ] } },
{ "type": "Feature", "properties": { "cve_estac": "LLA", "nom_estac": "Los Laureles", "longitud": "-99.039644", "latitud": "19.578792", "alt": "2230", "obs_estac": null, "id_station": "484150330201" }, "geometry": { "type": "Point", "coordinates": [ -99.039644, 19.578792 ] } },
{ "type": "Feature", "properties": { "cve_estac": "LOM", "nom_estac": "Lomas", "longitud": "-99.242062", "latitud": "19.403", "alt": "2434", "obs_estac": null, "id_station": "484090160406" }, "geometry": { "type": "Point", "coordinates": [ -99.242062, 19.403 ] } },
{ "type": "Feature", "properties": { "cve_estac": "LPR", "nom_estac": "La Presa", "longitud": "-99.11772", "latitud": "19.534727", "alt": "2302", "obs_estac": null, "id_station": "484151040203" }, "geometry": { "type": "Point", "coordinates": [ -99.11772, 19.534727 ] } },
{ "type": "Feature", "properties": { "cve_estac": "LVI", "nom_estac": "La Villa", "longitud": "-99.117749", "latitud": "19.46789", "alt": "2228", "obs_estac": "Finalizó operación en 2010", "id_station": "484090050101" }, "geometry": { "type": "Point", "coordinates": [ -99.117749, 19.46789 ] } },
{ "type": "Feature", "properties": { "cve_estac": "MCM", "nom_estac": "Museo de la Cd. de México", "longitud": "-99.131924", "latitud": "19.429071", "alt": "2237", "obs_estac": null, "id_station": "484090150304" }, "geometry": { "type": "Point", "coordinates": [ -99.131924, 19.429071 ] } },
{ "type": "Feature", "properties": { "cve_estac": "MER", "nom_estac": "Merced", "longitud": "-99.119594", "latitud": "19.42461", "alt": "2245", "obs_estac": null, "id_station": "484090170127" }, "geometry": { "type": "Point", "coordinates": [ -99.119594, 19.42461 ] } },
{ "type": "Feature", "properties": { "cve_estac": "MGH", "nom_estac": "Mguel Hidalgo", "longitud": "-99.20266", "latitud": "19.40405", "alt": "2327", "obs_estac": null, "id_station": "484090160609" }, "geometry": { "type": "Point", "coordinates": [ -99.20266, 19.40405 ] } },
{ "type": "Feature", "properties": { "cve_estac": "MIN", "nom_estac": "Metro Insurgentes", "longitud": "-99.162885", "latitud": "19.42144", "alt": "2231", "obs_estac": "Finalizó operación en 2007", "id_station": "484090150201" }, "geometry": { "type": "Point", "coordinates": [ -99.162885, 19.42144 ] } },
{ "type": "Feature", "properties": { "cve_estac": "MON", "nom_estac": "Montecillo", "longitud": "-98.902853", "latitud": "19.460415", "alt": "2252", "obs_estac": null, "id_station": "484150990113" }, "geometry": { "type": "Point", "coordinates": [ -98.902853, 19.460415 ] } },
{ "type": "Feature", "properties": { "cve_estac": "MPA", "nom_estac": "Milpa Alta", "longitud": "-98.990189", "latitud": "19.1769", "alt": "2594", "obs_estac": null, "id_station": "484090090104" }, "geometry": { "type": "Point", "coordinates": [ -98.990189, 19.1769 ] } },
{ "type": "Feature", "properties": { "cve_estac": "NET", "nom_estac": "Netzahualcoyotl", "longitud": "-99.026119", "latitud": "19.42115", "alt": "2230", "obs_estac": "Finalizó operación en 2000", "id_station": "484150580201" }, "geometry": { "type": "Point", "coordinates": [ -99.026119, 19.42115 ] } },
{ "type": "Feature", "properties": { "cve_estac": "NEZ", "nom_estac": "Nezahualcóyotl", "longitud": "-99.028212", "latitud": "19.393734", "alt": "2235", "obs_estac": null, "id_station": "484150580115" }, "geometry": { "type": "Point", "coordinates": [ -99.028212, 19.393734 ] } },
{ "type": "Feature", "properties": { "cve_estac": "PED", "nom_estac": "Pedregal", "longitud": "-99.204136", "latitud": "19.325146", "alt": "2326", "obs_estac": null, "id_station": "484090100127" }, "geometry": { "type": "Point", "coordinates": [ -99.204136, 19.325146 ] } },
{ "type": "Feature", "properties": { "cve_estac": "PER", "nom_estac": "La Perla", "longitud": "-98.991858", "latitud": "19.38286", "alt": "2237", "obs_estac": "Finalizó operación en 2011", "id_station": "484150580303" }, "geometry": { "type": "Point", "coordinates": [ -98.991858, 19.38286 ] } },
{ "type": "Feature", "properties": { "cve_estac": "PLA", "nom_estac": "Plateros", "longitud": "-99.200109", "latitud": "19.365869", "alt": "2345", "obs_estac": "Finalizó operación en 2010", "id_station": "484090100209" }, "geometry": { "type": "Point", "coordinates": [ -99.200109, 19.365869 ] } },
{ "type": "Feature", "properties": { "cve_estac": "POT", "nom_estac": "Portales", "longitud": "-99.145766", "latitud": "19.376494", "alt": "2237", "obs_estac": "Finalizó operación en 1996", "id_station": "484090140102" }, "geometry": { "type": "Point", "coordinates": [ -99.145766, 19.376494 ] } },
{ "type": "Feature", "properties": { "cve_estac": "SAG", "nom_estac": "San Agustín", "longitud": "-99.030324", "latitud": "19.532968", "alt": "2241", "obs_estac": null, "id_station": "484150330327" }, "geometry": { "type": "Point", "coordinates": [ -99.030324, 19.532968 ] } },
{ "type": "Feature", "properties": { "cve_estac": "SFE", "nom_estac": "Santa fe", "longitud": "-99.262865", "latitud": "19.357357", "alt": "2599", "obs_estac": null, "id_station": "484090040309" }, "geometry": { "type": "Point", "coordinates": [ -99.262865, 19.357357 ] } },
{ "type": "Feature", "properties": { "cve_estac": "SHA", "nom_estac": "Secretaría de Hacienda", "longitud": "-99.207868", "latitud": "19.446203", "alt": "2272", "obs_estac": null, "id_station": "484090160202" }, "geometry": { "type": "Point", "coordinates": [ -99.207868, 19.446203 ] } },
{ "type": "Feature", "properties": { "cve_estac": "SJA", "nom_estac": "San Juan Aragón", "longitud": "-99.086095", "latitud": "19.452592", "alt": "2258", "obs_estac": null, "id_station": "484090050701" }, "geometry": { "type": "Point", "coordinates": [ -99.086095, 19.452592 ] } },
{ "type": "Feature", "properties": { "cve_estac": "SNT", "nom_estac": "San Nicolas Totolapan", "longitud": "-99.256462", "latitud": "19.250385", "alt": "2946", "obs_estac": null, "id_station": "484090080104" }, "geometry": { "type": "Point", "coordinates": [ -99.256462, 19.250385 ] } },
{ "type": "Feature", "properties": { "cve_estac": "SUR", "nom_estac": "Santa Ursula", "longitud": "-99.149994", "latitud": "19.31448", "alt": "2279", "obs_estac": null, "id_station": "484090030109" }, "geometry": { "type": "Point", "coordinates": [ -99.149994, 19.31448 ] } },
{ "type": "Feature", "properties": { "cve_estac": "TAC", "nom_estac": "Tacuba", "longitud": "-99.202455", "latitud": "19.453907", "alt": "2275", "obs_estac": "Finalizó operación en 2010", "id_station": "484090160309" }, "geometry": { "type": "Point", "coordinates": [ -99.202455, 19.453907 ] } },
{ "type": "Feature", "properties": { "cve_estac": "TAH", "nom_estac": "Tlahuac", "longitud": "-99.010564", "latitud": "19.246459", "alt": "2297", "obs_estac": null, "id_station": "484090130309" }, "geometry": { "type": "Point", "coordinates": [ -99.010564, 19.246459 ] } },
{ "type": "Feature", "properties": { "cve_estac": "TAX", "nom_estac": "Taxqueña", "longitud": "-99.123204", "latitud": "19.335689", "alt": "2242", "obs_estac": "Finalizó operación en 2010", "id_station": "484090030201" }, "geometry": { "type": "Point", "coordinates": [ -99.123204, 19.335689 ] } },
{ "type": "Feature", "properties": { "cve_estac": "TEC", "nom_estac": "Cerro del Tepeyac", "longitud": "-99.114229", "latitud": "19.487227", "alt": "2265", "obs_estac": null, "id_station": "484090050404" }, "geometry": { "type": "Point", "coordinates": [ -99.114229, 19.487227 ] } },
{ "type": "Feature", "properties": { "cve_estac": "TLA", "nom_estac": "Tlalnepantla", "longitud": "-99.204597", "latitud": "19.529077", "alt": "2311", "obs_estac": null, "id_station": "484151040115" }, "geometry": { "type": "Point", "coordinates": [ -99.204597, 19.529077 ] } },
{ "type": "Feature", "properties": { "cve_estac": "TLI", "nom_estac": "Tultitlán", "longitud": "-99.177173", "latitud": "19.602542", "alt": "2313", "obs_estac": null, "id_station": "484151090101" }, "geometry": { "type": "Point", "coordinates": [ -99.177173, 19.602542 ] } },
{ "type": "Feature", "properties": { "cve_estac": "TPN", "nom_estac": "Tlalpan", "longitud": "-99.184177", "latitud": "19.257041", "alt": "2522", "obs_estac": null, "id_station": "484090120209" }, "geometry": { "type": "Point", "coordinates": [ -99.184177, 19.257041 ] } },
{ "type": "Feature", "properties": { "cve_estac": "UAX", "nom_estac": "UAM Xochimilco", "longitud": "-99.103629", "latitud": "19.304441", "alt": "2246", "obs_estac": null, "id_station": "484090030401" }, "geometry": { "type": "Point", "coordinates": [ -99.103629, 19.304441 ] } },
{ "type": "Feature", "properties": { "cve_estac": "UIZ", "nom_estac": "UAM Iztapalapa", "longitud": "-99.07388", "latitud": "19.360794", "alt": "2221", "obs_estac": null, "id_station": "484090070219" }, "geometry": { "type": "Point", "coordinates": [ -99.07388, 19.360794 ] } },
{ "type": "Feature", "properties": { "cve_estac": "UNM", "nom_estac": "Unidad Movil", "longitud": "-99.147137", "latitud": "19.482238", "alt": null, "obs_estac": null, "id_station": "484090000099" }, "geometry": { "type": "Point", "coordinates": [ -99.147137, 19.482238 ] } },
{ "type": "Feature", "properties": { "cve_estac": "VAL", "nom_estac": "Vallejo", "longitud": "-99.165702", "latitud": "19.522437", "alt": "2248", "obs_estac": "Finalizó operación en 2010", "id_station": "484090050501" }, "geometry": { "type": "Point", "coordinates": [ -99.165702, 19.522437 ] } },
{ "type": "Feature", "properties": { "cve_estac": "VIF", "nom_estac": "Villa de las Flores", "longitud": "-99.09659", "latitud": "19.658223", "alt": "2242", "obs_estac": null, "id_station": "484150200109" }, "geometry": { "type": "Point", "coordinates": [ -99.09659, 19.658223 ] } },
{ "type": "Feature", "properties": { "cve_estac": "XAL", "nom_estac": "Xalostoc", "longitud": "-99.0824", "latitud": "19.525995", "alt": "2160", "obs_estac": null, "id_station": "484150330415" }, "geometry": { "type": "Point", "coordinates": [ -99.0824, 19.525995 ] } },
{ "type": "Feature", "properties": { "cve_estac": "XCH", "nom_estac": "Xochimilco", "longitud": "-99.118252", "latitud": "19.267066", "alt": "2243", "obs_estac": "Finalizó operación en 1999", "id_station": "484090130102" }, "geometry": { "type": "Point", "coordinates": [ -99.118252, 19.267066 ] } },
{ "type": "Feature", "properties": { "cve_estac": "FAR", "nom_estac": "FES Aragón", "longitud": "-99.046176", "latitud": "19.473692", "alt": "2230", "obs_estac": null, "id_station": "484800150584" }, "geometry": { "type": "Point", "coordinates": [ -99.046176, 19.473692 ] } },
{ "type": "Feature", "properties": { "cve_estac": "SAC", "nom_estac": "Santiago Acahualtepec", "longitud": "-99.009381", "latitud": "19.34561", "alt": "2293", "obs_estac": null, "id_station": "484800090073" }, "geometry": { "type": "Point", "coordinates": [ -99.009381, 19.34561 ] } }
]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,10 +2,10 @@
* Copyright 2021 - All rights reserved.
* Rodrigo Tapia-McClung
*
* February-June 2021
* February-July 2021
*/
/* global mapboxgl, turf */
/* global mapboxgl, turf, Papa */
const windowUrl = new URL(window.location.href);
const baseUrl = windowUrl.hostname == "localhost" ?
......@@ -20,14 +20,36 @@ let cdmx, estaciones, ozono, fechas,
playing = false,
animate;
// Read CDMX boundaries
fetch(`${baseUrl}/data/cdmx.geojson`)
.then(response => response.json())
.then(d => cdmx = d);
fetch(`${baseUrl}/data/estaciones.geojson`)
.then(response => response.json())
.then(d => estaciones = d);
// Read and parse csv station data
fetch(`${baseUrl}/data/cat_estacion.csv`)
.then(response => response.arrayBuffer())
.then(d => new TextDecoder("iso-8859-1").decode(d).split("\r\n"))
.then(d => { // arrange elements as a decent array
let array = [];
d.forEach( d => array.push(d.split(",")));
let array2 = array.slice(1, -1); // remove spurious first and last line
const [keys, ...values] = array2; // deconstruct
let estacionesCSV = values.map( array2 => // create useful object of key:value pairs for each station
array2.reduce((a, v, i) => ({ ...a, [keys[i]]: v }), {})
);
let estacionesArray = [];
estacionesCSV.forEach( e => { // create features for feature collection
let location = turf.point([+e.longitud, +e.latitud], {
cve_estac: e.cve_estac,
nom_estac: e.nom_estac,
longitud: +e.longitud,
latitud: +e.latitud,
alt: +e.alt
});
estacionesArray.push(location);
});
estaciones = turf.featureCollection(estacionesArray);
});
const papaPromise = url => {
return new Promise(function (resolve, reject) {
......@@ -36,19 +58,14 @@ const papaPromise = url => {
header: true,
skipEmptyLines: true,
complete: resolve,
error: reject,
encoding: "UTF8"
});
});
}
let ozonoPromise = papaPromise(`${baseUrl}/data/ozono.csv`); // ozono es en ppb: 10^12
// FIXME: check and fix date order in data
/*const getOzono = fetch(`${baseUrl}/ozono.csv`)
.then(response => response.text())
.then(d => Papa.parse(d))
.catch(err => console.log(err))
getOzono.then(d => ozono = d.data);
*/
// read ozono csv data
let ozonoPromise = papaPromise(`${baseUrl}/data/O3.csv`); // ozono es en ppb: 10^12
let map = new mapboxgl.Map({
"container": "mexmap",
......@@ -61,14 +78,13 @@ let map = new mapboxgl.Map({
});
map.addControl(new mapboxgl.NavigationControl());
// map language - doesn't quite work
/*map.addControl(new MapboxLanguage({
defaultLanguage: 'es'
}));*/
// TODO: display more friendly dates
const dateTimeOptions = {
/*const dateTimeOptions = {
weekday: "short",
day: "numeric",
month:"short",
......@@ -79,11 +95,33 @@ const dateTimeOptions = {
//minute: '2-digit',
hour12: false,
timeZone: 'America/Mexico_City'
};
};*/
//let myDate = "1577919600000";
//let myDate = "1605218400000";
const transpose = values => {
if (!Array.isArray(values))
throw new Error("`values` must be an array");
if (values.length === 0)
return {};
const keys = Object.keys(values[0]);
const transposed = {
data: {},
count: values.length,
};
keys.forEach(key => {
transposed.data[key] = [];
values.forEach(value => {
transposed.data[key].push(value[key]);
});
});
return transposed;
}
const range = (start, stop, step = 1) =>
Array(Math.ceil((stop - start) / step)).fill(start).map((x, y) => x + y * step);
......@@ -101,7 +139,6 @@ const intersect = (fc1, fc2) => {
}
const makeSurface = date => {
//map.getSource("estaciones").serialize().data
// filter data for given date value
let subdata = ozono.map(d => { return {time: d["time"], [date]: d[date]} });
let maxValue = Math.max.apply(Math, subdata.map( d=> d[date]));
......@@ -109,12 +146,13 @@ const makeSurface = date => {
turf.featureEach(estaciones, point => {
let stationData = subdata.filter( i => i.time == point.properties.cve_estac);
point.properties.calidad = stationData[0] && parseFloat(stationData[0][date]) != -99 ? parseFloat(stationData[0][date]) : 0;
// TODO: remove station instead of assigning value to 0 when value = -99?
// use value to style station dot
map.setFeatureState(
{
// source tileset and source layer
// source tileset and source layer: sourceLayer is needed only if using mbtiles
source: "estaciones",
sourceLayer: "estaciones",
//sourceLayer: "estaciones",
// unique ID row name
id: point.properties.cve_estac
},
......@@ -129,7 +167,7 @@ const makeSurface = date => {
let options = {gridType: "point", property: "calidad", units: "kilometers", weight: 2};
let grid = turf.interpolate(estaciones, 0.75, options);
let breaks = range(0, maxValue != -99 ? maxValue : 0 + 1, 5);
let breaks = range(0, maxValue != -99 ? maxValue : 1, 5);
//let lines = turf.isolines(grid, breaks, {zProperty: "calidad"});
let bValues = breaks.map( b => { return {value: b} });
let bands = turf.isobands(grid, breaks, {zProperty: "calidad", breaksProperties: bValues});
......@@ -157,10 +195,17 @@ const run = () => {
map.on("style.load", async () => {
map.addSource("estaciones", {
// add vector tile source
/*map.addSource("estaciones", {
"type": "vector",
"tiles": [`${baseUrl}/estaciones/mbtiles/{z}/{x}/{y}.pbf`],
promoteId: "cve_estac"
});*/
// or geojson source
map.addSource("estaciones", {
type: "geojson",
data: estaciones,
promoteId: "cve_estac"
});
map.addSource("interpolation", {
......@@ -190,9 +235,26 @@ map.on("style.load", async () => {
clearInterval(animate);
}
});
// after reading ozono csv
ozonoPromise.then( results => {
ozono = results.data;
fechas = Object.keys(ozono[0]).slice(1,-1).map(d => parseInt(d));
let data = results.data;
data.forEach( d => d.time = Date.parse(new Date(`${d.FECHA} ${d.HORA}:0:0`))); // calculate new time
let transposed = transpose(data).data; // transpose data
// TODO: make everything without transposing data?
let stations = Object.keys(transposed).filter(
s => s != "FECHA" && s != "HORA" && s != "time" // ignore unwanted keys
);
ozono = [];
stations.forEach( station => { // create appropriate object structure
let obj = {};
obj["time"] = station;
transposed.time.forEach((time, index) => {
obj[time] = transposed[station][index];
});
ozono.push(obj);
});
fechas = Object.keys(ozono[0]).slice(1, -1).map(d => parseInt(d));
slider.min = fechas[0];
slider.max = fechas[fechas.length-1];
slider.step = 3600000;
......@@ -203,20 +265,6 @@ map.on("style.load", async () => {
let maxValue = Math.max(...ozono.map( d => Object.values(d)).flat().filter(val => !isNaN(val)));
/*let expression = ["match", ["get", "cve_estac"]];
results.data.forEach( row => {
map.setFeatureState(
{
// source tileset and source layer
source: "estaciones",
sourceLayer: "estaciones",
// unique ID row name
id: row.time
},
// Add rows you want to style/interact with
{
calidad: parseFloat(row[fechas[0]]) != -99 ? parseFloat(row[fechas[0]]) : 0
//candidate: row.candidate,
}
);
var green = (parseFloat(row[myDate]) / maxValue) * 255;
var color = "rgba(" + 0 + ", " + green + ", " + 0 + ", 1)";
expression.push(row["time"], color);
......@@ -242,7 +290,7 @@ map.on("style.load", async () => {
"id": "estaciones-circle",
"type": "circle",
"source": "estaciones",
"source-layer": "estaciones",
//"source-layer": "estaciones",
"layout": {},
"paint": {
"circle-radius": 4,
......@@ -359,6 +407,7 @@ map.on("style.load", async () => {
.setHTML("Estación: " + estacion + "<br/>Clave: " + cve_estac + "<br/>Valor: " + calidad)
.addTo(map);
});
// TODO: update popup value when already hovered on
// Remove popup on mouse out
map.on("mouseleave", "estaciones-circle", () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment