Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import KML: Manage Empty geometry import error #4080

Merged
merged 1 commit into from Jul 31, 2018

Conversation

ger-benjamin
Copy link
Member

@ger-benjamin ger-benjamin added this to the 2.3 milestone Jul 31, 2018
@ger-benjamin ger-benjamin self-assigned this Jul 31, 2018
}
// Look if the extent is valid (and so at least one geometry)
if (dataSource.extent[0] === Infinity) {
console.error('The file contains no geometry');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to keep this console.error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not specially, There is already a warning to the user that says "bad file".
Should I remove it ?

return;
}
// Look if the extent is valid (and so at least one geometry)
if (dataSource.extent[0] === Infinity) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the isEmpty function could be used:

import {isEmpty} from 'ol/extent.js';

if (isEmpty(dataSource.extent)) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@ger-benjamin ger-benjamin merged commit 76e59f7 into 2.3 Jul 31, 2018
@ger-benjamin ger-benjamin deleted the stop_import_bad_file branch July 31, 2018 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants