{"url":"https://api.github.com/gists/5050837","forks_url":"https://api.github.com/gists/5050837/forks","commits_url":"https://api.github.com/gists/5050837/commits","id":"5050837","node_id":"MDQ6R2lzdDUwNTA4Mzc=","git_pull_url":"https://gist.github.com/5050837.git","git_push_url":"https://gist.github.com/5050837.git","html_url":"https://gist.github.com/mbostock/5050837","files":{".block":{"filename":".block","type":"text/plain","language":null,"raw_url":"https://gist.githubusercontent.com/mbostock/5050837/raw/703d310b399098a243a76a50bc209167e924cfd2/.block","size":17,"truncated":false,"content":"license: gpl-3.0\n"},"README.md":{"filename":"README.md","type":"text/markdown","language":"Markdown","raw_url":"https://gist.githubusercontent.com/mbostock/5050837/raw/7806ed5addc1fe56649eda9e54ce597117a2d3a7/README.md","size":1381,"truncated":false,"content":"Use the brush to select extent coordinates interactively.\n\nThe [gdalwarp](http://www.gdal.org/gdalwarp.html) utility can crop the warped output image using the `-te` argument, which specifies a geographic extent as *xmin ymin xmax ymax* coordinates in the target projection. For example, the extent -2030000 -1250000 -1300000 -40400 shown above encompasses California when using EPSG:2163, the [U.S. National Atlas projection](http://spatialreference.org/ref/epsg/2163/).\n\nThe trick to computing these coordinates is to know the scale of the underlying Lambert azimuthal equal-area projection: 6,370,997 meters, as shown in the [human-readable projection definition](http://spatialreference.org/ref/epsg/2163/prettywkt/). From there, it is possible to translate between pixel space and EPSG:2163 coordinates.\n\n```js\nfunction te(projection) {\n var radius = 6370997,\n scale = projection.scale(),\n rotate = projection.rotate(),\n translate = projection.translate(),\n offset = projection.rotate([0, 0]).translate([0, 0])([0, 0]);\n\n projection.rotate(rotate).translate(translate);\n\n return [\n Math.round((-offset[0] - translate[0]) / scale * radius),\n Math.round((offset[1] + translate[1] - height) / scale * radius),\n Math.round((-offset[0] - translate[0] + width) / scale * radius),\n Math.round((offset[1] + translate[1]) / scale * radius)\n ];\n}\n```"},"index.html":{"filename":"index.html","type":"text/html","language":"HTML","raw_url":"https://gist.githubusercontent.com/mbostock/5050837/raw/ad174b0d16be92b177b336441d7b531bdc97e122/index.html","size":2687,"truncated":false,"content":"\n\n\n
\n\n\n\n"},"thumbnail.png":{"filename":"thumbnail.png","type":"image/png","language":null,"raw_url":"https://gist.githubusercontent.com/mbostock/5050837/raw/72bd3f859fbc0e8ba796db459e7a0e7ceb5685cf/thumbnail.png","size":29738,"truncated":false,"content":"�PNG\r\n\u001A\n\u0000\u0000\u0000\rIHDR\u0000\u0000\u0000�\u0000\u0000\u0000x\b\u0002\u0000\u0000\u0000id\u0019�\u0000\u0000\u000B�iCCPicm\u0000\u0000HǕ�\u0007TSI\u0017��$\u0010�P\u0002�H\t�+E���AA:�\bI ��\u0010\b\"vdQ���\bVt\u0005D��\u0000�\u0016Į,��/�((�.6T�I(���{�������;w�ܹoޜ\u0019\u0000h�l�(\u001DU\u0002 C�-�\b�a��'0I�\u0000\u0002P�\u0002H@���\u0012y�����w��5�\u001B�R_�߉2���\u0001\u0000\t�����d@>\n\u0000��\u0011��\u0001 H�\u0019��\u0016Iy\u001DdU1\f\u0010�^)��p���F�Uf\u0013\u0015���\t�\u001C��\u0016�\u0000@�zf\u000E'\u0005��Q �\b�\u0002!�)�=8|6\u0017�B�V\u0019\u0019s�\\\u0005�,�/~R��gҸO6;e�G�\"\u00139_A�(�=�_���KF�dl\f]X(Yi�!�ɀy���\"!k@^��\u0005������}\"F�'\u0004�AQ�\u001CA�ɗ\u0004F�r�$-�\u001B�6��isC��0O��0iZ\u0018d\u0015�F�,VO�1�\u001F\u0015;j\u0013����A��\b�\u0013ύ\u0018��g�D������ic���`���A.b�es�1����\u0000�\u0006�\u000F��ãF�j\u0013�O\u001B�\u000B�4Y�\u001F1ʟxY������G\u0005��ǔ��\u0002\u0018�i'\u000B��Fb�l���1��(]��a_,J,����\br2O\u0018=�\u0013+�}CFr�m\u0003��\rĀ\u0007��\u0010�\u0001&\b\u0005,�;Z3�^\bk\u000E�\u000B�a\u00113\u0015�Z\b�\b\u001D�'�[�N½qk֘\u001D\u0010\u0000.|��9�G�<�;��\u0003Yc��Z�\u0007��\u000B\u0016;�\u0019w\u0019kk�o�\u001F�j$�\u0014��zT�3\u001A}\u000E��e�n� _�]���\u001E��\u001F<�y\u001D������<��ی�~D_b џh��Ď`\u0017�3�e�\u0004�\u0000��i�\u0011k�NJ��QأY\u0011��\u001B\u0002G�\u0001��M�?#��[�ji\u00164\u0007\u0010!�O�m��\u0011bdQ\u000B��E\u0002K\u0012��\n�B��8�i\u0013�]\u0007�\u0007w�y�9�\u0019�\u0016��'Ì{��\u001B8@-��^��5H��2G6�4�\frF6/7[��YsE�ł\u0014~6�\u001B�<+f��3ъigck\u000F�{�ȯ��!�S\u0011ƕo��f\u0000\\��2囎m\b��g\u0000��}�\u0019���\u0001�+O�s$�\u0011\u001D.�\b�\f\u0014��ׄ;�!0�q�\u0001G�\u0006��\u001F\b\u0006a \nă�0�|�\u0001#�\u0007\u0016�e�\u0010\u0014�u`3(\u0003;�\u001EP\u0005\u000E�à\u0001�\u0000g�\u0005p\u0015��[�\u0001�\u0004=�%\u0018\u0000��\u0010� $���\u0011MD\u000F1F,\u0011;�\u0019�@��P$\u0002�G\u0012�\u0014D�H���r�\u0018ـ�!��j�g�8r\u0006��t ��.�\u000Fy�|B1����:�\t:\tuF��\u00104\n�����h\u001EZ��AK�\n�\u0000Z��A����N�%:�\u0001L\u0001c`��5挱�0,\u0001K���b�\b+�*�Z�\t��\u001BX'֏}ĉ8\u001Dg���K\u0006��8\u0007��\u0017��2�\n����7�.|\u0000�J�\u0012�\t�\u0004WB\u0010!��B�G($�\u0010�\u0011�\u0011�������H$2��D'��㉩�\u0005�����:b3���M\u001C$�H�$K�;)��&e�\nI[I\u0007H�I�I=�\u000Fr\nrzrvr�r\trB�|�\u0012��r���=�\u001B�W�7�w�\u000F���ϗ_+�W�I��|��\u0010Y�lJv'G�S��ȥ�Z�y�C�[\u0005\u0005\u0005\u0003\u0005\u0017��\n\u0002��\n�\n�\u0014.)t)|��P,(,�L����RIi�ܣ��R�&T/j\u00025���ZM=K}L�@��&҂h\\�\u0012Z9��v��JQ^�X�[q�b�b��\u0011�k��J�J&J,%��b�r��Jw�\u0006��ʶ�a�\u0019ʫ��+_V�U!�����pU\nT���U�ctC:�Ρ/�寧���\u0012UMU�TSU�U\u000F���\u000E���MV�Q�U+W;����\u0018&� F:c-�0�6㓺���:O}�z��u��\u001A\u00134�4x\u001AE\u001Au\u001A�4>i25�4�4�k6h>�µ,��k��ڡu^���\u0004�\t�\tE\u0013\u000EO���j[hGh/�ޣݪ=���\u0013�#�٪sV�_��륛��I��n�\u001E]�CO��I��\u000B�\u001Aӛ��,e�c\u000E�k�\u0007�K�w��\u000F\u0019�\u001AD\u001B�\u001B�\u0019<2$\u001B:\u001B&\u001Bn2l1\u001C0�3�j�Ш�辱���1�x��E��&�&�&+L\u001ALzM5L�L�LkL\u001F�Q�<�2�*�n�\u0013͝��̷��[�\u0016\u000E\u0016|�r�k������r�e�\u0015���JhUauǚb�m�c]c�5�11tb�Ć��&\u0019MJ��~��I_m\u001Cl�m��<�U�\r�ͷm�}cgaDZ+��iO���_b�h�z��d��\u001D��:�\u001D�:�phq����(v�u�s2rJt��t�Y�9�y��%\u0017����\u0012�\u0013.\u001F]\u001D]�]\u000F���f��߭w��\u0014ޔ�S��\r����;=�\u001E�\u001E�<:=�=ٞ\u0015�O�\f��^���{�{�z\u001F�~�c�#�9����Z�j��|\u0003|�|��T�����\u001E�\u001B�����\u000F\u00048\u0004,\bh\u000E$\u0004�\u0004�\u000F�\u0013�\u0013�\t�\u000E\u001A\bv\n^\u0014|.�\u0012\u0012\u0019R\u0016�$�\"T\u001C�4\u0015�\u001A�|��\bۈ�\u0011\u0017#�s\"�G���Z\u001B� �,Z\u0012�\u0012�\u001833�:�}�o��θIq���k�\u000B�\u001B\u0013H\t1\t�\u0012\u0006g���<�g����g��ʝuy�����'�(�a�9�HH�Mܟ��\u001DƮ`\u000F&\u0005%mK\u001A�8[8/�^�M�>�;o\u0003�y�{���\u0014���)}|O~\t�_�\u0012�\t^�\u0006��L}�\u0016�V�6�\u001E�^�!���q\\�\"L\u0013���;7wn��RT(��t�ܜ9 \u000E\u0011��B�fe5f��Cn��L�+�#�<�ü�yGr�s����-毚�<�?�\u0005�\u0002���\u000B�-�Z�h�bdq��%�K\n��,\rXZ���,mٯ�6�\u001B��\\\u001E���@�`iA�\u000F\u0001?�\u0014�\nŅwV��ع\u0012_)Xٶ�~��U_��EW�m�K�?�款�폥?\u000E�I^Ӷ�q�u�u�u��{��ڠ�!oC�Ʃ\u001B�717\u0015m�s�͗K&���B�\"��Y\u001AZڸ�h뺭���e��}��io[���v���;�v����Y���.����\u0003v�W�T��!����lo�ދ?9�T�Ok_�/���Ϊ��s�N�������Ak$5}\u0007f\u001Eh?�{��ֺvw\u001D���\u00108$9���ğo\u001F\u000E9�r��H�Q�ێя\u0015�#���\u0007\u001A�\r���\u001Dǃ��4�5\u001D�e�/�'�O��T;��\u0014�T����y�\u0007�E��gR�t��iyp6���s�ϵ�\u000F9����\u0017�/���~��e��ǯ8_i��x��ա�د\u000E�\u001Eksl���t��ݥ��cJǩ�����q�f�ͫ����\u001D}�w:�r���K���~���\u0007K\u001F\u0012\u001E\u0016=RzT�X�q�o��u:v����j}\u0012��A7���Ӭ��{\n�Q��<�{^�k�{�Ͽ��Ō\u0017=/E/��\u000BW�}�+�WG����u n������o5�V�9�ϖ�����2�\r�/������Nj�b?=\u001F����������!_\u001F\u000Eg\f\u000F��b��(���&'\u0003�\u0012�[��١\u001D\u00002m�n$\u0013d�>'#�O