Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Juan Pablo Kutianski jkutianski

🏠
Working from home
View GitHub Profile
@jkutianski
jkutianski / extractFeatures.js
Created August 7, 2013 19:37
Dirty hack to extract features from geoJSON files. Useful to split geoJSON based on equal propertires.
View extractFeatures.js
// Sample use: node extractFeatures.js argentina.json "properties.is_in:state.toLowerCase() === 'buenos Aires'" > buenos_aires.json
var path = require('path'),
origin = require(path.resolve(__dirname, process.argv[2])),
selector = process.argv[3],
destination = {
"type": "FeatureCollection",
"features": []
},
i=0;
@jkutianski
jkutianski / mergeFeatures.js
Created August 8, 2013 04:45
Dirty hack to merge geoJSON feature.
View mergeFeatures.js
// Sample use: node mergeFeatures.js argentina.json buenos_aires.json > argentina_merged.json
var origin1 = require(path.resolve(__dirname, process.argv[2])),
origin2 = require(path.resolve(__dirname, process.argv[3])),
destination = {
"type": "FeatureCollection",
"features": []
};
destination.features = origin1.features.concat(origin2.features);
@jkutianski
jkutianski / README.md
Last active December 23, 2015 02:48
Comparación entre proyección mercator y mercator transversa para la Argentina
View README.md

A la proyección mercator es necesario ajustarle 2°por la deformación existente el la parte sur de la Argentina.

@jkutianski
jkutianski / README.md
Last active December 23, 2015 06:09
Fajas y meridianos de la proyección Gauss-Kruger para la Argentina
View README.md

Con el fin de reducir las deformaciones en el sentido Este-Oeste a valores insensibles a los usos cartográficos de precisión, Krüger redujo el ancho de las fajas a 3° de longitud (1° 30’ a la izquierda y 1° 30’ a la derecha del meridiano central de cada faja)y para esos meridianos centrales eligió aquellos cuyos números de grados son múltiples de 3° de longitud. En el caso de la República Argentina, los meridianos centrales tienen los siguientes valores: -72°, -69°, -66°, -63°, -60°,-57° y -54°.

@jkutianski
jkutianski / README.md
Last active December 23, 2015 10:08 — forked from mbostock/.block
Scatterplot w/label selectors
View README.md
@jkutianski
jkutianski / README.md
Last active December 23, 2015 10:09 — forked from mbostock/.block
Scatterplot w/toggle label selectors
View README.md
@jkutianski
jkutianski / README.md
Last active December 27, 2015 12:49 — forked from JnBrymn/index.html
My attempt to add templating to d3.js
@jkutianski
jkutianski / README.md
Last active December 28, 2015 08:59
A new attempt to add templating to d3.js
View README.md

D3.js templating test based on my previous solution of John Berryman's attempt.

ICahnHaz.js uses <script></script> and I preffer the idea of Eric Bidelman. The <template> element is currently supported in Chrome, Firefox and Opera (15+)for now.

Because the use of innerHTML run-time string parsing of user-supplied data can easily lead to XSS vulnerabilities and isn't supported by SVGElement, I use now XMLSerializer() and DOMParser() to inject the templates into the DOM. The callTemplate function uses querySelector and isn't limitted to Mustache.

Fork me @ GITHUB

@jkutianski
jkutianski / README.md
Last active December 28, 2015 20:19
A new attempt to add templating to d3.js
View README.md

D3.js templating test based on my previous solution of John Berryman's attempt.

The HTMLTemplateElement is currently supported in Chrome, Firefox and Opera (15+) for now. See Eric Bidelman HTMLTemplateElement tuturial

I change the idea of use HTMLTemplateElement.content because is only supported by 3 browsers . I'm using HTMLElement.innerHTML to read the template content and DOMParser() to inject the result into the DOM. To hide the content of <template> (HTMLUnknownElement) on other browsers (Safari, IE, etc) I add a CSS rule with display:none. On browsers that support HTMLTemplateElement the <script> isn't fired when the browser parse the document, but is different on HTMLUnknownElements. If someone know how to break the script execution on HTMLUnknownElements please send me a tweet @baldpower

[Fork me

@jkutianski
jkutianski / area_selvatica_paises_v1km2_porci.csv
Last active February 19, 2016 01:07 — forked from HuVas/area_selvatica_paises_v1km2_porci.csv
Correlación del porcentaje del territorio forestal vs. su extensión en millones de km2. Año 2013.
View area_selvatica_paises_v1km2_porci.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 81 columns, instead of 24. in line 1.
country_name,country_code,grupo,porc_1990,porc_1991,porc_1992,porc_1993,porc_1994,porc_1995,porc_1996,porc_1997,porc_1998,porc_1999,porc_2000,porc_2001,porc_2002,porc_2003,porc_2004,porc_2005,porc_2006,porc_2007,porc_2008,porc_2009,porc_2010,porc_2011,porc_2012,porc_2013,km2_1961,km2_1962,km2_1963,km2_1964,km2_1965,km2_1966,km2_1967,km2_1968,km2_1969,km2_1970,km2_1971,km2_1972,km2_1973,km2_1974,km2_1975,km2_1976,km2_1977,km2_1978,km2_1979,km2_1980,km2_1981,km2_1982,km2_1983,km2_1984,km2_1985,km2_1986,km2_1987,km2_1988,km2_1989,km2_1990,km2_1991,km2_1992,km2_1993,km2_1994,km2_1995,km2_1996,km2_1997,km2_1998,km2_1999,km2_2000,km2_2001,km2_2002,km2_2003,km2_2004,km2_2005,km2_2006,km2_2007,km2_2008,km2_2009,km2_2010,km2_2011,km2_2012,km2_2013,km2_2014
Afganistán,AFG,0,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.0678246