# Querying 2D-geometry data

**URL:** https://discuss.elastic.co/t/querying-2d-geometry-data/73199
**Category:** Elasticsearch
**Created:** [January 30, 2017, 11:48am UTC](https://discuss.elastic.co/t/querying-2d-geometry-data/73199 "2017-01-30T11:48:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![manuschiller](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@manuschiller](https://discuss.elastic.co/u/manuschiller)
#### Post date: [January 30, 2017, 11:48am UTC](https://discuss.elastic.co/t/querying-2d-geometry-data/73199/1 "2017-01-30T11:48:09Z")

</div>

I got a huge amount of tracking data from a research study (26 Objects \* 25 frames per second \* 90 minutes \* 50 = ~175 500 000 records in my Database).

The reference system of the tracking data is a fixed environment of x\*y meters, and **not a geographical lat / long system**.

The schema (MySql) looks like this:

```
TABLE trackingdata:
uid(int) 
object_id(varchar)
coords(POINT(X Y)
voronoi_cell(POLYGON(...)
voronoi_area(float)
frame(int)
timekey (datetime)

```

I want to use elasticsearch to efficiently query and analyze (love kibana!) my data.

Since I don't have much experience with elasticsearch i was wondering if it can handle **geometric data (POINT, POLYGON)** or if it is restricted to to its gepoint-datatypes (geo **graphical** , not geometric) datatypes I found browsing the documentation ( [GeoPoint](https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html), [GeoShape](https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html) )

Would elasticsearch be capabable of finding records by an example query like this:  
"find all **voronoi\_cells** that are within a rectangle described by **coords** with a specific **voronoi\_area**"

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [January 31, 2017, 8:35am UTC](https://discuss.elastic.co/t/querying-2d-geometry-data/73199/2 "2017-01-31T08:35:44Z")

</div>

Hey,

IIRC the geo points/shapes are geographic for now. If it is possible to convert your data, you could use a custom tile server to visualize your data like in this example with the world being an ice hockey field [https://www.elastic.co/blog/kibana-and-a-custom-tile-server-for-nhl-data](https://www.elastic.co/blog/kibana-and-a-custom-tile-server-for-nhl-data)

--Alex

---

<div class="post-metadata">

### Author: ![manuschiller](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@manuschiller](https://discuss.elastic.co/u/manuschiller)
#### Post date: [January 31, 2017, 4:29pm UTC](https://discuss.elastic.co/t/querying-2d-geometry-data/73199/3 "2017-01-31T16:29:08Z")

</div>

thanks mate! that helped a lot

---

<div class="post-metadata">

### Author: ![manuschiller](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@manuschiller](https://discuss.elastic.co/u/manuschiller)
#### Post date: [February 6, 2017, 11:13am UTC](https://discuss.elastic.co/t/querying-2d-geometry-data/73199/4 "2017-02-06T11:13:31Z")

</div>

thanks again for your input. The visualization itself works like a charm with a custom tile server. But I am wondering if I can use all the query filters by elasticsearch for my cartesian 2D-data. Would I have to transform the data to the geodetic system (is that even possible?) or would the results be valid for my data as well?

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [February 6, 2017, 2:44pm UTC](https://discuss.elastic.co/t/querying-2d-geometry-data/73199/5 "2017-02-06T14:44:23Z")

</div>

Hey,

you would have to do some transformations yourself between your own mapping and the real world, so that the tile server approach works. This would have to be done on index and query time.

Hope this helps.

--Alex

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 6, 2017, 2:45pm UTC](https://discuss.elastic.co/t/querying-2d-geometry-data/73199/6 "2017-03-06T14:45:22Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
