[gdal-dev] [Elasticsearch driver] Map coordinates from geo_point to geo_shape

Guillaume ALLEE guillaume.allee at gmail.com
Mon Nov 3 14:07:46 PST 2014


Hello,

I am trying to map the coordinates from my shp files to geo_shape,
geo_point being the default

So the default mapping file is :

            "geometry": {
                "properties": {
                    "type": {
                        "store": "yes",
                        "type": "string"
                    },
                    "coordinates": {
                        "store": "yes",
                        "type": "geo_point"
                    }
                }
            }

And the update I have done is in the mapping is

            "geometry": {
                "properties": {
                    "type": {
                        "store": "yes",
                        "type": "string"
                    },
                    "coordinates": {
                        "store": "yes",
                        "type": "geo_shape",
                         "tree": "quadtree",
                        "precision": "1m"
                    }
                }
            }

My import is working with geopoint and I did check with ES API that my
updated mapping is OK.

However, when I run my import line ogr2ogr -progress --config
ES_OVERWRITE 1 --config ES_META ./map_geoshape.json -f "ElasticSearch"
http://localhost:9200/ my_shp.shp
I have lot of ERROR 1: HTTP error code : 400.

I have looked at the code and it seems that the driver is storing in
ES a point whatever geometry it receives input and that you cannot
change the mapping on that field.

By any chance has someone a patch to change the behaviour to store the
"real" geometry in ES :-D ?

BR,

Guillaume


More information about the gdal-dev mailing list