{"id":238,"date":"2007-07-24T01:12:48","date_gmt":"2007-07-24T06:12:48","guid":{"rendered":"http:\/\/crschmidt.net\/blog\/?p=238"},"modified":"2007-07-24T01:12:48","modified_gmt":"2007-07-24T06:12:48","slug":"understanding-googles-projection-slightly-anyway","status":"publish","type":"post","link":"https:\/\/crschmidt.net\/blog\/archives\/238\/understanding-googles-projection-slightly-anyway\/","title":{"rendered":"Understanding Google&#8217;s Projection&#8230; slightly, anyway"},"content":{"rendered":"<p>So, as a result of <a href=\"http:\/\/spatialreference.org\/user\/6\/\">Custom Projection 6: Google Projection<\/a>, I got pinged by <a href=\"http:\/\/www.sharpgis.net\/\">SharpGIS<\/a> on IRC, and told that the projection I had there was wrong.<\/p>\n<p>He helped me understand what he was using, and I let him know it still wasn&#8217;t helping me. So I set up a <a href=\"http:\/\/crschmidt.net\/mapping\/ve-tilecache.html\">Virtual Earth + TileCache<\/a> demo, and he helped me find the missing piece, in the <a href=\"http:\/\/proj.maptools.org\/faq.html\">proj4 FAQ<\/a>:<\/p>\n<blockquote><p>\nIn this case, and many other cases using spherical projections, the desired approach is to actually treat the lat\/long locations on the sphere as if they were on WGS84 without any adjustments when using them for converting to other coordinate systems. The solution is to &#8220;trick&#8221; PROJ.4 into applying no change to the lat\/long values when going to (and through) WGS84. This can be accomplished by asking PROJ to use a null grid shift file for switching from your spherical lat\/long coordinates to WGS84.<\/p>\n<p>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs\n<\/p><\/blockquote>\n<p>The key here was the +nadgrids=@null, which I&#8217;d never seen anywhere before.<\/p>\n<p>The end result?<\/p>\n<ul>\n<li><a href=\"http:\/\/lists.openstreetmap.org\/pipermail\/dev\/2007-July\/005854.html\">Fixing my OSM Tiles<\/a><\/li>\n<li><a href=\"http:\/\/dev.openlayers.org\/sandbox\/crschmidt\/google\/examples\/google-factbook-tc.html\">WMS and TMS<\/a> overlaid in OpenLayers, as <a href=\"http:\/\/openlayers.org\/pipermail\/dev\/2007-July\/001076.html\">described in an email<\/a><\/li>\n<li>A slightly better understanding of what I didn&#8217;t understand for so long.<\/li>\n<\/ul>\n<p>So. Nice. To not feel lost anymore.<\/p>\n<p>Three cheers for sharpgis! Hooray hooray hooray!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, as a result of Custom Projection 6: Google Projection, I got pinged by SharpGIS on IRC, and told that the projection I had there was wrong. He helped me understand what he was using, and I let him know it still wasn&#8217;t helping me. So I set up a Virtual Earth + TileCache demo, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44,54,62],"tags":[],"class_list":["post-238","post","type-post","status-publish","format-standard","hentry","category-locality-and-space","category-openlayers","category-openstreetmap"],"_links":{"self":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/comments?post=238"}],"version-history":[{"count":0,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/238\/revisions"}],"wp:attachment":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/media?parent=238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/categories?post=238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/tags?post=238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}