Skip to content

Instantly share code, notes, and snippets.

@monfera

monfera/.block

Last active Sep 9, 2016
Embed
What would you like to do?
Lake Whistleman - pure SVG filter topo
license: none
height: 550
border: yes

Lake Whistleman - pure SVG filter generative map with multilevel contour lines and hill shading. No JavaScript or topo data. Around 800 bytes on the network after removing comments, spaces and compressing, most of it is the palette. The PNG screenshot is 1.4MB. Looks good on hi-res screens e.g. Retina.

Slow to render because SVG is scalable in resolution but not in performance - at least its browser implementations are disappointingly slow.

It uses a slightly modified version of the excellent Esri Europe2 color run (see LICENSE.txt) but any other palette would work.

It's a variation on the interactive 3D bumpmapped variant with light.

Built with blockbuilder.org

<!DOCTYPE html>
<head>
<meta charset="utf-8">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="550"
style="font: 16px 'Andale Mono', monospace">
<filter id="map" x="0%" y="0%" width="100%" height="100%">
<!--MAKE ELEVATION DATA-->
<!--generate noise-->
<feTurbulence seed="641746" type="fractalNoise" baseFrequency=".002"
numOctaves="7"/>
<!--scale the noise and keep the alpha channel only-->
<feComponentTransfer result="bump">
<feFuncA type="table" tableValues="0 0 1 1"/>
<feFuncR type="gamma" amplitude="0"/>
<feFuncG type="gamma" amplitude="0"/>
<feFuncB type="gamma" amplitude="0"/>
</feComponentTransfer>
<!--FINE CONTOURS-->
<!--make a bump map out of the noise
Safari chokes on multiline attrs so we must keep attr string in one line -->
<feConvolveMatrix result="fine" kernelMatrix="9 9 9 9 -72 9 9 9 9"/>
<!--MEDIUM CONTOURS-->
<!--make a posterized bump map -->
<feComponentTransfer in="bump">
<feFuncA type="discrete" tableValues=".05 .05 .05 .05 .05 .1 .1 .1 .1 .1 .14 .14 .14 .14 .14 .19 .19 .19 .19 .19 .24 .24 .24 .24 .24 .29 .29 .29 .29 .29 .33 .33 .33 .33 .33 .38 .38 .38 .38 .38 .43 .43 .43 .43 .43 .48 .48 .48 .48 .48 .52 .52 .52 .52 .52 .57 .57 .57 .57 .57 .62 .62 .62 .62 .62 .67 .67 .67 .67 .67 .71 .71 .71 .71 .71 .76 .76 .76 .76 .76 .81 .81 .81 .81 .81 .86 .86 .86 .86 .86 .9 .9 .9 .9 .9 .95 .95 .95 .95 .95 1"/>
</feComponentTransfer>
<!--for coarse elevation lines-->
<feConvolveMatrix result="medium" kernelMatrix="5 6 5 6 -44 6 5 6 5"/>
<!--COARSE CONTOURS-->
<!--make a posterized bump map -->
<feComponentTransfer in="bump">
<feFuncA type="discrete" tableValues=".2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .2 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .4 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .6 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 .8 1"/>
</feComponentTransfer>
<!--for coarse elevation lines-->
<feConvolveMatrix result="coarse" order="5"
kernelMatrix="0 0 2 0 0 0 2 3 2 0 2 3 -28 3 2 0 2 3 2 0 0 0 2 0 0"/>
<!--APPLY PALETTE-->
<!--convert the alpha channel to grayscale RGB channels for palette -->
<feColorMatrix in="bump" values="0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1"/>
<!--pick up colors from the palette and map them into the channels-->
<!--Derivative of ESRI Europe2. Palette license: http://soliton.vm.bytemark.co.uk/pub/cpt-city/esri/copying.html-->
<feComponentTransfer>
<feFuncR type="discrete" tableValues=".68 .44 .44 .47 .47 .5 .5 .52 .52 .55 .55 .59 .59 .61 .61 .64 .64 .67 .67 .69 .69 .73 .73 .77 .77 .79 .79 .82 .82 .84 .84 .85 .85 .87 .87 .89 .89 .91 .91 .94 .94 .94 .94 .94 .94 .94 .94 .94 .94 .94 .94 .94 .94 .93 .93 .91 .91 .9 .9 .88 .88 .87 .87 .85 .85 .84 .84 .82 .82 .8 .8 .79 .79 .77 .77 .76 .76 .77 .77 .79 .79 .8 .8 .82 .82 .84 .84 .86 .86 .87 .87 .89 .89 .91 .91 .92 .92 .94 .94 .96 .96 .97 .97 .97 .97 .97 .97 .97 .97 .98 .98 .98 .98 .98 .98 .98 .98 .99 .99 .99 .99 .99 .99 .99 .99 .99 .99 .99"/>
<feFuncG type="discrete" tableValues=".84 .6 .6 .62 .62 .65 .65 .67 .67 .7 .7 .73 .73 .75 .75 .78 .78 .81 .81 .83 .83 .86 .86 .89 .89 .91 .91 .93 .93 .93 .93 .93 .93 .93 .93 .93 .93 .93 .93 .94 .94 .91 .91 .89 .89 .87 .87 .85 .85 .82 .82 .8 .8 .77 .77 .75 .75 .73 .73 .71 .71 .69 .69 .66 .66 .65 .65 .62 .62 .6 .6 .58 .58 .57 .57 .55 .55 .57 .57 .6 .6 .62 .62 .65 .65 .68 .68 .71 .71 .73 .73 .76 .76 .8 .8 .82 .82 .85 .85 .88 .88 .9 .9 .91 .91 .91 .91 .92 .92 .93 .93 .94 .94 .95 .95 .95 .95 .97 .97 .98 .98 .98 .98 .98 .98 .99 .99 .99"/>
<feFuncB type="discrete" tableValues=".94 .35 .35 .36 .36 .39 .39 .4 .4 .43 .43 .45 .45 .47 .47 .49 .49 .52 .52 .53 .53 .56 .56 .59 .59 .6 .6 .62 .62 .6 .6 .6 .6 .58 .58 .58 .58 .58 .58 .57 .57 .56 .56 .55 .55 .55 .55 .54 .54 .53 .53 .53 .53 .52 .52 .52 .52 .52 .52 .52 .52 .51 .51 .51 .51 .51 .51 .5 .5 .49 .49 .5 .5 .49 .49 .49 .49 .5 .5 .52 .52 .54 .54 .56 .56 .58 .58 .61 .61 .63 .63 .66 .66 .68 .68 .71 .71 .73 .73 .77 .77 .8 .8 .8 .8 .82 .82 .84 .84 .86 .86 .88 .88 .89 .89 .91 .91 .93 .93 .95 .95 .96 .96 .98 .98 .99 .99 .99"/>
</feComponentTransfer>
<!--SUPERIMPOSE OVERLAYS-->
<feMerge>
<feMergeNode/>
<feMergeNode in="fine"/>
<feMergeNode in="medium"/>
<feMergeNode in="coarse"/>
</feMerge>
</filter>
<path filter="url(#map)" d="M0 0h960v550H0z"/>
<text x="800" y="545">@monfera</text>
<text x="8" y="545">Lake Whistleman. Hypsometry palette: Europe2 ©ESRI.</text>
</svg>
</body>
ESRI Europe2 hypsometric palette license:
http://soliton.vm.bytemark.co.uk/pub/cpt-city/esri/copying.html
ARTICLE 1. DEFINITIONS
The terms used herein are defined as follows:
(a) Materials mean all or any portion of ESRI's proprietary scripts,
software, data, documentation, or related materials supplied by
ESRI, regardless of the format or content provided under this
Agreement.
(b) Derivative Works mean any products, services, or methods created
using, incorporating, or derived from the Materials or from other
Derivative Works. Derivative Works may consist of collective works
of authorship.
ARTICLE 2. INTELLECTUAL PROPERTY RIGHTS AND RESERVATION OF OWNERSHIP
Materials supplied under this Agreement are licensed and not sold. ESRI
solely owns all Materials, which are protected by United States laws and
applicable international laws, treaties, and conventions regarding
intellectual property or proprietary rights. You agree to keep all
attribution, copyright, and ownership notices included in the Materials
wholly intact.
ARTICLE 3. GRANT OF LICENSE
3.1 Grant of License. The Agreement is intended to promote the free
exchange of Materials related to ESRI products and services. Subject to
the terms and conditions of this Agreement, ESRI grants You a worldwide,
royalty-free, nonexclusive, perpetual, nontransferable license:
(a) To use, execute, display, perform, and transmit the Materials;
(b) To reproduce and distribute the Materials consistent with the
terms of Section 5.1;
(c) To produce Derivative Works of the Materials;
(d) To redistribute Derivative Works subject to terms and conditions
of this Agreement; and
(e) To use, execute, display, perform, and transmit Derivative Works.
All other rights are reserved to ESRI. Nothing in this Agreement shall
abridge ESRI's rights in the Materials.
3.2 Express Prohibition on Patenting. You may not incorporate the Materials
into any product, process, or method to be patented or protected by similar
rights granted in a foreign jurisdiction. Sublicensees of any Derivative
Works are likewise prohibited from seeking such patent or similar right on
any product, process, or method incorporating the Materials or Derivative
Works. Additionally, Materials shall not be used in any preferred
embodiments of patented products, processes, or methods. Any attempts to
seek a patent or similar right incorporating Materials shall render this
Agreement void and all rights granted under this License shall be immediately
revoked.
3.3 Technology Neutrality. The rights granted herein apply in any media or
format, whether presently used or hereafter devised. These rights include
the right to make any modifications necessary in order make use of Materials
on platforms for which it was not intended. If such modifications are made,
any attribution and copyright notices included in the Materials shall be
included and left wholly intact.
ARTICLE 4. DISCLAIMERS AND LIMITATION OF LIABILITY
4.1 Disclaimer of Certain Types of Liability. ESRI DISCLAIMS ALL WARRANTIES
OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
4.2 Disclaimer of Indemnity. ESRI SHALL NOT BE LIABLE TO YOU FOR COSTS OF
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOST PROFITS, SALES, OR
BUSINESS EXPENDITURES; LOST INVESTMENTS; COMMITMENTS IN CONNECTION WITH
ANY BUSINESS; LOSS OF ANY GOODWILL; OR FOR ANY INDIRECT, SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATED TO THIS AGREEMENT OR
USE OF THE MATERIALS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER OR NOT ESRI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL
PURPOSE OF ANY LIMITED REMEDY.
ARTICLE 5. GENERAL PROVISIONS
5.1 Distribution of Materials.
(a) License and Distribution. You may redistribute the Materials under
this Agreement to non parties to this agreement ("Sublicensee")
only if (1) a complete copy of this license is provided to and
expressly agreed upon by the Sublicensee or (2) the Material is
included in a deliverable in such a manner that the Material is
not accessible, usable, or extractable by the Sublicensee without
the use of extraordinary measures. This License is specific to the
Materials provided and is not attached to any other ESRI products
or services. Sublicensees are also subject to terms and conditions
of use for the Materials and Derivative Works.
(b) Export Control Regulations. You expressly acknowledge and agree to
not export, reexport, or provide the Materials, in whole or in part,
to (i) any country to which the United States has embargoed goods;
(ii) any person on the U.S. Treasury Department's list of Specially
Designated Nationals; (iii) any person or entity on the U.S. Commerce
Department's Table of Denial Orders; or (iv) any person or entity
where such export, reexport, or provision violates any U.S. export
control laws or regulations, including amendments and supplemental
additions as they may occur from time to time. You shall not export
the Materials or any underlying information or technology to any
facility in violation of these or other applicable laws and
regulations, including but not limited to the terms of any export
license or licensing provision. You represent and warrant that You
and Your employees, consultants, or customers who gain access to
the Materials are not a national, resident, located in or under the
control of, or acting on behalf of any person, entity, or country
subject to such U.S. export controls.
5.2 Severability. The parties mutually agree that if any provision of this
Agreement is held to be unenforceable for any reason, such provision shall
be reformed only to the extent necessary to make the intent of the language
enforceable.
5.3 Successor and Assigns. You shall not assign or transfer Your rights or
delegate its obligations under this Agreement without ESRI's prior written
consent. Any attempt to do so without prior written consent shall be void.
5.4 Equitable Relief. You agree that Your breach of this Agreement may
cause irreparable harm and that, in the event of such breach, in addition
to any and all remedies at law, ESRI shall have the right to seek an
injunction, specific performance, or other equitable relief in any court of
competent jurisdiction without the requirement of posting a bond or
undertaking or proving injury as a condition for relief.
5.5 Governing Law. This Agreement shall be governed by and construed in
accordance with the laws of the State of California. Actions arising under
this Agreement shall be filed in San Bernardino County, California.
5.6 Entire Agreement. This Agreement constitutes the sole and entire
agreement of the parties as to the Materials provided hereunder. Additional
or different terms included with an order or other document shall not be
binding upon ESRI. Any modification(s) or amendment(s) to this Agreement
must be in writing and signed by each party. This Agreement shall have
no effect on interpretation, application, or the rights and obligations
associated with any other agreements between You and ESRI whether agreed
to before or after the date of this Agreement.
======================
Palette modification license (RGB value rounding and addition of a water color)
Licensed under the same terms as required by the original license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment