shapefile, dump_path = sys.argv[1:3] #http://www2.census.gov/geo/tiger/TIGER2012/STATE/tl_2012_us_state.zip #http://www2.census.gov/geo/tiger/TIGER2012/COUNTY/tl_2012_us_county.zip uri_name = "http://www2.census.gov/geo/tiger/TIGER2012/COUNTY/tl_2012_us_county.zip" if "tl_2012_us_state" in shapefile: uri_name = "http://www2.census.gov/geo/tiger/TIGER2012/STATE/tl_2012_us_state.zip" #simplify_tolerance = .01 # ~ 11km (.001 = 111m) simplify_tolerance = .0001 dump_basename = os.path.basename(shapefile) dump = Dump(dump_path + "/shapefile/"+ dump_basename + ".%04d.json.gz") dump.max_rows = "1000" extract_shapefile(shapefile, uri_name, simplify_tolerance) dump.close() #python tiger_line.py ../../../tiger_line/tl_2012_us_state/tl_2012_us_state.shp tigerdump #python tiger_line.py ../../../tiger_line/tl_2012_us_county/tl_2012_us_county.shp tigerdump #Layer name: tl_2012_us_state #Geometry: 3D Polygon #Feature Count: 56 #Extent: (-179.231086, -14.601813) - (179.859681, 71.441059)
if __name__ == "__main__": shapefile, dump_path = sys.argv[1:3] #http://www2.census.gov/geo/tiger/TIGER2012/STATE/tl_2012_us_state.zip #http://www2.census.gov/geo/tiger/TIGER2012/COUNTY/tl_2012_us_county.zip uri_name = "http://www2.census.gov/geo/tiger/TIGER2012/COUNTY/tl_2012_us_county.zip" if "tl_2012_us_state" in shapefile: uri_name = "http://www2.census.gov/geo/tiger/TIGER2012/STATE/tl_2012_us_state.zip" #simplify_tolerance = .01 # ~ 11km (.001 = 111m) simplify_tolerance = .0001 dump_basename = os.path.basename(shapefile) dump = Dump(dump_path + "/shapefile/" + dump_basename + ".%04d.json.gz") dump.max_rows = "1000" extract_shapefile(shapefile, uri_name, simplify_tolerance) dump.close() #python tiger_line.py ../../../tiger_line/tl_2012_us_state/tl_2012_us_state.shp tigerdump #python tiger_line.py ../../../tiger_line/tl_2012_us_county/tl_2012_us_county.shp tigerdump #Layer name: tl_2012_us_state #Geometry: 3D Polygon #Feature Count: 56 #Extent: (-179.231086, -14.601813) - (179.859681, 71.441059) #Layer SRS WKT: #GEOGCS["GCS_North_American_1983", #DATUM["North_American_Datum_1983",