Skip to content

Instantly share code, notes, and snippets.

@pdbartsch
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdbartsch/413145f2f0fe4cde1903 to your computer and use it in GitHub Desktop.
Save pdbartsch/413145f2f0fe4cde1903 to your computer and use it in GitHub Desktop.
GIS UCSB Utility data from ArcSDE to shapefile to geojson to topojson

How I get esri gdb data ready for Leaflet maps

In my case, data source of truth lives in an ArcSDE geodatabase on PostgreSQL using EPSG:2229 projection

  • export from ArcCatalog to shapefile ... I filtered by utility type and left out the abandoned line info
  • a typical ogr2ogr command looked like this
    • ogr2ogr -f GeoJSON -t_srs EPSG:4326 ut_watr_node.geojson UT_watr_act_node.shp
  • then from geojson to topojson to reduce size and cleanup some unnecessary attributes
    • topojson -o ut_watr_link.topojson -p util_type,size,material,lat_main ut_watr_link.geojson
    • topojson -o ut_watr_node.topojson -p util_type,yr_insta,node_type,size ut_watr_node.geojson
  • the above example size changed from:
    • shapefile: 3.36mb
    • geojson: 963kb
    • topojson: 99kb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment