I am doing @mbostock's tutorial on Command Line Cartography 1. Here is what I've done:
1) Download the zip file
wget https://www.arb.ca.gov/ei/gislib/gislib.htm/ca_air_basins.zip
(from California Air Resources Board site)
2) Manually unzip by clicking .zip
file (unzip
command did not work because downloaded file didn't have 'End-of-central-directory signature')
2) Convert a shapefile to GeoJSON
shp2json CaAirBasin.shp -o ca.json
3) Make a GeoJSON projection using California Albers (specified in CaAirBasin.prj
file):
geoproject 'd3.geoConicEqualArea().parallels([34, 40.5]).rotate([120, 0]).fitSize([960, 960], d)' < ca.json > ca-albers.json
Result:
I get ca-albers.json
(223M) that is much bigger than ca.json
(6.3M). In the census tract shapefile used in the tutorial, the file size increases from 10 to 14 M.
Update:
It seems that problem is with shp2json
step instead of geoProject
step. Looking at CaAirBasin.shp.xml,
there are two sets of bounding,bounding
and lbounding.
In my case,lbounding
and coordinate values that are in 100,000s range is used as opposed to (-180, 180) in the tutorial, making projection fail.
What is a good next step - is there an alternative to shp2json
that will work for my case? OR how can I translate my bounding/coordinates to appropriate (-180,180) ones?
Thank you.