Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Mar 4, 2021
1 parent 0fd2611 commit a0ff6dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,15 @@ describe('previewFile', () => {
});

describe('toEsDoc', () => {
test('should convert features to geo_point ES document', () => {
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],
population: 200,
});
});

test('should convert features to geo_shape ES document', () => {
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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ES_FIELD_TYPES } from '../../../../../../src/plugins/data/public';
import { geoJsonCleanAndValidate } from './geojson_clean_and_validate';
import { ImportDoc, ImportFailure, ImportResponse, MB } from '../../../common';

const IMPORT_CHUNK_SIZE_MB = 5 * MB;
const BLOCK_SIZE_MB = 5 * MB;
export const GEOJSON_FILE_TYPES = ['.json', '.geojson'];

export interface GeoJsonPreview {
Expand Down Expand Up @@ -96,7 +96,7 @@ export class GeoJsonImporter extends Importer {

// Read file in blocks to avoid loading too much of file into memory at a time
while ((this._features.length > 0 || this._hasNext) && this._isActive) {
await this._readUntil(undefined, IMPORT_CHUNK_SIZE_MB);
await this._readUntil(undefined, BLOCK_SIZE_MB);
if (!this._isActive) {
return {
success: false,
Expand Down

0 comments on commit a0ff6dd

Please sign in to comment.