Skip to main content
Solved

Error to write Polygon in ElasticSearch


danilo_fme
Evangelist
Forum|alt.badge.img+41

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)

 

View original
Did this help you find an answer to your question?

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
jakemolnar wrote:

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
Evangelist
Forum|alt.badge.img+41
  • Author
  • Evangelist
  • October 26, 2017
jakemolnar wrote:
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!!!

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings