mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[File upload] Rename geo-shape field to geometry (#120023)
This commit is contained in:
parent
ae12131aca
commit
f4bfd4dfc0
3 changed files with 5 additions and 5 deletions
|
@ -105,7 +105,7 @@ export class JsonUploadAndParse extends Component<FileUploadComponentProps, Stat
|
|||
} as unknown as Settings;
|
||||
const mappings = {
|
||||
properties: {
|
||||
coordinates: {
|
||||
geometry: {
|
||||
type: this.state.geoFieldType,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -225,7 +225,7 @@ describe('toEsDoc', () => {
|
|||
test('should convert feature to geo_point ES document', () => {
|
||||
const esDoc = toEsDoc(FEATURE_COLLECTION.features[0], ES_FIELD_TYPES.GEO_POINT);
|
||||
expect(esDoc).toEqual({
|
||||
coordinates: [-112.0372, 46.608058],
|
||||
geometry: [-112.0372, 46.608058],
|
||||
population: 200,
|
||||
});
|
||||
});
|
||||
|
@ -233,7 +233,7 @@ describe('toEsDoc', () => {
|
|||
test('should convert feature to geo_shape ES document', () => {
|
||||
const esDoc = toEsDoc(FEATURE_COLLECTION.features[0], ES_FIELD_TYPES.GEO_SHAPE);
|
||||
expect(esDoc).toEqual({
|
||||
coordinates: {
|
||||
geometry: {
|
||||
type: 'Point',
|
||||
coordinates: [-112.0372, 46.608058],
|
||||
},
|
||||
|
@ -244,7 +244,7 @@ describe('toEsDoc', () => {
|
|||
test('should convert GeometryCollection feature to geo_shape ES document', () => {
|
||||
const esDoc = toEsDoc(GEOMETRY_COLLECTION_FEATURE, ES_FIELD_TYPES.GEO_SHAPE);
|
||||
expect(esDoc).toEqual({
|
||||
coordinates: {
|
||||
geometry: {
|
||||
type: 'GeometryCollection',
|
||||
geometries: [
|
||||
{
|
||||
|
|
|
@ -375,7 +375,7 @@ export function toEsDoc(
|
|||
) {
|
||||
const properties = feature.properties ? feature.properties : {};
|
||||
return {
|
||||
coordinates:
|
||||
geometry:
|
||||
geoFieldType === ES_FIELD_TYPES.GEO_SHAPE
|
||||
? feature.geometry
|
||||
: (feature.geometry as Point).coordinates,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue