Skip to content

Instantly share code, notes, and snippets.

@micheleorsi
Last active August 30, 2015 15:54
Show Gist options
  • Save micheleorsi/d479e489fa273162aa51 to your computer and use it in GitHub Desktop.
Save micheleorsi/d479e489fa273162aa51 to your computer and use it in GitHub Desktop.
Topojson reference
ogr2ogr -f "GeoJSON" california_geojson.json tl_2010_06_zcta510.shp
topojson -o california_topojson.json california_geojson.json

convert counties and zipcode shapefiles to GeoJson

ogr2ogr -f "GeoJSON" working/counties.geo.json assets/ca/counties.shp
ogr2ogr -f "GeoJSON" working/zipcodes.geo.json source/tl_2010_06_zcta510.shp

# merge two shapefils
# ogr2ogr working/merge.shp source/tl_2010_06_zcta510.shp
# ogr2ogr -update -append working/merge.shp assets/ca/counties.shp -nln merge
# create a new file in 'GeoJSON' format, called 'ca.json' from file 'working/merge.shp'
#
# generate a shapefile in projected coordinates (california albers)
#ogr2ogr -f 'ESRI Shapefile' -t_srs 'EPSG:3310' working/ca-projected.shp source/tl_2010_06_zcta510.shp


# merging trend2007 file with geojson file
#topojson -e output/trend2007.csv --id-property ZCTA5CE10,ZIPCODE -p -o output/CA_zip_2007.json -- source/tl_2010_06_zcta510.shp
# merging trend2007 file with geojson file
#topojson -e output/trend2012.csv --id-property ZCTA5CE10,ZIPCODE -p -o output/CA_zip_2012.json -- source/tl_2010_06_zcta510.shp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment