Skip to main content
Solved

Error to write Polygon in ElasticSearch

  • October 25, 2017
  • 3 replies
  • 25 views

danilo_fme
Celebrity
Forum|alt.badge.img+52

Hi,

I have a Workspace that Read two ( 2 ) files Polygons from Shapefile and generate with Success in ElasticSearch, but in Point geometry:

My question is: How can i respect the geometry from my Polygons and write polygons in ElasticSearch?

Attached the log file and Workspace template ( .fmwt ). -

Thanks,

Danilo

Best answer by jakemolnar

If you open up the writer feature type parameters, look for this setting:

Table > General > Type Mapping Creation Parameters > Geometry Fields

You should find a table of geometry fields and their types. Simply change the type of your geometry field from `geo_point` to `geo_shape`; this will cause the Elasticsearch writer to store your polygons as GeoJSON polygons rather than as the center point of the shape.

Certain Elasticsearch functionality can only be used with either `geo_point` or `geo_shape` geometry fields, so be sure to have a look at the Elasticsearch documentation on this subject (geo_point docs, geo_shape docs)

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

jakemolnar
Forum|alt.badge.img
  • Best Answer
  • October 25, 2017

If you open up the writer feature type parameters, look for this setting:

Table > General > Type Mapping Creation Parameters > Geometry Fields

You should find a table of geometry fields and their types. Simply change the type of your geometry field from `geo_point` to `geo_shape`; this will cause the Elasticsearch writer to store your polygons as GeoJSON polygons rather than as the center point of the shape.

Certain Elasticsearch functionality can only be used with either `geo_point` or `geo_shape` geometry fields, so be sure to have a look at the Elasticsearch documentation on this subject (geo_point docs, geo_shape docs)

 


jakemolnar
Forum|alt.badge.img
  • October 25, 2017

If you open up the writer feature type parameters, look for this setting:

Table > General > Type Mapping Creation Parameters > Geometry Fields

You should find a table of geometry fields and their types. Simply change the type of your geometry field from `geo_point` to `geo_shape`; this will cause the Elasticsearch writer to store your polygons as GeoJSON polygons rather than as the center point of the shape.

Certain Elasticsearch functionality can only be used with either `geo_point` or `geo_shape` geometry fields, so be sure to have a look at the Elasticsearch documentation on this subject (geo_point docs, geo_shape docs)

 

Oh, also, you'll need to overwrite your index. That's the only way to change the type of a field, and you are changing the geometry field type from `geo_point` to `geo_shape`.

 

 

To have a look at your type mapping, I believe you can run this in kibana console: `GET /polygon/city/_mapping`

 

 


danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Author
  • Celebrity
  • October 26, 2017
Oh, also, you'll need to overwrite your index. That's the only way to change the type of a field, and you are changing the geometry field type from `geo_point` to `geo_shape`.

 

 

To have a look at your type mapping, I believe you can run this in kibana console: `GET /polygon/city/_mapping`

 

 

@jakemolnar, thanks your help. It was powerful with my case.Congrat!!!