<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.klokan.cz/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0"><id>tag:blogger.com,1999:blog-6689009</id><updated>2012-01-28T01:50:21.238+01:00</updated><category term="labs" /><category term="openlayers" /><category term="iphone" /><category term="maps" /><category term="gdal" /><category term="javascript" /><category term="osgeo" /><category term="maptiler" /><category term="oldmapsonline" /><category term="google" /><category term="presentations" /><title type="text">Klokan Technologies GmbH</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://blog.klokantech.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://blog.klokantech.com/search/label/osgeo" /><author><name>Petr Pridal</name><uri>https://profiles.google.com/109686779214381837110</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-wUrU02dFKNg/AAAAAAAAAAI/AAAAAAAAL-Y/xdZuSqLIgds/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.klokan.cz/klokan-blog-osgeo" /><feedburner:info uri="klokan-blog-osgeo" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry><id>tag:blogger.com,1999:blog-6689009.post-25057912040877839</id><published>2011-01-25T21:51:00.023+01:00</published><updated>2011-02-09T19:18:18.843+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="osgeo" /><category scheme="http://www.blogger.com/atom/ns#" term="labs" /><title type="text">WebGL Earth: Open Source 3D Globe for Web Browser</title><content type="html">&lt;a href="http://www.webglearth.com/" style="float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_YHHsqgPwuzQ/TT8qwsiKmbI/AAAAAAAALn8/hvo7PXsWyJg/s1600/live-version.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;WebGL Earth is an open source software enabling to explore, zoom and “play” with the 3D globe directly in a web browser on any platform including mobile devices - without a plugin.&amp;nbsp;The project lives from support and cooperation of developer community.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Live demo:&lt;br /&gt;&lt;a href="http://www.webglearth.com/"&gt;http://www.webglearth.com/&lt;/a&gt;.&lt;br /&gt;Project page with source code:&lt;br /&gt;&lt;a href="http://www.webglearth.org/"&gt;http://www.webglearth.org/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It is written in JavaScript using HTML5 Canvas tag with WebGL extension. The code uses Closure Library and Compiler - the same toolset which is behind GMail, Docs, Maps and other Google products.&lt;br /&gt;&lt;br /&gt;The project displays detailed street-level data (via OpenStreetMap), detailed aerial imagery (via Bing Maps) and any other custom maps which are available in &lt;a href="http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/"&gt;popular Mercator tiles&lt;/a&gt; (prepared by MapTiler, GDAL2Tiles, TileCache, GeoWebCache, etc).&lt;br /&gt;&lt;br /&gt;Browser supporting WebGL, like &lt;a href="http://www.mozilla.com/en-US/firefox/beta/"&gt;Mozilla Firefox 4 Beta&lt;/a&gt;, &lt;a href="http://www.google.com/intl/en/landing/chrome/beta/"&gt;Google Chrome Beta&lt;/a&gt;, &lt;a href="http://nightly.webkit.org/"&gt;WebKit nightly&lt;/a&gt; or &lt;a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation"&gt;other&lt;/a&gt;&amp;nbsp;is necessary to try this project out.&lt;br /&gt;&lt;br /&gt;If you don’t have one, you can at least check the video:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/xn8Y3wzLrXo/0.jpg" height="266" width="320"&gt;&lt;param name="movie" value="http://www.youtube.com/v/xn8Y3wzLrXo?f=videos&amp;c=google-webdrive-0&amp;app=youtube_gdata" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="320" height="266" src="http://www.youtube.com/v/xn8Y3wzLrXo?f=videos&amp;c=google-webdrive-0&amp;app=youtube_gdata" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;WebGL Earth is available to embed in your own websites via a &lt;a href="http://www.webglearth.org/api"&gt;simple JavaScript API&lt;/a&gt;, which we hope to extend soon - based on requests of community. Check the first set of examples demonstrating the API:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;a href="http://webglearth.googlecode.com/svn/trunk/api/examples/helloworld.html" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_YHHsqgPwuzQ/TT8vEQOoTxI/AAAAAAAALoA/Q4aqj_Ww_2A/s1600/helloworld.jpg" /&gt;&lt;/a&gt;&amp;nbsp;&lt;a href="http://webglearth.googlecode.com/svn/trunk/api/examples/animation.html" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_YHHsqgPwuzQ/TT8vHihOojI/AAAAAAAALoE/_0Tr3iTv0io/s1600/animation.jpg" /&gt;&lt;/a&gt;&lt;a href="http://webglearth.googlecode.com/svn/trunk/api/examples/opposite.html" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_YHHsqgPwuzQ/TT8vY96AoqI/AAAAAAAALoI/LwcRy-B9mN0/s1600/opposite.jpg" /&gt;&lt;/a&gt;&amp;nbsp;&lt;a href="http://webglearth.googlecode.com/svn/trunk/api/examples/custommap.html" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_YHHsqgPwuzQ/TT8vcmWmq0I/AAAAAAAALoM/XalT7SdFDtM/s1600/custommap.jpg" /&gt;&lt;/a&gt;&amp;nbsp;&lt;a href="http://webglearth.googlecode.com/svn/trunk/api/examples/bing.html" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_YHHsqgPwuzQ/TT8vf_h7EbI/AAAAAAAALoQ/N5qWlmH-4TQ/s1600/bing.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Developers can also modify the code completely and use the rendering core as a component for other projects. The best place to start with development is the &lt;a href="http://www.webglearth.org/quickstart"&gt;Quickstart document&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Users are welcome to &lt;a href="http://www.webglearth.org/feedback"&gt;submit feedback&lt;/a&gt;.&amp;nbsp;Developers can join &lt;a href="http://groups.google.com/group/webglearth"&gt;mailing-list&lt;/a&gt;, join our community, create a new amazing applications from the source code and&amp;nbsp;&lt;a href="http://www.webglearth.org/contribute"&gt;make contribution to WebGL Earth&lt;/a&gt;&amp;nbsp;or help with &lt;a href="http://code.google.com/p/webglearth/issues/list"&gt;reporting and fixing of bugs&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;We are looking forward to hear from you. The future of this open-source project is in your hands!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689009-25057912040877839?l=blog.klokantech.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/klokan-blog-osgeo/~4/pbDM67TuAwE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.klokantech.com/feeds/25057912040877839/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6689009&amp;postID=25057912040877839" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/25057912040877839" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/25057912040877839" /><link rel="alternate" type="text/html" href="http://feeds.klokan.cz/~r/klokan-blog-osgeo/~3/pbDM67TuAwE/webgl-earth-open-source-3d-globe-for.html" title="WebGL Earth: Open Source 3D Globe for Web Browser" /><author><name>Petr Pridal</name><uri>https://profiles.google.com/109686779214381837110</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-wUrU02dFKNg/AAAAAAAAAAI/AAAAAAAAL-Y/xdZuSqLIgds/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_YHHsqgPwuzQ/TT8qwsiKmbI/AAAAAAAALn8/hvo7PXsWyJg/s72-c/live-version.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.klokantech.com/2011/01/webgl-earth-open-source-3d-globe-for.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-6689009.post-6594983751265344399</id><published>2010-12-02T15:34:00.001+01:00</published><updated>2010-12-02T16:24:59.290+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="osgeo" /><category scheme="http://www.blogger.com/atom/ns#" term="labs" /><category scheme="http://www.blogger.com/atom/ns#" term="openlayers" /><title type="text">Closure Compiler for OpenLayers 3.x</title><content type="html">&lt;a href="https://github.com/openlayers/openlayers" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_YHHsqgPwuzQ/TPJJktMn17I/AAAAAAAALkk/EdwQtnOJj-0/s1600/OpenLayers_logo.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You probably heard about the &lt;a href="http://code.google.com/closure/"&gt;JavaScript Google Closure Tools&lt;/a&gt; which were released as open-source (Apache License 2.0) by Google more then an year ago. It is a set of tools which are in use for development of Gmail, Google Maps, Reader, Docs and other popular Google products.&lt;br /&gt;&lt;br /&gt;In this blog post I would like to summarize what cool features the Closure Tools offer to developers of large open-source JavaScript projects, and I would like to suggest (re)writing &lt;a href="http://openlayers.org/blog/2010/06/30/openlayers-3-on-github/"&gt;OpenLayers 3.0&lt;/a&gt; the way, that it is fully usable with Closure Tools. We can all profit from what is already out there - and write smaller and faster web and mobile applications easier with the future versions of OpenLayers, if we decide to go this way.&lt;br /&gt;&lt;br /&gt;The most important tool in the Closure set is the &lt;a href="http://code.google.com/closure/compiler/"&gt;Compiler&lt;/a&gt;. All other tools are optional and are build around the features of the compiler. The compiler is usable from&amp;nbsp;&lt;a href="http://code.google.com/closure/compiler/docs/gettingstarted_app.html"&gt;command line&lt;/a&gt; or as a&amp;nbsp;&lt;a href="http://code.google.com/closure/compiler/docs/gettingstarted_ui.html"&gt;web application&lt;/a&gt;.&amp;nbsp;You can also&amp;nbsp;&lt;a href="http://code.google.com/closure/compiler/docs/api-ref.html"&gt;HTTP POST&lt;/a&gt; your source code and get back the compiled code. The compiler can be utilized by the existing building scripts of OpenLayers easily.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://code.google.com/closure/" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_YHHsqgPwuzQ/TPIUtTwkd3I/AAAAAAAALkg/JtZPB6p7W_g/s1600/logo128px.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The compiler has several cool features:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;It compiles readable JavaScript into &lt;b&gt;compressed machine-readable JavaScript&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Documentation of the code with &lt;b&gt;JSDoc Tags&lt;/b&gt; is important: the compiler reads it and you get warnings during compilation for typos in documentation, wrong use of a @constructor, wrong type of a variable, misuse of a field annotated with @private and @protected, etc.&lt;/li&gt;&lt;li&gt;If you write a reusable JavaScript library, such as OpenLayers, you formally &lt;b&gt;export your public API&lt;/b&gt;&amp;nbsp;- and the compiler optimizes your internal code.&lt;/li&gt;&lt;li&gt;The end &lt;b&gt;applications can be compiled together with the library&lt;/b&gt; - and then the unused parts of the library are removed from the produced code. Dependencies are solved automatically by the compiler.&lt;/li&gt;&lt;li&gt;Compiler accepts &lt;b&gt;constants to remove unwanted functionality&lt;/b&gt; - this allows compilation only for particular browser such as Mobile WebKit, for only one of Quirks mode or Strict mode, compilation without support of IE6, etc.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Debugging with FireBug&lt;/b&gt;&amp;nbsp;is possible even for the compiled version of the source code.&lt;/li&gt;&lt;li&gt;Compiler supports generation of &lt;b&gt;dynamically loadable modules&lt;/b&gt;, which can significantly speed up loading of the end application, because the code for advanced functionality can be loaded only when it is required.&lt;/li&gt;&lt;/ol&gt;Let's go through these points one by one:&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;1. It compiles readable JavaScript into compressed machine-readable JavaScript.&lt;/h2&gt;&lt;br /&gt;The compiler loads the whole source code of the supplied JavaScript application into memory, makes detailed analyze of the code, prepares internal graph of dependency and while knowing the syntax and partly also semantic of JavaScript language, it makes the compilation.  &lt;br /&gt;&lt;br /&gt;If you use the default "SIMPLE_OPTIMIZATION" then Closure Compiler behaves just as another JavaScript minimizer: whitespace and comment removal, renaming local variables and function parameters to shorter names (only symbols that are local to functions). It can be directly used with the OpenLayers &lt;a href="http://trac.osgeo.org/openlayers/wiki/Profiles"&gt;Build Profiles&lt;/a&gt; as they are available now - and you get around 20% smaller OpenLayers.js file on the output, compared to the default jsmin-based minimization of the code. Check also latest &lt;a href="http://trac.osgeo.org/openlayers/ticket/2871"&gt;#2871&lt;/a&gt; and &lt;a href="http://trac.osgeo.org/openlayers/ticket/2873"&gt;#2873&lt;/a&gt;&amp;nbsp;if you want to have smaller results for OL. BTW official releases of jQuery are now minimized &lt;a href="https://github.com/jquery/jquery/tree/"&gt;with Closure compiler&lt;/a&gt;&amp;nbsp;and SIMPLE_OPTIMIZATION.&lt;br /&gt;&lt;br /&gt;The truly powerful is the compiler when it is used with the "ADVANCED_OPTIMIZATION". Then it uses &lt;a href="http://code.google.com/closure/compiler/docs/api-tutorial3.html#better"&gt;several tricks&lt;/a&gt; to shorten the code further, including the dead code removal and function inlining. But the JavaScript code must be ready for the compilation and it can't contain buggy code patterns. It means that the &lt;a href="http://code.google.com/closure/compiler/docs/limitations.html"&gt;programmers are pushed&lt;/a&gt; to write their JavaScript code in a more readable and maintainable way. Typical problem is with using of "this" outside of constructors and prototype methods. Programmers can't use some of the techniques which the JavaScript language offers, but this restrictions also help to keep the code readable and reusable by other people later on. In general, &lt;b&gt;&lt;span class="Apple-style-span" style="background-color: #cfe2f3;"&gt;programmers should follow the rules described in the &lt;a href="http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml"&gt;JavaScript Style Guide&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;. There is also a tool for checking and automatic corrections of the JavaScript code called &lt;a href="http://code.google.com/closure/utilities/docs/linter_howto.html"&gt;Linter&lt;/a&gt; which can help. OpenLayers 2.x is not following these rules right now, but I think for OpenLayers 3.0 it would make sense to write the code with these rules in mind.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;2. Documentation of the code with JSDoc Tags is important: the compiler reads it&lt;/h2&gt;&lt;br /&gt;OpenLayers 2.x, same as other big JavaScript projects, are using &lt;a href="http://en.wikipedia.org/wiki/JSDoc"&gt;JSDoc comments&lt;/a&gt; for inline documentation of the source code. Google Closure compiler is parsing such JSDoc tags, and then using it to enhance the code optimization process and to print warnings during compilation for potentially buggy code patterns or mistakes, if used with&amp;nbsp;"--warning_level=VERBOSE".&lt;br /&gt;&lt;br /&gt;In fact through JSDoc comments the JavaScript language is enhanced with complete type system for variables and with visibility of objects.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: #cfe2f3;"&gt;The JSDoc set of &lt;b&gt;annotations and type expressions which Google Closure compiler understands&lt;/b&gt; is described at &lt;a href="http://code.google.com/closure/compiler/docs/js-for-compiler.html"&gt;http://code.google.com/closure/compiler/docs/js-for-compiler.html&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The introduced type system is powerful. OpenLayers can profit from possibility to define your own object types, for example the "OpenLayers.Location" object can be a new type which always must contain ".x" and ".y" with type float. Compiler can enforce this: whenever a function expects "OpenLayers.Location" as a parameter you receive warning during compilation if you use an object which does not comply.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;3. Public API is formalized - the compiler needs it&lt;/h2&gt;&lt;br /&gt;It is important to have a formal definition of the public API which you are &lt;a href="http://code.google.com/closure/compiler/docs/api-tutorial3.html#export"&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;exporting&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&amp;nbsp;from the library such as OpenLayers - compilation of a publicly usable JavaScript library is not possible without that. It means you are pushed to keep the API clean - as well as documented correctly with JSDoc.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;4. The end applications can be compiled together with the library&lt;/h2&gt;&lt;br /&gt;The end-user applications can be programmed traditionally: So the OpenLayers library is used as a standalone OpenLayers.js script, which is included in the website in the HTML header. The application itself has a separate code base, and uses the public OpenLayers API. This approach is common with OpenLayers 2.x.&lt;br /&gt;&lt;br /&gt;Alternative approach is that the code of the application is merged with the code of the library and then the result is compiled together -&amp;nbsp;this way the unused parts of the library are removed automatically from the final code. Dependencies in the code are solved by the compiler.&lt;br /&gt;Only the JavaScript functionality, which is really in use by the end application is then part of the final compiled .js file, which is used for deployment and production use.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;5. Constants defined during compilation to remove unwanted functionality&lt;/h2&gt;&lt;br /&gt;Variables annotated with the @define JSDoc tag can be redefined during compilation, and then the compiler can recognize blocks of code conditioned with such variables as&amp;nbsp;unreachable. Because the dead code is removed automatically - such source code is completely stripped from the final result .js file.&lt;br /&gt;&lt;br /&gt;Typical use case for this is a block of code executed only if some DEBUG variable is set to true, but there are also other use cases:&lt;br /&gt;&lt;br /&gt;A source code of a JavaScript library can contain plenty of functions to handle differences between &lt;a href="http://www.quirksmode.org/css/quirksmode.html"&gt;Quirks and Strict mode of a web browser&lt;/a&gt;, determined by the DOCTYPE tag in the beginning of &amp;nbsp;the HTML page. The general JavaScript library must support both modes, but if you are a developer of a web application you control in which rendering mode is your application used. This means the handling of Quirks mode can be easily stripped from library which you are using.&lt;br /&gt;&lt;br /&gt;Similarly - if you are developing a mobile web application for iPhone or Android platform, you don't really need in your application code which is specific for Internet Explorer or for older versions of Firefox or other browsers.&lt;br /&gt;&lt;br /&gt;The&amp;nbsp;&lt;a href="http://code.google.com/closure/library/"&gt;Closure Library&lt;/a&gt;, the standard JavaScript library coming with Closure Tools, supports already this kind of conditional compilation for different browsers (via goog.userAgent.ASSUME_MOBILE_WEBKIT) and rendering modes (goog.dom.ASSUME_STANDARDS_MODE).&lt;br /&gt;&lt;br /&gt;I saw at FOSS4G that for OpenLayers 3.x is planned closer interoperability with existing general libraries such as Prototype, jQuery or Closure Library for accessing DOM, operation on strings or other basic functionality - to not reinvent wheel inside of OpenLayers and eliminate duplicate code for the same functionality in final applications, which are already using one of these libraries anyway.&lt;br /&gt;The conditional compilation with constants supported by the Closure compiler can help in this case.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;6. Debugging with FireBug&lt;/h2&gt;&lt;br /&gt;The minimized JavaScript code is normally very hard to debug, because the code is obfuscated and there is no reference to the original formatting and variable names.&lt;br /&gt;&lt;br /&gt;Closure Compiler comes with two handy approaches for debugging the code compiled in the &amp;nbsp;ADVANCED_OPTIMIZATION mode:&lt;br /&gt;&lt;br /&gt;First is the parameter "--debug=true", which causes that the renamed variables which are normally shortened to one or two letters keep meaningful names - e.g. "OpenLayers.Location.prototype.setValue" becomes $$OpenLayers$Location$$$$$setValue$$, instead of "aa" for example. This parameter is very often used with "--formatting=PRETTY_PRINT".&lt;br /&gt;&lt;br /&gt;The second option is usage of the final compiled code together with the&amp;nbsp;&lt;a href="http://code.google.com/p/closure-inspector/"&gt;Inspector&lt;/a&gt; extension for Firefox. Compiler then generate a mapping file between original source code and the compiled code and the extension simplifies debugging with &lt;a href="http://getfirebug.com/"&gt;Firebug&lt;/a&gt;, once such mapping file is loaded.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;7. Dynamically loadable modules&lt;/h2&gt;&lt;br /&gt;Google Maps API V3 as well as other Google products are compiled to load only a small core (bootstrap) of the necessary functionality and later load extensions with more code.&lt;br /&gt;This approach can &lt;a href="http://www.google.com/events/io/2010/sessions/maps-api-v3-api.html"&gt;significantly speed up the first appearance&lt;/a&gt;&amp;nbsp;of a web application, which is important especially on mobile devices.&lt;br /&gt;&lt;br /&gt;The Closure compiler of course supports this form of compilation, with &lt;a href="http://groups.google.com/group/closure-compiler-discuss/msg/c148435bf8f5e78f"&gt;parameters on the command line&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The whole project can be compiled with a simple Makefile or custom merge and build scripts, but there are also&amp;nbsp;several tools available for simplifying the compilation, module dependencies and handling of the code which is spread over several files - these tools are useful especially if you are using Closure Library or you need compilation into modules: &lt;a href="http://plovr.com/"&gt;Plovr&lt;/a&gt;, &lt;a href="http://pypi.python.org/pypi/ClosureBuilder"&gt;ClosureBuilder&lt;/a&gt;, or &lt;a href="http://code.google.com/p/closure-modules/"&gt;Closure Modules&lt;/a&gt;. With Closure library comes also &lt;a href="http://code.google.com/closure/library/docs/closurebuilder.html"&gt;closurebuilder.py&lt;/a&gt; and &lt;a href="http://code.google.com/closure/library/docs/depswriter.html"&gt;depswriter.py&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I am very keen to discuss with OpenLayers developers and the community the application of Closure compiler and it's advantages and disadvantages.&lt;br /&gt;&lt;br /&gt;We have used the compiler and&amp;nbsp;Closure&amp;nbsp;library already at some projects which are now in production use, so we have practical experience with these tools - for example from the development of the web interface for our &lt;a href="http://www.mapranksearch.com/"&gt;MapRank Search&lt;/a&gt; product.&lt;br /&gt;&lt;br /&gt;If there is an interest I can publish another blog post with a code of a simple project and step-by-step guide demonstrating the use of Closure Compiler and Library.&lt;br /&gt;&lt;br /&gt;The Closure tools are definitively worth attention for any web developer.&amp;nbsp;Please write into the comments what do you think about the subject of Closure Compiler and OpenLayers V3.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689009-6594983751265344399?l=blog.klokantech.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/klokan-blog-osgeo/~4/AeCf2qD0DqA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.klokantech.com/feeds/6594983751265344399/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6689009&amp;postID=6594983751265344399" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/6594983751265344399" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/6594983751265344399" /><link rel="alternate" type="text/html" href="http://feeds.klokan.cz/~r/klokan-blog-osgeo/~3/AeCf2qD0DqA/closure-compiler-for-openlayers-3x.html" title="Closure Compiler for OpenLayers 3.x" /><author><name>Petr Pridal</name><uri>https://profiles.google.com/109686779214381837110</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-wUrU02dFKNg/AAAAAAAAAAI/AAAAAAAAL-Y/xdZuSqLIgds/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_YHHsqgPwuzQ/TPJJktMn17I/AAAAAAAALkk/EdwQtnOJj-0/s72-c/OpenLayers_logo.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.klokantech.com/2010/12/closure-compiler-for-openlayers-3x.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-6689009.post-7567913814167322164</id><published>2010-05-21T11:24:00.000+02:00</published><updated>2010-05-21T11:24:06.588+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="osgeo" /><category scheme="http://www.blogger.com/atom/ns#" term="maps" /><category scheme="http://www.blogger.com/atom/ns#" term="google" /><title type="text">Custom style for Google Maps</title><content type="html">I am impressed by the new functionality in Google Maps API V3: &lt;a href="http://code.google.com/apis/maps/documentation/javascript/overlays.html#StyledMaps"&gt;StyledMaps&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You can create your own dynamic style for Google Maps tiles - and change the look and feel of the base maps which you want to include in your website.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/examplestyles.html" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://1.bp.blogspot.com/_YHHsqgPwuzQ/S_ZPurapl9I/AAAAAAAALEw/_VsbJfjuQ1U/s640/SanFranciscoStyles.jpg" width="523" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;It is quite a natural step, something what open-source projects like &lt;a href="http://code.google.com/p/mapnik-utils/wiki/Cascadenik"&gt;Cascadenik&lt;/a&gt; and products of other companies such as &lt;a href="http://maps.cloudmade.com/"&gt;CloudMade&lt;/a&gt;&amp;nbsp;made possible already some time ago. The adoption of this functionality by Google brings this possibility to masses.&lt;br /&gt;&lt;br /&gt;If you want to define your own styles for the map you can use the online &lt;a href="http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html"&gt;Style Map Wizard&lt;/a&gt; tool. More info and the&amp;nbsp;official announcement is available &lt;a href="http://googlegeodevelopers.blogspot.com/2010/05/add-touch-of-style-to-your-maps.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689009-7567913814167322164?l=blog.klokantech.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/klokan-blog-osgeo/~4/TYKE6m3qraI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.klokantech.com/feeds/7567913814167322164/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6689009&amp;postID=7567913814167322164" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/7567913814167322164" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/7567913814167322164" /><link rel="alternate" type="text/html" href="http://feeds.klokan.cz/~r/klokan-blog-osgeo/~3/TYKE6m3qraI/custom-style-for-google-maps.html" title="Custom style for Google Maps" /><author><name>Petr Pridal</name><uri>https://profiles.google.com/109686779214381837110</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-wUrU02dFKNg/AAAAAAAAAAI/AAAAAAAAL-Y/xdZuSqLIgds/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_YHHsqgPwuzQ/S_ZPurapl9I/AAAAAAAALEw/_VsbJfjuQ1U/s72-c/SanFranciscoStyles.jpg" height="72" width="72" /><thr:total>4</thr:total><feedburner:origLink>http://blog.klokantech.com/2010/05/custom-style-for-google-maps.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-6689009.post-3330117692396524803</id><published>2010-05-12T09:36:00.002+02:00</published><updated>2010-05-12T10:08:43.409+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="osgeo" /><title type="text">FOSS4G 2010: Vote for OldMapsOnline.org!</title><content type="html">I submitted a proposal for the presentation in the &lt;a href="http://2010.foss4g.org/"&gt;FOSS4G conference in Barcelona&lt;/a&gt; and I would like to ask the OSGeo community and other people who plan to visit the FOSS4G conference to &lt;a href="http://2010.foss4g.org/review/"&gt;vote for the presentation&lt;/a&gt;: "&lt;b&gt;OldMapsOnline.org: Open Source &amp;amp; Online Tools for Old Maps&lt;/b&gt;".&lt;br /&gt;&lt;br /&gt;In the OldMaspOnline.org project we are developing open-source software and designing online tools for collaborative georeferencing, annotation, 3D visualisation, accuracy analysis and geometadata specification for old maps (or in general any raster images) from the web browser. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_YHHsqgPwuzQ/S-pStfHRZyI/AAAAAAAALDo/H-FLs3Fexno/s1600/oldmapsonline.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232" src="http://2.bp.blogspot.com/_YHHsqgPwuzQ/S-pStfHRZyI/AAAAAAAALDo/H-FLs3Fexno/s400/oldmapsonline.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;One of the very interesting and practical results is an&amp;nbsp;online service for georeferencing of the scanned maps or any other online images. You can directly from the webbrowser georeference any online image published as JPEG, any&amp;nbsp;image already published on Wikimedia or Flickr, collection of&amp;nbsp;online tiles (Zoomify, DeepZoom, ...) or imagery published on one of the supported image servers (IIPImage, Lizardtech Express MrSID, DigiTool, ...). In this moment the service is under active development and I would like to announce the results at FOSS4G 2010 in Barcelona.&lt;br /&gt;&lt;br /&gt;In OldMapsOnline.org we have also contributed to several open-source projects. You can find our code in &lt;a href="http://www.openlayers.org/"&gt;OpenLayers&lt;/a&gt; (Zoomify support in 2.9), &lt;a href="http://www.gdal.org/"&gt;GDAL&lt;/a&gt; (GDAL2Tiles), &lt;a href="http://www.geotools.org/"&gt;GeoTools&lt;/a&gt;, &lt;a href="http://iipimage.sourceforge.net/"&gt;IIPImage&lt;/a&gt; and other FOSS projects.&lt;br /&gt;&lt;br /&gt;We have produced two new open-source projects:&lt;br /&gt;&lt;br /&gt;- &lt;b&gt;MapTiler&lt;/b&gt;: user-friendly tile map publishing a la Google Maps: &lt;a href="http://www.maptiler.org/"&gt;http://www.maptiler.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;-&lt;b&gt; IIPImage JPEG2000&lt;/b&gt;: open-source server software for fast delivery of the ultra high resolution raster imagery directly from JPEG2000 or TIFF files. MooViewer, OpenZoom, Zoomify, DeepZoom or OpenLayers provides the attractive user-experience on the client side (usually in the web browser). &lt;a href="http://help.oldmapsonline.org/jpeg2000/"&gt;http://help.oldmapsonline.org/jpeg2000/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you are interested to know more about our project, feel free the explore our websites: &lt;a href="http://help.oldmapsonline.org/"&gt;http://help.oldmapsonline.org/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;To vote for the presentation please visit:&amp;nbsp;&lt;/b&gt;&lt;a href="http://2010.foss4g.org/review/"&gt;&lt;b&gt;http://2010.foss4g.org/review/&lt;/b&gt;&lt;/a&gt;&lt;b&gt; and follow instructions there - the deadline is this Friday (May 14th)!&amp;nbsp;I am looking forward to meet you in Barcelona ;-)&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689009-3330117692396524803?l=blog.klokantech.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/klokan-blog-osgeo/~4/8M3xSSvJ31Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.klokantech.com/feeds/3330117692396524803/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6689009&amp;postID=3330117692396524803" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/3330117692396524803" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/3330117692396524803" /><link rel="alternate" type="text/html" href="http://feeds.klokan.cz/~r/klokan-blog-osgeo/~3/8M3xSSvJ31Q/foss4g-2010-vote-for-oldmapsonlineorg.html" title="FOSS4G 2010: Vote for OldMapsOnline.org!" /><author><name>Petr Pridal</name><uri>https://profiles.google.com/109686779214381837110</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-wUrU02dFKNg/AAAAAAAAAAI/AAAAAAAAL-Y/xdZuSqLIgds/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_YHHsqgPwuzQ/S-pStfHRZyI/AAAAAAAALDo/H-FLs3Fexno/s72-c/oldmapsonline.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.klokantech.com/2010/05/foss4g-2010-vote-for-oldmapsonlineorg.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-6689009.post-4714366238630870310</id><published>2010-01-15T10:55:00.049+01:00</published><updated>2010-01-15T17:09:22.811+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="osgeo" /><title type="text">OziExplorer OZF format specification + open-source decoder!</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_YHHsqgPwuzQ/S1CAhtS2MbI/AAAAAAAAK2Y/H22w4mwG3b4/s1600-h/ozex.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 200px; height: 113px;" src="http://3.bp.blogspot.com/_YHHsqgPwuzQ/S1CAhtS2MbI/AAAAAAAAK2Y/H22w4mwG3b4/s200/ozex.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5426978867564130738" /&gt;&lt;/a&gt;&lt;br /&gt;Yesterday I was testing the &lt;a href="http://code.google.com/p/ozex/"&gt;OZEX&lt;/a&gt; project, which intends to be an open-source replacement for the popular &lt;a href="http://www.oziexplorer.com/"&gt;OziExplorer&lt;/a&gt; software. The most interesting on OZEX is that it is able to decode and display the Ozf2 and Ozfx3 binary files on Linux and other platforms and that the decoder is completely open-source!&lt;br /&gt;I know about other nice and open-source projects targeted to OziExplorer users with an advanced GUI and interesting features, look at the &lt;a href="http://www.qlandkarte.org/index.php?option=com_content&amp;view=article&amp;id=11&amp;Itemid=12"&gt;QLandKarte GT screenshots&lt;/a&gt; for example.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_YHHsqgPwuzQ/S1CAvKn19WI/AAAAAAAAK2g/duO-NfWYihY/s1600-h/qlandkartegt.2009.07.05_5.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 128px;" src="http://4.bp.blogspot.com/_YHHsqgPwuzQ/S1CAvKn19WI/AAAAAAAAK2g/duO-NfWYihY/s200/qlandkartegt.2009.07.05_5.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5426979098775123298" /&gt;&lt;/a&gt;This is for the first time I see &lt;a href="http://code.google.com/p/ozex/source/browse/#svn/trunk/core"&gt;open-source implementation of the OZF2 and OZFx3 binary format&lt;/a&gt;!&lt;br /&gt;It would be excellent to create a decoder also in the GDAL library (&lt;a href="http://www.gdal.org/gdal_drivertut.html"&gt;as a driver&lt;/a&gt;) because it would bring the OZF reading/decoding functionality into several &lt;a href="http://trac.osgeo.org/gdal/wiki/SoftwareUsingGdal"&gt;open-source projects&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I have submitted to the &lt;a href="https://svn.osgeo.org/gdal/sandbox/klokan/ozf/"&gt;gdal svn&lt;/a&gt; a documentation of the format derived from the source codes, some sample files as well as links to the OZEX GPL code. More sample files can be generated with the &lt;a href="http://www.oziexplorer3.com/img2ozf/img2ozf.html"&gt;img2ozf utility&lt;/a&gt; (runs well under Wine).&lt;br /&gt;Unfortunately I am now busy on another projects but I hope that some of the GDAL developers finds a bit of time to do the coding of the OZF driver...&lt;br /&gt;&lt;br /&gt;GDAL already has a preliminary &lt;a href="http://mateusz.loskot.net/2009/09/26/oziexplorer-map-support-into-gdal/"&gt;support&lt;/a&gt; for the &lt;a href="http://www.rus-roads.ru/gps/help_ozi/map_file_format.html"&gt;OziExplorer's .map files&lt;/a&gt; (textual metadata, think of advanced ESRI World File with included info about the map projection), but support for the binary formats from the OZF family (version 2 and version 3) would move the compatibility to a different level.&lt;br /&gt;&lt;br /&gt;OziExplorer is a very popular in the GPS and GeoCaching community.  Support of the maps generated or georeferenced with this software in the OSGEO open-source tools would be great! I hope to see it in the near future in &lt;a href="http://www.maptiler.org/"&gt;MapTiler&lt;/a&gt;, GRASS, QGis, MapServer, GeoServer and all the other FOSS GIS tools! Anybody interested in the coding for GDAL?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689009-4714366238630870310?l=blog.klokantech.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/klokan-blog-osgeo/~4/IEp5yvoEjWM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.klokantech.com/feeds/4714366238630870310/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6689009&amp;postID=4714366238630870310" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/4714366238630870310" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/4714366238630870310" /><link rel="alternate" type="text/html" href="http://feeds.klokan.cz/~r/klokan-blog-osgeo/~3/IEp5yvoEjWM/oziexplorer-ozf-format-specification.html" title="OziExplorer OZF format specification + open-source decoder!" /><author><name>Petr Pridal</name><uri>https://profiles.google.com/109686779214381837110</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-wUrU02dFKNg/AAAAAAAAAAI/AAAAAAAAL-Y/xdZuSqLIgds/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_YHHsqgPwuzQ/S1CAhtS2MbI/AAAAAAAAK2Y/H22w4mwG3b4/s72-c/ozex.jpg" height="72" width="72" /><thr:total>5</thr:total><feedburner:origLink>http://blog.klokantech.com/2010/01/oziexplorer-ozf-format-specification.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-6689009.post-965852878738269724</id><published>2010-01-13T15:33:00.006+01:00</published><updated>2010-01-13T15:43:37.188+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="osgeo" /><category scheme="http://www.blogger.com/atom/ns#" term="maps" /><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><category scheme="http://www.blogger.com/atom/ns#" term="oldmapsonline" /><title type="text">IIPImage JPEG2000: Free Software for Zoomable High Resolution Online Images</title><content type="html">&lt;span style="font-style:italic;"&gt;As a technical manager of the OldMapsOnline.org project I am very pleased to post to this blog a note about our results:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.mzk.cz/"&gt;Moravian Library&lt;/a&gt; and the &lt;a href="http://www.oldmapsonline.org/"&gt;OldMapsOnline.org&lt;/a&gt; project are proud to announce the release of a new version of the open-source IIPImage server software (&lt;a href="http://help.oldmapsonline.org/jpeg2000/"&gt;http://help.oldmapsonline.org/jpeg2000/&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;img style="float:left; margin:0px 10px 0px 0px;width: 104px; height: 82px;" src="http://2.bp.blogspot.com/_YHHsqgPwuzQ/S03KfuQY5UI/AAAAAAAAK1o/UuqKQmxMlJo/s200/jpeg2000.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5426215772392842562" /&gt;The freely available IIPImage software can be used for stunning online presentations of scanned documents, paintings, maps, books, newspapers, photographs or other high-resolution images on the web directly from JPEG2000 or TIFF files.&lt;br /&gt;&lt;br /&gt;The new version allows &lt;span style="font-weight:bold;"&gt;direct publishing from JPEG2000 images&lt;/span&gt; to a wide variety of different client technologies based on AJAX, Adobe Flash or Silverlight. These include popular pan&amp;zoom viewers based on Zoomify or Seadragon technology (including the Seadragon AJAX viewer and the Seadragon iPhone application) as well as it's own AJAX enabled IIPMooViewer. The documents provided by IIPImage can be displayed in any web browser and on a number of platforms - Windows, Mac, Linux or iPhone.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://help.oldmapsonline.org/jpeg2000"&gt;&lt;img style="float:right; margin:0 0 10px 10px;width: 200px; height: 142px;" src="http://4.bp.blogspot.com/_YHHsqgPwuzQ/S03LQEpUu9I/AAAAAAAAK1w/IsVb5AoujF4/s200/mooviewer.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5426216603036728274" /&gt;&lt;/a&gt;The software is primarily targeted at institutions who operate their own server connected to the Internet and who want to publish large collections of digital images directly from JPEG2000 or&lt;br /&gt;TIFF files.&lt;br /&gt;&lt;br /&gt;Institutions who does not have the necessary infrastructure can follow our alternative tutorial at &lt;a href="http://help.oldmapsonline.org/publish/"&gt;http://help.oldmapsonline.org/publish/&lt;/a&gt; on how to achieve the same using standard web hosting and free software.&lt;br /&gt;&lt;br /&gt;&lt;img style="float:left; margin:0 10px 10px 0;width: 110px; height: 200px;" src="http://2.bp.blogspot.com/_YHHsqgPwuzQ/S03MO65D1BI/AAAAAAAAK14/2Rx2JniHo4E/s200/iphoneiipimage.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5426217682750133266" /&gt;IIPImage is a light-weight client-server system for fast and efficient online viewing and zooming of ultra high-resolution images. It is designed to be bandwidth and memory efficient and usable over a slow Internet connection even on gigapixel sized images.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;It is available for free, under an open source license (GNU GPL)&lt;/span&gt;. We recommend installing&lt;br /&gt;the software on a Linux (or other UNIX) server. We have prepared an easy to install binary package for Debian and Ubuntu with step-by-step instructions for installation.&lt;br /&gt;&lt;br /&gt;JPEG2000 support has been implemented using the Kakadu library, which provides one of the fastest implementations of the JPEG2000 ISO standard and is redistributable for non-commercial use.&lt;br /&gt;&lt;br /&gt;The enhancement of IIPImage was developed by the Moravian Library and the OldMapsOnline.org project with the support of grants from the Ministry of Culture of the Czech Republic.&lt;br /&gt;&lt;br /&gt;The Moravian Library (&lt;a href="http://www.mzk.cz/"&gt;http://www.mzk.cz/&lt;/a&gt;), based in Brno, Czech Republic, is a research institution and a legal deposit library. Project OldMapsOnline.org (&lt;a href="http://www.oldmapsonline.org/"&gt;http://www.oldmapsonline.org/&lt;/a&gt;) is a research project of the Moravian Library that aims to develop software to assist in the management, manipulation and visualisation of historical map collections on the web. The project team is designing online tools for publishing, collaborative georeferencing, annotation, 3D visualisation, accuracy analysis and geometadata specification for old maps.&lt;br /&gt;&lt;br /&gt;For more information and for the IIPImage JPEG2000 software, see &lt;a href="http://help.oldmapsonline.org/jpeg2000/"&gt;http://help.oldmapsonline.org/jpeg2000/&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689009-965852878738269724?l=blog.klokantech.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/klokan-blog-osgeo/~4/MoNUHS6OWLY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.klokantech.com/feeds/965852878738269724/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6689009&amp;postID=965852878738269724" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/965852878738269724" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/965852878738269724" /><link rel="alternate" type="text/html" href="http://feeds.klokan.cz/~r/klokan-blog-osgeo/~3/MoNUHS6OWLY/iipimage-jpeg2000-free-software-for.html" title="IIPImage JPEG2000: Free Software for Zoomable High Resolution Online Images" /><author><name>Petr Pridal</name><uri>https://profiles.google.com/109686779214381837110</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-wUrU02dFKNg/AAAAAAAAAAI/AAAAAAAAL-Y/xdZuSqLIgds/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_YHHsqgPwuzQ/S03KfuQY5UI/AAAAAAAAK1o/UuqKQmxMlJo/s72-c/jpeg2000.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.klokantech.com/2010/01/iipimage-jpeg2000-free-software-for.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-6689009.post-567790033211075436</id><published>2009-10-24T17:36:00.014+02:00</published><updated>2009-10-25T07:56:56.681+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="osgeo" /><title type="text">Raster map reprojection (warping) with JavaScript and HTML5 Canvas</title><content type="html">I wanted to create something nice during the &lt;a href="http://2009.foss4g.org/"&gt;FOSS4G&lt;/a&gt; &lt;a href="http://wiki.osgeo.org/wiki/FOSS4G_2009_Code_Sprint"&gt;Code Sprint&lt;/a&gt;, and I ended up programing a prototype of the client-side raster reprojection implemented with the HTML5 Canvas, JavaScript and &lt;a href="http://www.proj4js.org/"&gt;Proj4js&lt;/a&gt;. It is kind of port of gdalwarp into the web-browser environment.&lt;br /&gt;&lt;br /&gt;To try it you need a web browser which supports HTML5, it means the latest version of one of the Firefox, Chrome, Safari or Opera.  &lt;br /&gt;&lt;br /&gt;Have a look at the demo:&lt;br /&gt;&lt;br /&gt;&lt;iframe src="http://examples.maptiler.org/map-reprojection-html5-canvas/" width="550" height="865"&gt;&lt;a href="http://examples.maptiler.org/map-reprojection-html5-canvas/"&gt;Raster map reprojection (warping) with JavaScript in a web-browser with HTML5 Canvas&lt;/a&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Link: &lt;a href="http://examples.maptiler.org/map-reprojection-html5-canvas/"&gt;http://examples.maptiler.org/map-reprojection-html5-canvas/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It is just a prove of concept in this moment, but I am sure you will come up with plenty of ideas for practical application... post a comment! ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689009-567790033211075436?l=blog.klokantech.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/klokan-blog-osgeo/~4/id6XeNPvh4M" height="1" width="1"/&gt;</content><link rel="related" href="http://examples.maptiler.org/map-reprojection-html5-canvas/" title="Raster map reprojection (warping) with JavaScript and HTML5 Canvas" /><link rel="replies" type="application/atom+xml" href="http://blog.klokantech.com/feeds/567790033211075436/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6689009&amp;postID=567790033211075436" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/567790033211075436" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/567790033211075436" /><link rel="alternate" type="text/html" href="http://feeds.klokan.cz/~r/klokan-blog-osgeo/~3/id6XeNPvh4M/raster-map-reprojection-warping-with.html" title="Raster map reprojection (warping) with JavaScript and HTML5 Canvas" /><author><name>Petr Pridal</name><uri>https://profiles.google.com/109686779214381837110</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-wUrU02dFKNg/AAAAAAAAAAI/AAAAAAAAL-Y/xdZuSqLIgds/s512-c/photo.jpg" /></author><thr:total>5</thr:total><feedburner:origLink>http://blog.klokantech.com/2009/10/raster-map-reprojection-warping-with.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-6689009.post-7094361537349186707</id><published>2009-10-10T19:51:00.084+02:00</published><updated>2009-10-23T01:00:28.113+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="osgeo" /><title type="text">Garmin Custom Maps KMZ from GeoTIFF via MapTiler / GDAL2Tiles</title><content type="html">&lt;img style="float:right; margin:0 0 10px 10px; width: 200px; height: 72px;" src="http://4.bp.blogspot.com/_YHHsqgPwuzQ/StDK4kljxsI/AAAAAAAAI3A/MBVDjmEepZA/s200/garmin_logo.jpg" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.garmin.com/"&gt;Garmin&lt;/a&gt; rolled out beta version of firmware for their latest generation handheld GPS receivers allowing you to display scanned paper maps and another raster data in their navigation devices. They have chosen to do that with a &lt;a href="https://forums.garmin.com/showthread.php?t=2646"&gt;simplified variant of Google Earth's KMZ format&lt;/a&gt;, so you can &lt;a href="http://garmin.blogs.com/softwareupdates/2009/10/creating-and-using-garmin-custom-maps-in-five-easy-steps.html"&gt;prepare maps for your Garmin even in Google Earth&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;On the Internet you can find plenty of free maps in the standardized GIS formats, which can be now transfered into your GPS device. Look at &lt;a href="http://www.archive.org/details/maps_usgs"&gt;USGS topographic maps&lt;/a&gt;, &lt;a href="http://svinetfc4.fs.fed.us/rastergateway/states/states.html"&gt;USFS maps&lt;/a&gt;, or &lt;a href="http://www.nauticalcharts.noaa.gov/mcd/Raster/"&gt;NOAA Nautical Charts&lt;/a&gt;, etc.&lt;br /&gt;These geodata has already high quality georeference embedded, but they are using different coordinate systems and map projections then Google Earth and this complicates the conversion into the form supported by latest Garmin handhelds.&lt;br /&gt;&lt;br /&gt;&lt;object style="float:left; margin:0 10px 0 0; width: 205px; height: 350px;"  classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='205' height='350'  id='badge9d2e8d1097e7012cb4ce000d60d4c902' align='middle'&gt;&lt;br /&gt;&lt;param name='allowScriptAccess' value='always' /&gt;&lt;br /&gt;&lt;param name='allowNetworking' value='all' /&gt;&lt;br /&gt;&lt;param name='movie' value='https://giving.paypallabs.com/flash/badge.swf' /&gt;&lt;br /&gt;&lt;param name='quality' value='high' /&gt;&lt;br /&gt;&lt;param name='bgcolor' value='#FFFFFF' /&gt;&lt;br /&gt;&lt;param name='wmode' value='transparent' /&gt;&lt;br /&gt;&lt;param name='FlashVars' value='Id=9d2e8d1097e7012cb4ce000d60d4c902'/&gt;&lt;br /&gt;&lt;embed src='https://giving.paypallabs.com/flash/badge.swf' FlashVars='Id=9d2e8d1097e7012cb4ce000d60d4c902' quality='high' bgcolor='#FFFFFF' wmode='transparent' width='205' height='350' Id='badge9d2e8d1097e7012cb4ce000d60d4c902' align='middle' allowScriptAccess='always' allowNetworking='all' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'&gt;&lt;/embed&gt;&lt;br /&gt;&lt;/object&gt;&lt;br /&gt;I am the author of &lt;a href="http://www.maptiler.org/"&gt;MapTiler&lt;/a&gt; - a graphical application for Windows, Linux and Mac OS X, which allows extremely easy and user-friendly transformation of raster geodata into the web presentation (mashups) and tile overlay for Google Maps, Bing, Yahoo Maps, OpenStreetMap or Google Earth. You can &lt;a href="http://help.maptiler.org/betatest"&gt;download and use&lt;/a&gt; this software for free. And it is open-source!&lt;br /&gt;&lt;br /&gt;The application now supports direct export into the Garmin Custom Maps KMZ. If you have one of the supported Garmin devices you can try an example map: the &lt;a href="http://examples.maptiler.org/AZ_Grand_Canyon_1988_geo1.kmz"&gt;USGS map of Grand Canyon encoded for Garmin GPS KMZ&lt;/a&gt; (9 MB) or the &lt;a href="http://examples.maptiler.org/36001207.kmz"&gt;alternative from USDA Forest Service&lt;/a&gt;. (10 MB)&lt;br /&gt;&lt;br /&gt;Because I don't have a Garmin device with support of the KMZ, I would like to kindly ask those who have it and are going to use  the Garmin rendering functionality to donate a few dollars via PayPal, so I can buy one of these devices and also cover the time I spent on the development of this new feature and on the new release of MapTiler.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;PLEASE WHEN YOU WILL ANNOUNCE SOMEWHERE THIS NEW GARMIN FUNCTIONALITY OF MAPTILER PUT THERE A NOTE ABOUT THE DONATION AS WELL&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;You can also include the donation gadget into your own web / blog post. Just &lt;a href="http://www.maptiler.org/garmin.html"&gt;copy and paste the HTML code&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_YHHsqgPwuzQ/SuDhoYpRP9I/AAAAAAAAI3w/ARf3utNeMRQ/s1600-h/garmin.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 126px; height: 200px;" src="http://1.bp.blogspot.com/_YHHsqgPwuzQ/SuDhoYpRP9I/AAAAAAAAI3w/ARf3utNeMRQ/s200/garmin.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5395560437516419026" /&gt;&lt;/a&gt;&lt;br /&gt;Donation is as easy as a click on the "Give" button in the &lt;a href="http://www.maptiler.org/garmin.html"&gt;PayPal giving widget&lt;/a&gt; in this blog post - you can use either PayPal or your credit card.&lt;br /&gt;&lt;br /&gt;I am keen to see if it is possible to raise enough funds to cover the costs for development this way.&lt;br /&gt;&lt;br /&gt;Thank you, if you send a donation...&lt;br /&gt;&lt;br /&gt;Klokan Petr Pridal&lt;br /&gt;&lt;br /&gt;P.S.&lt;br /&gt;Steps for Garmin map rendering:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://help.maptiler.org/betatest"&gt;Download and install&lt;/a&gt; latest version of MapTiler application. When you start it: In the first step choose the Google Earth tiles rendering, then open your geodata file and continue till the Tile Details page. Choose from the tile formats one of the Garmin Custom KMZ maps. Probably best option is the 512 version. By default it renders the maximal quality where the map has less then 100 tiles (limit of the Garmin devices). If you are fine with lower image quality just choose smaller number for the maximal zoom level. In most cases the default should be fine. Then continue in the GUI to the final rendering step.&lt;br /&gt;The result is the map.kmz file, which can be directly used in your Garmin GPS.&lt;br /&gt;&lt;br /&gt;If you would like to use the command line for rendering instead of the GUI then it is done by calling: &lt;pre&gt;python gdal2tiles.py -p garmin map.tif&lt;/pre&gt;You need the latest development version of &lt;a href="http://www.gdal.org/"&gt;GDAL&lt;/a&gt; to do that - and the new version of gdal2tiles which I will commit to SVN during the &lt;a href="http://wiki.osgeo.org/wiki/FOSS4G_2009_Code_Sprint"&gt;FOSS4G Code Sprint&lt;/a&gt; on this Saturday here in Sydney.&lt;br /&gt;&lt;br /&gt;It would be cool to buy the &lt;a href="http://www.garmin.ch/de/PN0704TOPO.html"&gt;Garmin Oregon 400t&lt;/a&gt; (1099 CHF ~ 1065 USD) to test and be able to really use this MapTiler functionality, once I am back in Switzerland. ;-)&lt;br /&gt;&lt;br /&gt;I welcome patches improving the user interface or the functionality.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689009-7094361537349186707?l=blog.klokantech.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/klokan-blog-osgeo/~4/KqfvHec3es4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.klokantech.com/feeds/7094361537349186707/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6689009&amp;postID=7094361537349186707" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/7094361537349186707" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/7094361537349186707" /><link rel="alternate" type="text/html" href="http://feeds.klokan.cz/~r/klokan-blog-osgeo/~3/KqfvHec3es4/garmin-custom-maps-kmz-from-geotiff-via.html" title="Garmin Custom Maps KMZ from GeoTIFF via MapTiler / GDAL2Tiles" /><author><name>Petr Pridal</name><uri>https://profiles.google.com/109686779214381837110</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-wUrU02dFKNg/AAAAAAAAAAI/AAAAAAAAL-Y/xdZuSqLIgds/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_YHHsqgPwuzQ/StDK4kljxsI/AAAAAAAAI3A/MBVDjmEepZA/s72-c/garmin_logo.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.klokantech.com/2009/10/garmin-custom-maps-kmz-from-geotiff-via.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-6689009.post-638853301610314846</id><published>2008-11-27T08:41:00.000+01:00</published><updated>2008-11-27T08:59:52.752+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="osgeo" /><category scheme="http://www.blogger.com/atom/ns#" term="maptiler" /><category scheme="http://www.blogger.com/atom/ns#" term="maps" /><category scheme="http://www.blogger.com/atom/ns#" term="google" /><title type="text">Tiles à la Google Maps: Coordinates, Tile Bounds and Projection...</title><content type="html">&lt;a href="http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 256px;" src="http://2.bp.blogspot.com/_YHHsqgPwuzQ/SSurkO4UYOI/AAAAAAAAHwQ/QOgrTBh4D8k/s400/maps-tile-bounds-coordinates.png" border="0" alt="Google Maps Coordinates, Tile Bounds and Projection"/&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I prepared an online tool I was missing when I started to study how the tiling using Spherical Mercator runs in Google Maps, Virtual Earth, Yahoo Maps, OpenStreeMap and others... This tool can help you to understand how are the tiles referenced and how they are stitched together in the browser.&lt;br /&gt;&lt;br /&gt;I think this mashup could be an excellent starting point for people who are interested in this subject, because it contains all the math what you need for overlaying your own geodata from external sources: it can be tiles pre-generated by Maptiler/GDAL2Tiles following the OSGeo TMS recommendations, it can be raster data from WMS servers probably cached by TileCache, or tiles from MSR MapCruncher etc.&lt;br /&gt;&lt;br /&gt;The tool is excellent for fast debugging of tiling for particular area, because you can use the search for display the tiles of a given place.&lt;br /&gt;&lt;br /&gt;A transparent tile with correct coordinates is displayed for every original map tile by calling Google Chart API service.&lt;br /&gt;Whereever you click the longitude/latitude boundaries of the underlaying tile are displayed in WGS84 datum. Boundaries are also displayed in projected Mercator coordinates (EPSG:900913, EPSG:3785) and in pixels for active zoom level. This information is all you need for generating custom map tiles.&lt;br /&gt;&lt;br /&gt;The site contains also a Python script doing the coordinates and bounds calculation offline.&lt;br /&gt;&lt;br /&gt;So enjoy this mashup:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/"&gt;Tiles à la Google Maps: Coordinates, Tile Bounds and Projection&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;BTW This demo is part of the documentation of &lt;a href="http://www.maptiler.org/"&gt;MapTiler&lt;/a&gt; application.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689009-638853301610314846?l=blog.klokantech.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/klokan-blog-osgeo/~4/3opA6hrMlms" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.klokantech.com/feeds/638853301610314846/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6689009&amp;postID=638853301610314846" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/638853301610314846" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/638853301610314846" /><link rel="alternate" type="text/html" href="http://feeds.klokan.cz/~r/klokan-blog-osgeo/~3/3opA6hrMlms/tiles-la-google-maps-coordinates-tile.html" title="Tiles à la Google Maps: Coordinates, Tile Bounds and Projection..." /><author><name>Petr Pridal</name><uri>https://profiles.google.com/109686779214381837110</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-wUrU02dFKNg/AAAAAAAAAAI/AAAAAAAAL-Y/xdZuSqLIgds/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_YHHsqgPwuzQ/SSurkO4UYOI/AAAAAAAAHwQ/QOgrTBh4D8k/s72-c/maps-tile-bounds-coordinates.png" height="72" width="72" /><thr:total>5</thr:total><feedburner:origLink>http://blog.klokantech.com/2008/11/tiles-la-google-maps-coordinates-tile.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-6689009.post-2620139807934761967</id><published>2008-11-05T09:01:00.006+01:00</published><updated>2008-11-05T10:02:28.373+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="osgeo" /><category scheme="http://www.blogger.com/atom/ns#" term="maptiler" /><category scheme="http://www.blogger.com/atom/ns#" term="maps" /><category scheme="http://www.blogger.com/atom/ns#" term="gdal" /><title type="text">PNG palette with variable alpha: small and great for webbrowser</title><content type="html">I am working on the &lt;a href="http://www.maptiler.org/"&gt;MapTiler&lt;/a&gt;/&lt;a href="http://www.klokan.cz/projects/gdal2tiles/"&gt;GDAL2Tiles&lt;/a&gt; open-source project for user-friendly static tile publishing of maps in the style of Google Maps. This project started as my &lt;a href="http://code.google.com/soc/"&gt;Google Summer of Code&lt;/a&gt; project for &lt;a href="http://www.osgeo.org/"&gt;OSGEO&lt;/a&gt; and results are published in coming GDAL 1.6.&lt;br /&gt;&lt;br /&gt;Recently I was testing several optimization of PNG for minimizing the tile size with preserving reasonable image quality as this is crucial for my application. Such optimization speeds up the download and also saves a lot of space on the hard disk. There is plenty of tools available for optimizing the size of PNG: advpng, pngrewrite, pngcrush, pngquant, scolorq, pngnq... I wanted to choose one of them for postprocessing of tiles (or probably later on integrate such optimization directly into GDAL).&lt;br /&gt;&lt;a href="http://www.maptiler.org/"&gt;&lt;img style="float:right; margin:0 0 10px 10px; cursor:hand; width: 166px; height: 175px;" src="http://1.bp.blogspot.com/_YHHsqgPwuzQ/SRBxS7onB8I/AAAAAAAAGJE/5M62_sdMJdw/s320/pngtransparent-nq8.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5264832534455715778" /&gt;&lt;/a&gt;&lt;br /&gt;The best optimization of the PNG filesize is always based on reduction of the amount of used colors: when you switch from RGB(A) model to palette. What I didn't know before is that PNG supports palette with variable alpha. It means that part of the definition of every color in the palette is also its transparency. It is possible to use functionality usually available only with separate alpha channels but with palette!&lt;br /&gt;&lt;br /&gt;After switching to PNG with palette you need just &lt;b&gt;half or even less of the space&lt;/b&gt; for your image raster data. Of course conversion from RGBA to palette is lossy operation for images with a lot of colors... but with well chosen algorithm for quantization it can be almost not recognizable for humans. Especially for small tiles like in MapTiler case. &lt;br /&gt;&lt;br /&gt;The PNG with the alpha palette is correctly displayed in all latest web-browsers like Firefox 2+, Safari, Explorer 7+ and also in Google Earth.&lt;br /&gt;But wait that is not all! &lt;a href="http://www.v-methods.com/ji/palette_alpha.html"&gt;Internet Explorer 5.5 &amp; 6 displays such PNG files with (limited) transparency without HTML hacking!&lt;/a&gt; That is just great because it allows you to easily display map overlays in the old browsers by viewers like OpenLayers or Google Maps and still be able to &lt;a href="http://www.maptiler.org/google-maps-overlay-opacity-control/"&gt;dynamically change opacity for map overlay containing transparent parts&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;Well, if it is so great, how to produce such file? There is very nice open-source application for converting standard RGBA PNGs into this PNG8 with alpha palette: &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;PNGNQ&lt;/span&gt;: &lt;a href="http://pngnq.sourceforge.net/"&gt;http://pngnq.sourceforge.net/&lt;/a&gt; (by Stuart Coyle and Greg Roelofs)&lt;br /&gt;&lt;br /&gt;It is using &lt;a href="http://members.ozemail.com.au/~dekker/NEUQUANT.HTML"&gt;The NeuQuant Neural-Net image quantization algorithm&lt;/a&gt; (by Anthony Dekker) which was documented in this &lt;a href="http://members.ozemail.com.au/~dekker/NeuQuant.pdf"&gt;PDF article&lt;/a&gt;. With slightly modified version of this algorithm it converts standard PNG24 with RGBA into PNG8 with alpha palette. It is quite fast.&lt;br /&gt;The result PNG file has usually half of the size of the original.&lt;br /&gt;If you are crazy about the produced png size you can try to compress the file with pngcruch postprocessing step. Sometimes it decrese the size of the result even a bit more.&lt;br /&gt;&lt;br /&gt;The documentation at the PNGNQ project page recommends to run:&lt;br /&gt;&lt;br /&gt;&lt;div align="center" style="background:#eee; padding: 8px 0;"&gt;&lt;pre&gt;pngnq -n 256 image.png &amp;&amp; pngcrush image-nq8.png smallimage.png&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This PNGNQ tool is excellent for post-processing of PNG tiles generated from MapTiler/GDAL2Tiles...&lt;br /&gt;&lt;br /&gt;And it seems that the source code of the utility itself as well as of dependencies like NeuQuant algorithm is compatible with BSD license so they have a chance to find a way into GDAL or other open-source tools which are processing maps...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6689009-2620139807934761967?l=blog.klokantech.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/klokan-blog-osgeo/~4/7Pewm_WJCyU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.klokantech.com/feeds/2620139807934761967/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6689009&amp;postID=2620139807934761967" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/2620139807934761967" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6689009/posts/default/2620139807934761967" /><link rel="alternate" type="text/html" href="http://feeds.klokan.cz/~r/klokan-blog-osgeo/~3/7Pewm_WJCyU/png-palette-with-variable-alpha-small.html" title="PNG palette with variable alpha: small and great for webbrowser" /><author><name>Petr Pridal</name><uri>https://profiles.google.com/109686779214381837110</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-wUrU02dFKNg/AAAAAAAAAAI/AAAAAAAAL-Y/xdZuSqLIgds/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_YHHsqgPwuzQ/SRBxS7onB8I/AAAAAAAAGJE/5M62_sdMJdw/s72-c/pngtransparent-nq8.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.klokantech.com/2008/11/png-palette-with-variable-alpha-small.html</feedburner:origLink></entry></feed>

