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

CLI streaming mode is broken #31

Open
ykessler opened this issue Sep 19, 2018 · 3 comments
Open

CLI streaming mode is broken #31

ykessler opened this issue Sep 19, 2018 · 3 comments

Comments

@ykessler
Copy link

ykessler commented Sep 19, 2018

CLI streaming mode is broken. When including the --stream option, the output is incorrect, and moreover the behavior changes depending on where the option flag is inserted.

EXAMPLE 1

geojson-merge test_1.geojson test_2.geojson > test_combined.geojson --stream

This results in a file test_combined.geojson that is smaller than test_1.geojson and is missing many of it's features. (I've attached all 3 files - need to remove the .txt extension because it wouldn't let me upload .geojson)

test_combined.geojson.txt
test_1.geojson.txt
test_2.geojson.txt

EXAMPLE 2

geojson-merge --stream test_1.geojson test_2.geojson > test_combined.geojson

Using streaming flag before args will cause first file to be excluded from merge.


(Version: 1.0.2)

@ykessler ykessler changed the title First file is excluded from merge if streaming option flag is used before args CLI streaming mode is broken Sep 20, 2018
@anphanngocvn
Copy link

@ykessler Did you resolve this? I have the same issue with my big geojson file. It is about 1GB

@ykessler
Copy link
Author

ykessler commented May 8, 2019

@AnnPhan Nope. I ended up doing it the old-fashioned way: I stripped the top level element from the geojson files, so that they were just rootless feature collections, and used trusty old cat command to combine them. Easy enough.

@vhf
Copy link

vhf commented Feb 11, 2020

@AnnPhan Nope. I ended up doing it the old-fashioned way: I stripped the top level element from the geojson files, so that they were just rootless feature collections, and used trusty old cat command to combine them. Easy enough.

Had the same issue, ended up finding this issue, was about to follow your path but since I had too much data and vim was getting slow here's what I did instead, hopefully it will be useful to anyone in the same situation ending up here: jq -s '.[0].features=([.[].features]|flatten)|.[0]' *.geojson >> merged.geojson

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

No branches or pull requests

3 participants