Make improvements & add functionality to existing Node script
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

This is a continuation of work from/of the following bounty;

https://bountify.co/add-additional-output-functionality-to-existing-node-script

For the sake of brevity, please refer to the above mentioned link/thread for the script and details thereof -thank you.

Task #1;

Add ability to open and SPLIT GeoJSON formatted .json file, e.g.-
"FeatureCollection"
[{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-123.13101874510028,49.235082433550424],[-123.13128527538144,49.2350916479381],[-123.13127037734064,49.23543096575531],[-123.13100248553498,49.23542184282976],[-123.13101874510028,49.235082433550424]]]},"properties":{"pid":"002-418-762","pid_tied":"<null>","mapref_id":"002418762","coord_id":"","parcel_id":"__FIZH7A","civic_id":"{CD2CC17A-E3F7-4EBB-9465-75AF5492EAF9}","concat_id":"0000000000000005886 00000000000954 00010 002418762001","area":"","jurisdicti":"","roll":"008-747-146-63-0000","mls_subare":"VVWSH","folio":"747-146-63-0000","jurol":"09-200-008-747-146-63-0000","plan":"VAP5886","property_t":"LAND","address":"1135 W 40TH AVE","unit":"<null>","house":"","street_nam":"40TH","street_typ":"AVE","street_dir":"W","neighborho":"SHAUGHNESSY","fsa":"V6M","ldu":"1V1","postal_cod":"V6M 1V1","lot":"10","block":"954","district_l":"","zoning":"RS-5 SFD","usage":"RESIDENTIAL-HOUSE","legal_shor":"S/5886///954//10","legal_long":"LOT 10 BLOCK 954 DISTRICT LOT 526 PLAN 5886","folder":"CA/BC/GV/VA/SH/002418762-1135_W_40TH_AVE/","filename":"002418762-1135_W_40TH_AVE-PROPERTY_DETAILS","coord_id2":"74714663","area2":"09","jurisdict2":"200","house2":"1135","district_2":"526"}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-123.1530502331686,49.239628045148386],[-123.15325974692882,49.23963118558503],[-123.15324772635577,49.239959797855974],[-123.15303821095598,49.239956576442204],[-123.1530502331686,49.239628045148386]]]},"properties":{"pid":"002-429-993","pid_tied":"<null>","mapref_id":"002429993","coord_id":"","parcel_id":"__FJ1982","civic_id":"{1CDEBE6E-92D8-4A57-81D7-2EFEE879949D}","concat_id":"0000000000000002975 00004 007 002429993001","area":"","jurisdicti":"","roll":"005-735-091-44-0000","mls_subare":"VVWQU","folio":"735-091-44-0000","jurol":"09-200-005-735-091-44-0000","plan":"VAP2975","property_t":"LAND","address":"2042 W 35TH AVE","unit":"<null>","house":"","street_nam":"35TH","street_typ":"AVE","street_dir":"W","neighborho":"SHAUGHNESSY","fsa":"V6M","ldu":"1H9","postal_cod":"V6M 1H9","lot":"7","block":"21","district_l":"","zoning":"RS-5 SFD","usage":"RESIDENTIAL-HOUSE","legal_shor":"S/2975/////4//7","legal_long":"LOT 7 OF LOT 4 BLOCK 21 DISTRICT LOT 526 PLAN 2975","folder":"CA/BC/GV/VA/SH/002429993-2042_W_35TH_AVE/","filename":"002429993-2042_W_35TH_AVE-PROPERTY_DETAILS","coord_id2":"73509144","area2":"09","jurisdict2":"200","house2":"2042","district_2":"526"}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-123.13057154368282,49.247040675418134],[-123.13056616306696,49.24718865308104],[-123.13004265825896,49.247180257293344],[-123.13004816409831,49.247032279514116],[-123.13057154368282,49.247040675418134]]]},"properties":{"pid":"002-435-373","pid_tied":"<null>","mapref_id":"002435373","coord_id":"","parcel_id":"__FJ0N26","civic_id":"{DAC56D9A-A52B-405A-80F0-422DAAEA3BF4}","concat_id":"0000000000000006011 00000000000714 00007 002435373001","area":"","jurisdicti":"","roll":"008-148-714-01-0000","mls_subare":"VVWSH","folio":"148-714-01-0000","jurol":"09-200-008-148-714-01-0000","plan":"VAP6011","property_t":"LAND","address":"4309 OSLER ST","unit":"<null>","house":"","street_nam":"OSLER","street_typ":"ST","street_dir":"<null>","neighborho":"SHAUGHNESSY","fsa":"V6H","ldu":"2X6","postal_cod":"V6H 2X6","lot":"7","block":"714","district_l":"","zoning":"RS-5 SFD","usage":"RESIDENTIAL-HOUSE","legal_shor":"S/6011///714//7","legal_long":"LOT 7 BLOCK 714 DISTRICT LOT 526 PLAN 6011","folder":"CA/BC/GV/VA/SH/002435373-4309_OSLER_ST/","filename":"002435373-4309_OSLER_ST-PROPERTY_DETAILS","coord_id2":"14871401","area2":"09","jurisdict2":"200","house2":"4309","district_2":"526"}}]

At the moment, script can only open NDJSON (one record per row, no trailing commas), e.g.-

{"key1":"value1","key2":"value2","key3":"value3"}
{"key1":"value1","key2":"value2","key3":"value3"}
{"key1":"value1","key2":"value2","key3":"value3"}

Task #2;

Currently, when using SPLIT, files that are output to file are being written to a single -minified- line, e.g.-
{"ASSESSMENT":[{"tax_year":"2016","land_value":"3115000.00","improvements_value":"109000.00","total_value":"3224000.00","tax_levy_amount":"11340.12"},{"tax_year":"2015","land_value":"0.00","improvements_value":"0.00","total_value":"0.00","tax_levy_amount":"0.00"}]}

Need to add flag to output to either 'prettified' or 'minified' formats.

How you want to split the GeoJSON? Did the file contains multiple GeoJSON objects? E.g: { "type": "FeatureCollection", "features": [ { ... }, { ... }, ... ] } { "type": "FeatureCollection", "features": [ { ... }, { ... }, ... ] }
farolanf 8 months ago
@farolanf - The source file contains thousands of GeoJSON records, each record containing a geometry + attributes. When source files are SPLIT (output to file), the resulting output files should look like this; 1.) prettified version; https://gist.githubusercontent.com/ericjarvies/e59ec65da034a805658656129ba64580/raw/a4c3f9db9ed9e7af373358db3c446c7d5bfa4a16/example-output.json https://gist.github.com/ericjarvies/e59ec65da034a805658656129ba64580 2.) minified version (like your example in your above reply)
ericjarvies 8 months ago

Crowdsource coding tasks.

0 Solutions