# Issue with geo\_shape (Java API)

**URL:** <https://discuss.elastic.co/t/issue-with-geo-shape-java-api/22945>\
**Category:** Elasticsearch\
**Created:** [March 27, 2015, 1:23pm UTC](https://discuss.elastic.co/t/issue-with-geo-shape-java-api/22945 "2015-03-27T13:23:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cornet\_remi](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@cornet\_remi](https://discuss.elastic.co/u/cornet_remi)\
**Post date:** [March 27, 2015, 1:23pm UTC](https://discuss.elastic.co/t/issue-with-geo-shape-java-api/22945/1 "2015-03-27T13:23:34Z")

</div>

Hi everyone,

I currently have a problem with geo\_shape data

I have the following mapping :

"mappings": {  
"street": {  
"properties": {  
"countrySubdivision": {  
"type": "string"  
},  
"municipalitySubdivision": {  
"type": "string"  
},

```
            ...

```

_"geom": { "type": "geo\_shape",  
"tree": "quadtree", "precision": "1m" }_  
}  
}  
}

I indexed my data and made some queries (directly through ElasticSearch  
API) to test the mapping and it gave me good results :

```
     {
        "_index": "beladdress",
        "_type": "street",
        "_id": "AUxbKUAzu9vYuuKJN8Ez",
        "_score": 4.6158404,
        "_source": {
           "countrySubdivision": "Vlaanderen",
           "municipalitySubdivision": "Ronse"

```

_"geom": { "type": "multipoint",  
"coordinates": [ [  
50.75176461434321, 3.6213774507672163  
], [ 50.7517381346342,  
3.6214543962345838 ],  
..._  
}

The problem is : When I try to get the content of the fields through the  
Java API, It work for every fields _except for geom_ that returns a Null  
pointer exception :

When I create my query, I make sure to ask ElasticSearch to return every  
field I need :

....addFields("id", "label", "municipalitySubdivision", ... , "_geom_")

Then I try to get the value of each field.

...  
hit.field("municipalitySubdivision").getValue() =\> working  
hit.field("geom").getValue() =\> Null Pointer Exception  
...

Has anyone ever encountered this problem ? : )

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/322b3f88-9a1b-4456-9916-d398d11a993e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/322b3f88-9a1b-4456-9916-d398d11a993e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:23am UTC](https://discuss.elastic.co/t/issue-with-geo-shape-java-api/22945/2 "2017-07-06T00:23:28Z")

</div>


