Map coordinates from geo_point to geo_shape

77 views
Skip to first unread message

Guillaume ALLEE

unread,
Nov 2, 2014, 5:40:01 PM11/2/14
to ogr2elas...@googlegroups.com
Hi,

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.

Has someone manage to map to geo_shape coordinates  ?

Adam Estrada

unread,
Nov 3, 2014, 8:37:02 AM11/3/14
to ogr2elas...@googlegroups.com
Hello! I have not seen this error before but will look in to it later this week. I suggest checking GDAL out of trunk and build it from there. This code was included in core GDAL about 2 years ago and there have been many improvements from the community. Please let me know what you find...

Cheers,
Adam


--
You received this message because you are subscribed to the Google Groups "ogr2elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ogr2elasticsea...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Guillaume ALLEE

unread,
Nov 3, 2014, 5:17:23 PM11/3/14
to ogr2elas...@googlegroups.com
After looking at the code it seems that with the current one, it is
not possible to change the coordinates types: the driver always push a
geopoint whatever the geometry it receives as input. This is what I
understand from line 219-220 but I have not read C code for a long
time ;-)

http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/elastic/ogrelasticlayer.cpp#L219
Reply all
Reply to author
Forward
0 new messages