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

Fix -l, --geometry-count option #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

omarkhan
Copy link

Fixes #7.

Steps to reproduce

  1. Find a GeoJSON file with >1 feature
  2. Split into separate files for each feature with geojsplit --geometry-count 1

Expected behavior

1 file per feature.

Actual behavior

2 files per feature.

Fix

The bug comes from here:

geojsplit/bin/geojsplit

Lines 201 to 202 in a4344c4

geometries = [data];
geometryCount = 0;

The geometries array has a single entry, but we're setting geometryCount to 0.

This fixes the bug by removing the geometryCount variable and using geometries.length instead.

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.

incorrect -l parameter
1 participant