Skip to content

Instantly share code, notes, and snippets.

@thomasneirynck
thomasneirynck / geojson_to_index.js
Last active November 23, 2021 08:02
Ingest geojson file into Elasticsearch index. Each feature in the FeatureCollection corresponds to a document in Elasticsearch.
const fs = require("fs");
const elasticsearch = require('elasticsearch');
const oboe = require('oboe');
const geojsonInput = process.argv[2] || 'feature_collection.geojson';
const indexname = process.argv[3] || geojsonInput.split('.')[0] || 'feature_collection';
const geometryFieldName = 'geometry';
const shape_type = process.argv[4] || 'geo_shape';
if (shape_type !== 'geo_point' && shape_type !== 'geo_shape') {
This file has been truncated, but you can view the full file.
{
"type": "FeatureCollection",
"name": "csba",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::4269" } },
"features": [
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thomasneirynck
thomasneirynck / lens.ts
Last active May 28, 2025 22:24
Lens Chart Definition
interface LensChart {
attributes:
| {
visualizationType: 'lnsXY';
title: string;
description?: string;
state: {
datasourceStates: Record<string, unknown>;
query: any;
filters: any;
[
{
"type": "lens",
"embeddableConfig": { // naming refers to implementation detail
"enhancements": { // cruft
"dynamicActions": {
"events": []
}
},
"syncColors": false,// cruft
[
{
"type": "lens",
"config": {
"title": "Bar vertical stacked (ESQL)",
"visualizationType": "lnsXY",
"state": {
"dataSources": {
"27f63689-18d8-4356-b608-6da242da3b00": {
"type": "esql",