Relief Map of Canada Generator by fizzup 3d model
3dmdb logo
Thingiverse
Relief Map of Canada Generator by fizzup

Relief Map of Canada Generator by fizzup

by Thingiverse
Last crawled date: 2 years, 12 months ago
Summary
There are three things here:
A perl script that uses the API at http://geogratis.gc.ca to get relief data about the Earth's surface in Canada and generate the STL file that you can print.
An STL generated by the script for all of Canada in exaggerated scale relief (50x vertical scale).
An STL generated by the script for Rogers Pass in even-scale relief. The pass is an interesting little bit of geography in the Selkirk mountain range in the province of British Columbia. It has some historical significance for Canada. You can read all about it on Wikipedia.
License
The API data is available under the Open Government License – Canada (http://open.canada.ca/en/open-government-licence-canada). Since OGLC allows you to sub-licence, I think it's compatible with CC Attribution. If you are with the Government of Canada and you have some concerns about all this, please let me know in the comments or something. Anyway, RogersPass.stl and Canada.stl contain information licensed under the Open Government Licence – Canada.
If you do take the script and use it for your own nefarious purposes, please be aware that the script is under CC Attribution, but the data that you get from the API is under OGLC.
Running the script
ReliefMap.pl lat=51.2833459 lon=-117.5254215 scale=100000 resolution=1 vfactor=1 x=200 y=200 radius=150 cache=1 file=RogersPass.stl
and
ReliefMap.pl lat=63 lon=-90 scale=27000000 resolution=1 vfactor=50 x=200 y=200 radius=107 cache=1 file=Canada.stl
The script produces ASCII STL, which is unusual and takes up a lot of disk space. If you are going to publish STL, run it through Slic3r first and export the smaller binary STL.
Meaning of the parameters
lat The latitude of the centre point of the map.
lon The longitude of the centre point of the map.
scale The inverse scale of the map (so Rogers Pass is mapped at 1:100,000 and Canada is mapped at 1:2,700,000).
resolution is the minimum distance, in millimeters on the print bed, between two elevation measurements.
vfactor is the scale factor in the z direction as compared to the x/y direction. So the mountains in the Rogers Pass map are even scale, but the relief in the map of Canada is 50 times the x/y scale.
x and y are the rectangular size of the print.
radius is the bounding circle. Due to the way that the triangles are drawn, the map actually sneaks out around the bounding circle. If you have a circular print surface, you need to reduce the radius by one '''resolution''' distance to really bound the map. The map is bound by the x, y, and radius parameters. The map of Canada shows this.
cache is a boolean. It stores the lat/lon values that the script gets from the API so that subsequent runs of the same map are much faster and don't waste your tax dollars.
file is the file name of the STL file that the script generates.
Map projection
The map does not use a cartesian projection, which is unusual in any map. Although the bottom of the map is flat because it has to rest on the print surface the top of the map is not flat, which is the purpose of a relief map anyway.
Since the top surface is not flat in the first place it is not necessary to project the elevation onto a flat surface. Instead, the script projects the elevation onto the surface of the WGS-84 ellipsoid before scaling the model down to fit on the print bed. The WGS-ellipsoid is a smooth model of the Earth's surface that accounts for the equatorial bulge. It is the reference surface for elevations using GPS. The projection is equivalent to cutting a piece out of a globe.
Here is an analogy to help you visualize the projection. The script puts an imaginary ice cream cone inside the Earth, with the pointy part at the centre of the earth and the rim of the ice cream cone in a circle around the central latitude and longitude of the map. The surface of the Earth is the ice cream. It's mostly round, and the land is the gnarly bits of ice cream that stick out. The script cuts off the ice cream at the rim of the cone and you print it on your printer.
Updates
July 24, 2016
Fixed all the defects in drawing triangles. The resulting STL does not have any errors when you load it in Slic3r.
Switched from equirectangular projection to globe projection.
Added a circular bound because a square bound with a globe projection can use a lot of plastic if the map is big.
Added the ability to cache lat/lon values between runs to give the servers at Natural Resources Canada a little bit of a break.

Tags