Skip to content
This repository was archived by the owner on Jan 12, 2023. It is now read-only.
This repository was archived by the owner on Jan 12, 2023. It is now read-only.

geo shape json object support ? #50

@arun-pal2018

Description

@arun-pal2018

Can I get help for creating json object for geo shape. When tried to create json object for geo shape "polygon" with coordinates [[ [ 4.92, 52.40 ], [ 4.92, 52.30 ],[ 5.02, 52.30 ], [ 5.02, 52.40 ], [ 4.92, 52.40 ]]]. The ejson is throwing error :
** exception error: no case clause matching {error,"coordinates",throw,
{invalid_list_item,[[4.92,52.4],
[4.92,52.3],
[5.02,52.3],
[5.02,52.4],
[4.92,52.4]]}}
in function ejson_encode:convert/5 (src/ejson_encode.erl, line 80)
in call from ejson_encode:encode1/3 (src/ejson_encode.erl, line 53)
in call from ejson_encode:record_rule/5 (src/ejson_encode.erl, line 204)
in call from ejson_encode:convert/5 (src/ejson_encode.erl, line 80)
in call from ejson_encode:encode1/3 (src/ejson_encode.erl, line 53)
in call from ejson_encode:encode/3 (src/ejson_encode.erl, line 32)
in call from ejson:to_json/3 (src/ejson.erl, line 82)
in call from elasticsearch:add_new_entry/6 (src/elasticsearch.erl, line 108

The json document format is given below:
-json({document, {record, "geo_shape"},{string, "tag"},{ string, "geo_address"}}).
-json({geo_shape_location, {string, "type"}, {list, "coordinates"}}).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions