Skip to content

Instantly share code, notes, and snippets.

View florinvirdol's full-sized avatar

Florin Eisenhower florinvirdol

View GitHub Profile
@florinvirdol
florinvirdol / ElasticSearch spatial queries points in shapes or all the shapes in shapes with Geo query.cs
Last active March 3, 2021 16:44
Ways to get all the points in shapes or all the shapes in shapes with Geo query (geo_shape) with multiple pre-indexed shape with big geo-spatial data in ElasticSearch?
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection.Metadata;
using System.Runtime.ExceptionServices;
using System.Runtime.Serialization.Formatters.Binary;
/*
Mostly copied and adapted from RussCam's GIST: https://gist.github.com/russcam/5c40e5c6fb95b9afd9242df675fce428
*/
/*
Questions:
1. Regarding not working scenarios (#3, #4, #5) how can i deserialize a GeoJson string into a Geometry object?
2. Regarding Scenario #6, why GeometryCollection data isn't visibile on Kibana Map like simple Geometry (Polygons)?
- 2.1. Don't know if it's related, but when dragging on Kibana Maps i get this error:
`Error {message: "Input data given to 'cfe5e9a5-de63-4beb-85b2-4b67ad455ae9' is not a valid GeoJSON object."}