Tile Map doesn't show results on map using geopoint


(Daniel Mattsson) #1

Hi,

I'm trying to create a Tile Map using my geopoint data in ES.

This is how I've set up the map:

As you can see, the map has no results.

Looking in the details section, the ES request body looks like this:

{
"size": 0,
"query": {
"query_string": {
"query": "*",
"analyze_wildcard": true
}
},
"aggs": {
"2": {
"geohash_grid": {
"field": "geopoint",
"precision": 2
}
}
}
}

The response looks like this:

{
"took": 2,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 0,
"hits": []
},
"aggregations": {
"2": {
"buckets": []
}
}
}

As you can see, there are 2 hits.

This is how my data looks like in ES viewed in Kibana:

As you can see here, I've done the mapping of the field to be geopoint. I started with just the latlon-values, and then tried to add the geohash representation to see if that would work. I would prefer to only use latlon at the end.

Why doesn't the map result show?

Thanks!


(Joe Fleming) #2

I suspect the issue may be related to the geohash property in the document values, but that's mostly just a guess.

It's easy enough to confirm though - simply add another field with the same geo data, without the geohash property, and see if that works correctly with the TileMap.

It's also possible, though I think unlikely, that the field mapping is wrong. Check the output from /test/_mapping/field/geopoint against Elasticsearch, and see if the type is in fact geo_point.


(Daniel Mattsson) #3

Thank you for the quick answer.

I tried first without the geohash field without any success, so I tried with that as well.

The mapping reply from /test/_mapping/field/geopoint looks like this, which is made by me manually, and I think this is correct:

{"test":{"mappings":{"“location”":{"geopoint":{"full_name":"geopoint","mapping":{"geopoint":{"type":"geo_point","lat_lon":true,"geohash":true}}}}}}}


(Daniel Mattsson) #4

Looking closely at my reply from the mapping request, I can now see that there are double quotes around the "location" field. This is the discrepancy when using a Mac and it's not using default double quotes in the text editor. When removing the index, and adding mapping without these faulty double quotes, it works. Thanks for the help!


(system) #5