<commit_before>#!/usr/bin/env bash

if [ ! -d "data/geo/geojson" ]; then
  mkdir data/geo/geojson
  echo "geojson directory created"
fi

if [ ! -d "data/geo/topojson" ]; then
  mkdir data/geo/topojson
  echo "topojson directory created."
fi

ogr2ogr \
  -f GeoJSON \
  -where "ADM0_A3 IN ('USA', 'CAN')" \
  data/geo/geojson/subunits.json \
  data/geo/shapefile/ne_10m_admin_0_map_subunits/ne_10m_admin_0_map_subunits.shp

ogr2ogr \
  -f GeoJSON \
  -where "ISO_A2 IN ('US', 'CA') AND SCALERANK < 8" \
  data/geo/geojson/places.json \
  data/geo/shapefile/ne_10m_populated_places/ne_10m_populated_places.shp

topojson \
  -o data/geo/topojson/na.json \
  --id-property SU_A3 \
  --properties name=NAME \
  -- \
  data/geo/geojson/subunits.json \
  data/geo/geojson/places.json

<commit_msg>Altered places conversion to remove smaller cities<commit_after>#!/usr/bin/env bash

if [ ! -d "data/geo/geojson" ]; then
  mkdir data/geo/geojson
  echo "geojson directory created"
fi

if [ ! -d "data/geo/topojson" ]; then
  mkdir data/geo/topojson
  echo "topojson directory created."
fi

ogr2ogr \
  -f GeoJSON \
  -where "ADM0_A3 IN ('USA', 'CAN')" \
  data/geo/geojson/subunits.json \
  data/geo/shapefile/ne_10m_admin_0_map_subunits/ne_10m_admin_0_map_subunits.shp

echo "Completed subunits GeoJSON conversion."

ogr2ogr \
  -f GeoJSON \
  -where "ISO_A2 IN ('US', 'CA') AND SCALERANK < 3" \
  data/geo/geojson/places.json \
  data/geo/shapefile/ne_10m_populated_places/ne_10m_populated_places.shp

echo "Completed places GeoJSON conversoin."

topojson \
  -o data/geo/topojson/na.json \
  --id-property SU_A3 \
  --properties name=NAME \
  -- \
  data/geo/geojson/subunits.json \
  data/geo/geojson/places.json

echo "Completed TopoJSON conversion."

{'fraction_non_alphanumeric': 0.13222667429879795, 'fraction_numerical': 0.019461934745277618, 'mean_word_length': 3.3054187192118225, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1273486', 'n_tokens_mistral': 756, 'n_tokens_neox': 706, 'n_words': 132}