Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gartenkarte
meta
Commits
cf197acb
Commit
cf197acb
authored
Nov 17, 2017
by
jon r
Browse files
clean outliers after conversion, and differently. fixes
#7
parent
6daf369e
Changes
2
Hide whitespace changes
Inline
Side-by-side
data/02_clean.sh
View file @
cf197acb
...
...
@@ -10,7 +10,3 @@ xargs -a regex-unicode -I {} perl -CSD -pi -e '{}' $o
# Many kudos to https://www.linuxquestions.org/questions/linux-newbie-8/removing-multiple-lines-from-cell-data-in-a-csv-file-4175538718/#post5343293
# Requires gawk >= 4.1.0 https://stackoverflow.com/questions/16529716/awk-save-modifications-in-place
gawk
-i
inplace
'FPAT="([^,]+)|(\"[^\"]+\")"{x=$0;while((gsub(/\"/,"\"",x)%2)!=0){getline;x=x " ";x=x $0};$0=x;print}'
$o
# Remove lines without coordinates and add those to a separate list of outliers
head
-n
1 <
$o
>
${
out
}
liers.csv
grep
";;;"
$o
>>
${
out
}
liers.csv
sed
-ni
'/;;;/!p'
$o
data/03_convert.sh
View file @
cf197acb
...
...
@@ -3,3 +3,8 @@
npm run
--silent
csv2geojson
--
--lat
"lat"
--lon
"lon"
--delimiter
";"
data/
$out
.csv
>
$out
.json 2>
${
out
}
liers.json
cat
$out
.json | jq
-r
'.features | map (.properties.types | split(";#") ) | { tags: . }'
>
$out
-tags
.json
npm run geojson2csv
--
data/
$out
.json data/
$out
-verlan
.csv
# Remove lines without coordinates and add those to a separate list of outliers
head
-n
1 <
$o
>
${
out
}
liers.csv
egrep
-x
"^.*;;$"
$o
>>
${
out
}
liers.csv
sed
-in
'/^.*;;$/d'
$o
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment