Topo Map: Difference between revisions
From charlesreid1
No edit summary |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
This page covers the | This page covers part 2 of my process for dealing with shapefile topography data from the National Map viewer in Leaflet. | ||
* Part 1 - [[Topo Map]] (this page) | |||
* Part 2 - [[Leaflet Topology Map]] | |||
Inspired by this D3 sketch: http://bl.ocks.org/herrstucki/6312708 | Inspired by this D3 sketch: http://bl.ocks.org/herrstucki/6312708 | ||
| Line 11: | Line 14: | ||
http://nationalmap.gov/viewer.html | http://nationalmap.gov/viewer.html | ||
==Downloading Data== | ==Downloading Shapefile Topo Data== | ||
Selecting a location for which I wanted topological data, I faced the dilemma of not knowing which data set to select. | Selecting a location for which I wanted topological data, I faced the dilemma of not knowing which data set to select. | ||
| Line 26: | Line 29: | ||
[[Image:Shapefile_Topo.png|500px]] | [[Image:Shapefile_Topo.png|500px]] | ||
=Converting= | |||
==Shapefile to TopoJson== | |||
To convert this shapefile to something like TopoJson, I can use the TopoJson utility, which I installed as part of making my [[D3 Map]] (see http://charlesreid1.com/wiki/D3_Map#GeoJson_to_TopoJson). | |||
Here is an example of a topojson call, from this page [http://blog.thematicmapping.org/2013/06/converting-shapefiles-to-topojson.html]: | |||
<pre> | |||
topojson --id-property NR -p name=NAVN -p name -o NO_Admin_UTM33.topojson NO_Fylker_pol.shp NO_Kommuner_pol.shp | |||
</pre> | |||
For my file, in the folder <code>Elev_321166_Ajo_E_1X1/</code>, I can convert the shapefile, <code>Elev_Contour.shp</code>: | |||
<pre> | |||
$ topojson Elev_Contour.shp -o Elev_Contour.topojson -p | |||
bounds: -112.99999999999994 32.00000000000006 -112.00000000013563 33.00000000086072 (spherical) | |||
pre-quantization: 0.111m (0.00000100°) 0.111m (0.00000100°) | |||
topology: 38071 arcs, 4228784 points | |||
post-quantization: 11.1m (0.000100°) 11.1m (0.000100°) | |||
prune: retained 38071 / 38071 arcs (100%) | |||
</pre> | |||
[[Category:GIS]] | |||
Latest revision as of 22:53, 22 February 2015
This page covers part 2 of my process for dealing with shapefile topography data from the National Map viewer in Leaflet.
- Part 1 - Topo Map (this page)
- Part 2 - Leaflet Topology Map
Inspired by this D3 sketch: http://bl.ocks.org/herrstucki/6312708
Github readme for that sketch here: https://github.com/interactivethings/swiss-maps/blob/master/README.md
Ultimate goal: map topo data from the National Map Viewer (maybe even automated somehow!)
National Map Viewer
http://nationalmap.gov/viewer.html
Downloading Shapefile Topo Data
Selecting a location for which I wanted topological data, I faced the dilemma of not knowing which data set to select.
I narrowed the view down to a specific region. I then clicked the download data link at the top.
I was presented with an array of choices, and I chose "Contour" data. This gave me multiple shape files, two of which covered the region of interest. I went through the checkout process to download these two shapefiles.
The region that I'm looking at is the Barry Goldwater Bombing Range outside of Yuma, Arizona, on the southwest Arizona-Mexico border.
Loading into QGIS
Here is what the shapefile looks like when loaded in QGIS... woah!
Converting
Shapefile to TopoJson
To convert this shapefile to something like TopoJson, I can use the TopoJson utility, which I installed as part of making my D3 Map (see http://charlesreid1.com/wiki/D3_Map#GeoJson_to_TopoJson).
Here is an example of a topojson call, from this page [1]:
topojson --id-property NR -p name=NAVN -p name -o NO_Admin_UTM33.topojson NO_Fylker_pol.shp NO_Kommuner_pol.shp
For my file, in the folder Elev_321166_Ajo_E_1X1/, I can convert the shapefile, Elev_Contour.shp:
$ topojson Elev_Contour.shp -o Elev_Contour.topojson -p bounds: -112.99999999999994 32.00000000000006 -112.00000000013563 33.00000000086072 (spherical) pre-quantization: 0.111m (0.00000100°) 0.111m (0.00000100°) topology: 38071 arcs, 4228784 points post-quantization: 11.1m (0.000100°) 11.1m (0.000100°) prune: retained 38071 / 38071 arcs (100%)