This commit is contained in:
sleptworld 2023-09-21 01:01:23 +08:00
parent 98f3595585
commit 6bcf8ccc84
17 changed files with 709 additions and 336 deletions

197
down.py
View File

@ -1,197 +0,0 @@
def _downsample_2d(src, mask, use_mask, method, fill_value, mode_rank, out):
src_w = src.shape[-1]
src_h = src.shape[-2]
out_w = out.shape[-1]
out_h = out.shape[-2]
if src_w == out_w and src_h == out_h:
return src
if out_w > src_w or out_h > src_h:
raise ValueError("invalid target size")
scale_x = src_w / out_w
scale_y = src_h / out_h
if method == DS_FIRST or method == DS_LAST:
for out_y in range(out_h):
src_yf0 = scale_y * out_y
src_yf1 = src_yf0 + scale_y
src_y0 = int(src_yf0)
src_y1 = int(src_yf1)
if src_y1 == src_yf1 and src_y1 > src_y0:
src_y1 -= 1
for out_x in range(out_w):
src_xf0 = scale_x * out_x
src_xf1 = src_xf0 + scale_x
src_x0 = int(src_xf0)
src_x1 = int(src_xf1)
if src_x1 == src_xf1 and src_x1 > src_x0:
src_x1 -= 1
done = False
value = fill_value
for src_y in range(src_y0, src_y1 + 1):
for src_x in range(src_x0, src_x1 + 1):
v = src[src_y, src_x]
if np.isfinite(v) and not (use_mask and mask[src_y, src_x]):
value = v
if method == DS_FIRST:
done = True
break
if done:
break
out[out_y, out_x] = value
elif method == DS_MODE:
max_value_count = int(scale_x + 1) * int(scale_y + 1)
values = np.zeros((max_value_count,), dtype=src.dtype)
frequencies = np.zeros((max_value_count,), dtype=np.uint32)
for out_y in range(out_h):
src_yf0 = scale_y * out_y
src_yf1 = src_yf0 + scale_y
src_y0 = int(src_yf0)
src_y1 = int(src_yf1)
wy0 = 1.0 - (src_yf0 - src_y0)
wy1 = src_yf1 - src_y1
if wy1 < _EPS:
wy1 = 1.0
if src_y1 > src_y0:
src_y1 -= 1
for out_x in range(out_w):
src_xf0 = scale_x * out_x
src_xf1 = src_xf0 + scale_x
src_x0 = int(src_xf0)
src_x1 = int(src_xf1)
wx0 = 1.0 - (src_xf0 - src_x0)
wx1 = src_xf1 - src_x1
if wx1 < _EPS:
wx1 = 1.0
if src_x1 > src_x0:
src_x1 -= 1
value_count = 0
for src_y in range(src_y0, src_y1 + 1):
wy = wy0 if (src_y == src_y0) else wy1 if (src_y == src_y1) else 1.0
for src_x in range(src_x0, src_x1 + 1):
wx = wx0 if (src_x == src_x0) else wx1 if (src_x == src_x1) else 1.0
v = src[src_y, src_x]
if np.isfinite(v) and not (use_mask and mask[src_y, src_x]):
w = wx * wy
found = False
for i in range(value_count):
if v == values[i]:
frequencies[i] += w
found = True
break
if not found:
values[value_count] = v
frequencies[value_count] = w
value_count += 1
w_max = -1.
value = fill_value
if mode_rank == 1:
for i in range(value_count):
w = frequencies[i]
if w > w_max:
w_max = w
value = values[i]
elif mode_rank <= max_value_count:
max_frequencies = np.full(mode_rank, -1.0, dtype=np.float64)
indices = np.zeros(mode_rank, dtype=np.int64)
for i in range(value_count):
w = frequencies[i]
for j in range(mode_rank):
if w > max_frequencies[j]:
max_frequencies[j] = w
indices[j] = i
break
value = values[indices[mode_rank - 1]]
out[out_y, out_x] = value
elif method == DS_MEAN:
for out_y in range(out_h):
src_yf0 = scale_y * out_y
src_yf1 = src_yf0 + scale_y
src_y0 = int(src_yf0)
src_y1 = int(src_yf1)
wy0 = 1.0 - (src_yf0 - src_y0)
wy1 = src_yf1 - src_y1
if wy1 < _EPS:
wy1 = 1.0
if src_y1 > src_y0:
src_y1 -= 1
for out_x in range(out_w):
src_xf0 = scale_x * out_x
src_xf1 = src_xf0 + scale_x
src_x0 = int(src_xf0)
src_x1 = int(src_xf1)
wx0 = 1.0 - (src_xf0 - src_x0)
wx1 = src_xf1 - src_x1
if wx1 < _EPS:
wx1 = 1.0
if src_x1 > src_x0:
src_x1 -= 1
v_sum = 0.0
w_sum = 0.0
for src_y in range(src_y0, src_y1 + 1):
wy = wy0 if (src_y == src_y0) else wy1 if (src_y == src_y1) else 1.0
for src_x in range(src_x0, src_x1 + 1):
wx = wx0 if (src_x == src_x0) else wx1 if (src_x == src_x1) else 1.0
v = src[src_y, src_x]
if np.isfinite(v) and not (use_mask and mask[src_y, src_x]):
w = wx * wy
v_sum += w * v
w_sum += w
if w_sum < _EPS:
out[out_y, out_x] = fill_value
else:
out[out_y, out_x] = v_sum / w_sum
elif method == DS_VAR or method == DS_STD:
for out_y in range(out_h):
src_yf0 = scale_y * out_y
src_yf1 = src_yf0 + scale_y
src_y0 = int(src_yf0)
src_y1 = int(src_yf1)
wy0 = 1.0 - (src_yf0 - src_y0)
wy1 = src_yf1 - src_y1
if wy1 < _EPS:
wy1 = 1.0
if src_y1 > src_y0:
src_y1 -= 1
for out_x in range(out_w):
src_xf0 = scale_x * out_x
src_xf1 = src_xf0 + scale_x
src_x0 = int(src_xf0)
src_x1 = int(src_xf1)
wx0 = 1.0 - (src_xf0 - src_x0)
wx1 = src_xf1 - src_x1
if wx1 < _EPS:
wx1 = 1.0
if src_x1 > src_x0:
src_x1 -= 1
v_sum = 0.0
w_sum = 0.0
wv_sum = 0.0
wvv_sum = 0.0
for src_y in range(src_y0, src_y1 + 1):
wy = wy0 if (src_y == src_y0) else wy1 if (src_y == src_y1) else 1.0
for src_x in range(src_x0, src_x1 + 1):
wx = wx0 if (src_x == src_x0) else wx1 if (src_x == src_x1) else 1.0
v = src[src_y, src_x]
if np.isfinite(v) and not (use_mask and mask[src_y, src_x]):
w = wx * wy
v_sum += v
w_sum += w
wv_sum += w * v
wvv_sum += w * v * v
if w_sum < _EPS:
out[out_y, out_x] = fill_value
else:
out[out_y, out_x] = (wvv_sum * w_sum - wv_sum * wv_sum) / w_sum / w_sum
if method == DS_STD:
out = np.sqrt(out).astype(out.dtype)
else:
raise ValueError('invalid upsampling method')
return out

View File

@ -0,0 +1,547 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Natural Earth &raquo; Blog Archive &raquo; Admin 0 &#8211; Countries - Free vector and raster map data at 1:10m, 1:50m, and 1:110m scales </title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="alternate" type="application/rss+xml" title="Natural Earth RSS Feed" href="https://www.naturalearthdata.com/feed/" />
<link rel="pingback" href="http://www.naturalearthdata.com/xmlrpc.php" />
<script type="text/javascript" src="http://www.naturalearthdata.com/wp-content/themes/NEV/includes/js/suckerfish.js"></script>
<!--[if lt IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE7.js" type="text/javascript"></script>
<script defer="defer" type="text/javascript" src="http://www.naturalearthdata.com/wp-content/themes/NEV/includes/js/pngfix.js"></script>
<![endif]-->
<link rel="stylesheet" href="http://www.naturalearthdata.com/wp-content/themes/NEV/style.css" type="text/css" media="screen" />
<link rel='dns-prefetch' href='//s.w.org' />
<link rel="alternate" type="application/rss+xml" title="Natural Earth &raquo; Admin 0 &#8211; Countries Comments Feed" href="https://www.naturalearthdata.com/downloads/110m-cultural-vectors/110m-admin-0-countries/feed/" />
<script type="text/javascript">
window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/13.0.0\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/13.0.0\/svg\/","svgExt":".svg","source":{"concatemoji":"http:\/\/www.naturalearthdata.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=5.5.9"}};
!function(e,a,t){var n,r,o,i=a.createElement("canvas"),p=i.getContext&&i.getContext("2d");function s(e,t){var a=String.fromCharCode;p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,e),0,0);e=i.toDataURL();return p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,t),0,0),e===i.toDataURL()}function c(e){var t=a.createElement("script");t.src=e,t.defer=t.type="text/javascript",a.getElementsByTagName("head")[0].appendChild(t)}for(o=Array("flag","emoji"),t.supports={everything:!0,everythingExceptFlag:!0},r=0;r<o.length;r++)t.supports[o[r]]=function(e){if(!p||!p.fillText)return!1;switch(p.textBaseline="top",p.font="600 32px Arial",e){case"flag":return s([127987,65039,8205,9895,65039],[127987,65039,8203,9895,65039])?!1:!s([55356,56826,55356,56819],[55356,56826,8203,55356,56819])&&!s([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]);case"emoji":return!s([55357,56424,8205,55356,57212],[55357,56424,8203,55356,57212])}return!1}(o[r]),t.supports.everything=t.supports.everything&&t.supports[o[r]],"flag"!==o[r]&&(t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&t.supports[o[r]]);t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&!t.supports.flag,t.DOMReady=!1,t.readyCallback=function(){t.DOMReady=!0},t.supports.everything||(n=function(){t.readyCallback()},a.addEventListener?(a.addEventListener("DOMContentLoaded",n,!1),e.addEventListener("load",n,!1)):(e.attachEvent("onload",n),a.attachEvent("onreadystatechange",function(){"complete"===a.readyState&&t.readyCallback()})),(n=t.source||{}).concatemoji?c(n.concatemoji):n.wpemoji&&n.twemoji&&(c(n.twemoji),c(n.wpemoji)))}(window,document,window._wpemojiSettings);
</script>
<style type="text/css">
img.wp-smiley,
img.emoji {
display: inline !important;
border: none !important;
box-shadow: none !important;
height: 1em !important;
width: 1em !important;
margin: 0 .07em !important;
vertical-align: -0.1em !important;
background: none !important;
padding: 0 !important;
}
</style>
<link rel='stylesheet' id='wp-block-library-css' href='http://www.naturalearthdata.com/wp-includes/css/dist/block-library/style.min.css?ver=5.5.9' type='text/css' media='all' />
<link rel='stylesheet' id='bbp-child-bbpress-css' href='http://www.naturalearthdata.com/wp-content/themes/NEV/css/bbpress.css?ver=2.6.6' type='text/css' media='screen' />
<link rel="https://api.w.org/" href="https://www.naturalearthdata.com/wp-json/" /><link rel="alternate" type="application/json" href="https://www.naturalearthdata.com/wp-json/wp/v2/posts/1556" /><link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://www.naturalearthdata.com/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://www.naturalearthdata.com/wp-includes/wlwmanifest.xml" />
<link rel='prev' title='Admin 0 &#8211; Details' href='https://www.naturalearthdata.com/downloads/110m-cultural-vectors/110m-admin-0-details/' />
<link rel='next' title='Rivers, Lake Centerlines' href='https://www.naturalearthdata.com/downloads/110m-physical-vectors/110m-rivers-lake-centerlines/' />
<meta name="generator" content="WordPress 5.5.9" />
<link rel="canonical" href="https://www.naturalearthdata.com/downloads/110m-cultural-vectors/110m-admin-0-countries/" />
<link rel='shortlink' href='https://www.naturalearthdata.com/?p=1556' />
<link rel="alternate" type="application/json+oembed" href="https://www.naturalearthdata.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.naturalearthdata.com%2Fdownloads%2F110m-cultural-vectors%2F110m-admin-0-countries%2F" />
<link rel="alternate" type="text/xml+oembed" href="https://www.naturalearthdata.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.naturalearthdata.com%2Fdownloads%2F110m-cultural-vectors%2F110m-admin-0-countries%2F&#038;format=xml" />
<script type="text/javascript">
/* <![CDATA[ */
var ajaxurl = 'https://www.naturalearthdata.com/wp-admin/admin-ajax.php';
/* ]]> */
</script>
<!-- begin gallery scripts -->
<link rel="stylesheet" href="http://www.naturalearthdata.com/wp-content/plugins/featured-content-gallery/css/jd.gallery.css.php" type="text/css" media="screen" charset="utf-8"/>
<link rel="stylesheet" href="http://www.naturalearthdata.com/wp-content/plugins/featured-content-gallery/css/jd.gallery.css" type="text/css" media="screen" charset="utf-8"/>
<script type="text/javascript" src="http://www.naturalearthdata.com/wp-content/plugins/featured-content-gallery/scripts/mootools.v1.11.js"></script>
<script type="text/javascript" src="http://www.naturalearthdata.com/wp-content/plugins/featured-content-gallery/scripts/jd.gallery.js.php"></script>
<script type="text/javascript" src="http://www.naturalearthdata.com/wp-content/plugins/featured-content-gallery/scripts/jd.gallery.transitions.js"></script>
<!-- end gallery scripts -->
<link href="http://www.naturalearthdata.com/wp-content/themes/NEV/css/default.css" rel="stylesheet" type="text/css" />
<style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style><!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" href="http://www.naturalearthdata.com/wp-content/themes/NEV/ie.css" />
<![endif]-->
<script src="http://www.naturalearthdata.com/wp-content/themes/NEV/js/jquery-1.2.6.min.js" type="text/javascript" charset="utf-8"></script>
<script>
jQuery.noConflict();
</script>
<script type="text/javascript" charset="utf-8">
$(function(){
var tabContainers = $('div#maintabdiv > div');
tabContainers.hide().filter('#comments').show();
$('div#maintabdiv ul#tabnav a').click(function () {
tabContainers.hide();
tabContainers.filter(this.hash).show();
$('div#maintabdiv ul#tabnav a').removeClass('current');
$(this).addClass('current');
return false;
}).filter('#comments').click();
});
</script>
<script type="text/javascript" language="javascript" src="http://www.naturalearthdata.com/dataTables/media/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#ne_table').dataTable();
} );
</script>
</head>
<body>
<div id="page">
<div id="header">
<div id="headerimg">
<h1><a href="https://www.naturalearthdata.com/"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/nev_logo.png" alt="Natural Earth title="Natural Earth" /></a></h1>
<div class="description">Free vector and raster map data at 1:10m, 1:50m, and 1:110m scales</div>
<div class="header_search"><form method="get" id="searchform" action="https://www.naturalearthdata.com/">
<label class="hidden" for="s">Search for:</label>
<div><input type="text" value="" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>
</div>
<!--<div class="translate_panel" style="align:top; margin-left:650px; top:50px;">
<div id="google_translate_element" style="float:left;"></div>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
}
</script>
<script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</div>-->
</div>
</div>
<div id="pagemenu" style="align:bottom;">
<ul id="page-list" class="clearfix"><li class="page_item page-item-4"><a href="https://www.naturalearthdata.com/">Home</a></li>
<li class="page_item page-item-10"><a href="https://www.naturalearthdata.com/features/">Features</a></li>
<li class="page_item page-item-12 page_item_has_children"><a href="https://www.naturalearthdata.com/downloads/">Downloads</a></li>
<li class="page_item page-item-6 current_page_parent"><a href="https://www.naturalearthdata.com/blog/">Blog</a></li>
<li class="page_item page-item-5044"><a href="https://www.naturalearthdata.com/issues/">Issues</a></li>
<li class="page_item page-item-366"><a href="https://www.naturalearthdata.com/corrections/">Corrections</a></li>
<li class="page_item page-item-16 page_item_has_children"><a href="https://www.naturalearthdata.com/about/">About</a></li>
</ul>
</div>
<hr /><div id="main">
<div id="content" class="narrowcolumn">
<div class="post" id="post-1556">
<h2>Admin 0 &#8211; Countries</h2>
<div class="entry">
<div class="downloadPromoBlock">
<div style="float: left; width: 170px;"><img loading="lazy" class="alignleft size-thumbnail wp-image-92" title="home_image_3" src="https://www.naturalearthdata.com/wp-content/uploads/2009/09/thumb_countries.png" alt="countries_thumb" width="150" height="97" /></div>
<div style="float: left; width: 410px;"><em>There are <b>258 countries</b> in the world. Greenland as separate from Denmark. Most users will want this file instead of sovereign states, though some users will want map units instead when needing to distinguish overseas regions of France.</em></div>
<div style="float: left; width: 410px;">
<p><em>Natural Earth shows <a href="https://www.naturalearthdata.com/about/disputed-boundaries-policy/"><b>de facto</b></a> boundaries by default according to who controls the territory, versus <i>de jure</i>.</em></p>
<div class="download-link-div">
<a class="download-link" rel="nofollow" title="Downloaded 233548 times (Shapefile, geoDB, or TIFF format)" onclick="if (window.urchinTracker) urchinTracker ('https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip');" href="https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip">Download countries</a> <span class="download-link-span">(210.08 KB) version 5.1.1</span>
</div>
<div class="download-link-div">
<a class="download-link" rel="nofollow" title="Downloaded 24997 times (Shapefile, geoDB, or TIFF format)" onclick="if (window.urchinTracker) urchinTracker ('https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries_lakes.zip');" href="https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries_lakes.zip">Download without boundary lakes</a> <span class="download-link-span">(212.3 KB) version 5.1.1</span>
</div>
<p><span id="more-1556"></span></p>
</div>
</div>
<div class="downloadMainBlock">
<p><img loading="lazy" class="alignnone size-full wp-image-1896" title="countries_banner" src="https://www.naturalearthdata.com/wp-content/uploads/2009/09/banner_countries.png" alt="countries_banner" width="580" height="150" /></p>
<p><strong>About</strong></p>
<p>Countries distinguish between metropolitan (homeland) and independent and semi-independent portions of sovereign states. If you want to see the dependent overseas regions broken out (like in ISO codes, see France for example), use <a href="https://www.naturalearthdata.com/downloads/10m-political-vectors/10m-admin-0-nitty-gritty/">map units</a> instead.</p>
<p>Each country is coded with a world region that roughly follows the <a href="http://unstats.un.org/unsd/methods/m49/m49regin.htm">United Nations setup</a>.</p>
<p>Includes some thematic data from the United Nations, U.S. Central Intelligence Agency, and elsewhere.</p>
<p><strong>Disclaimer</strong></p>
<p>Natural Earth Vector draws boundaries of countries according to defacto status. We show who actually controls the situation on the ground. Please feel free to mashup our disputed areas (link) theme to match your particular political outlook.</p>
<p><strong>Known Problems</strong></p>
<p>None.</p>
<p><strong>Version History</strong></p>
<ul>
<li>
<a rel="nofollow" title="Download version 5.1.1 of ne_110m_admin_0_countries.zip" href="https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip">5.1.1</a>
</li>
<li>
<a rel="nofollow" title="Download version 5.1.0 of ne_110m_admin_0_countries.zip" href="https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip?version=5.1.0">5.1.0</a>
</li>
<li>
<a rel="nofollow" title="Download version 5.0.1 of ne_110m_admin_0_countries.zip" href="https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip?version=5.0.1">5.0.1</a>
</li>
<li>
<a rel="nofollow" title="Download version 5.0.0 of ne_110m_admin_0_countries.zip" href="https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip?version=5.0.0">5.0.0</a>
</li>
<li>
<a rel="nofollow" title="Download version 4.1.0 of ne_110m_admin_0_countries.zip" href="https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip?version=4.1.0">4.1.0</a>
</li>
<li>
<a rel="nofollow" title="Download version 4.0.0 of ne_110m_admin_0_countries.zip" href="https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip?version=4.0.0">4.0.0</a>
</li>
<li>
<a rel="nofollow" title="Download version 2.0.0 of ne_110m_admin_0_countries.zip" href="https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip?version=2.0.0">2.0.0</a>
</li>
<li>
1.4.0
</li>
<li>
1.3.0
</li>
<li>
1.1.0
</li>
</ul>
<p><a href="https://github.com/nvkelso/natural-earth-vector/blob/master/CHANGELOG">The master changelog is available on Github »</a></p>
</div>
<p class="postmetadata2">
<small>
This entry was posted
on Monday, September 21st, 2009 at 10:21 am and is filed under <a href="https://www.naturalearthdata.com/download/downloads/110m-cultural-vectors/" rel="category tag">110m-cultural-vectors</a>.
You can follow any responses to this entry through the <a href="https://www.naturalearthdata.com/downloads/110m-cultural-vectors/110m-admin-0-countries/feed/">RSS 2.0</a> feed.
Both comments and pings are currently closed.
</small>
</p>
</div>
</div>
<!-- You can start editing here. -->
<div id="maintabdiv">
<ul id="tabnav">
<li><a href="#comments" class="tabs current">Comments (3)</a></li>
<li><a href="#trackbacks" class="tabs">Trackbacks</a></li>
</ul>
<div id="trackbacks">
<ol class="commentlist">
<li class="pingback even thread-even depth-1" id="comment-1250">
<div id="div-comment-1250" class="comment-body">
<div class="comment-author vcard">
<cite class="fn"><a href='http://johnbaumgartner.wordpress.com/2012/07/26/getting-rasters-into-shape-from-r/' rel='external nofollow ugc' class='url'>Getting rasters into shape from R | John Baumgartner&#39;s blog</a></cite> <span class="says">says:</span> </div>
<div class="comment-meta commentmetadata"><a href="https://www.naturalearthdata.com/downloads/110m-cultural-vectors/110m-admin-0-countries/#comment-1250">
July 26, 2012 at 11:32 pm </a>
</div>
<p>[&#8230;] earlier. It&#8217;s the result of a conversion of a polygon shapefile of country boundaries (from Natural Earth, a fantastic, public domain, physical/cultural spatial data source) to a raster data [&#8230;]</p>
</div>
</li><!-- #comment-## -->
<li class="pingback odd alt thread-odd thread-alt depth-1" id="comment-1597">
<div id="div-comment-1597" class="comment-body">
<div class="comment-author vcard">
<cite class="fn"><a href='http://simpoli.wordpress.com/2013/02/28/jquery-e-mappe-jvectormap/' rel='external nofollow ugc' class='url'>jQUERY e Mappe: jVectorMap | SimPoli</a></cite> <span class="says">says:</span> </div>
<div class="comment-meta commentmetadata"><a href="https://www.naturalearthdata.com/downloads/110m-cultural-vectors/110m-admin-0-countries/#comment-1597">
February 28, 2013 at 5:42 am </a>
</div>
<p>[&#8230;] Le mappe sono scaricate da <a href="https://www.naturalearthdata.com" rel="nofollow ugc">https://www.naturalearthdata.com</a> [&#8230;]</p>
</div>
</li><!-- #comment-## -->
<li class="pingback even thread-even depth-1" id="comment-1598">
<div id="div-comment-1598" class="comment-body">
<div class="comment-author vcard">
<cite class="fn"><a href='http://www.simpoli.it/?p=11' rel='external nofollow ugc' class='url'>SimPoli &raquo; jQUERY e Mappe: jVectorMap</a></cite> <span class="says">says:</span> </div>
<div class="comment-meta commentmetadata"><a href="https://www.naturalearthdata.com/downloads/110m-cultural-vectors/110m-admin-0-countries/#comment-1598">
March 13, 2013 at 2:52 am </a>
</div>
<p>[&#8230;] Le mappe sono scaricate da <a href="https://www.naturalearthdata.com" rel="nofollow ugc">https://www.naturalearthdata.com</a> [&#8230;]</p>
</div>
</li><!-- #comment-## -->
</ol>
</div>
</div>
<div class="navigation">
<div class="alignleft"></div>
<div class="alignright"></div>
</div>
</div>
<div id="sidebar">
<ul>
<li id="rssfeeds">Subscribe: <a href="https://www.naturalearthdata.com/feed/">Entries</a> | <a href="https://www.naturalearthdata.com/comments/feed/">Comments</a></li>
<li id="search-3" class="widget widget_search"><h2 class="widgettitle">Search</h2>
<form method="get" id="searchform" action="https://www.naturalearthdata.com/">
<label class="hidden" for="s">Search for:</label>
<div><input type="text" value="" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>
</li>
<li id="linkcat-2" class="widget widget_links"><h2 class="widgettitle">Links</h2>
<ul class='xoxo blogroll'>
<li><a href="http://www.nacis.org">NACIS</a></li>
</ul>
</li>
<li id="tag_cloud-3" class="widget widget_tag_cloud"><h2 class="widgettitle">Tags</h2>
<div class="tagcloud"><a href="https://www.naturalearthdata.com/tag/10m/" class="tag-cloud-link tag-link-65 tag-link-position-1" style="font-size: 16.4pt;" aria-label="10m (2 items)">10m</a>
<a href="https://www.naturalearthdata.com/tag/50m/" class="tag-cloud-link tag-link-64 tag-link-position-2" style="font-size: 8pt;" aria-label="50m (1 item)">50m</a>
<a href="https://www.naturalearthdata.com/tag/90/" class="tag-cloud-link tag-link-61 tag-link-position-3" style="font-size: 8pt;" aria-label="90 (1 item)">90</a>
<a href="https://www.naturalearthdata.com/tag/180/" class="tag-cloud-link tag-link-60 tag-link-position-4" style="font-size: 8pt;" aria-label="180 (1 item)">180</a>
<a href="https://www.naturalearthdata.com/tag/admin-0/" class="tag-cloud-link tag-link-40 tag-link-position-5" style="font-size: 8pt;" aria-label="admin-0 (1 item)">admin-0</a>
<a href="https://www.naturalearthdata.com/tag/bjorn/" class="tag-cloud-link tag-link-46 tag-link-position-6" style="font-size: 8pt;" aria-label="bjorn (1 item)">bjorn</a>
<a href="https://www.naturalearthdata.com/tag/bounding-box/" class="tag-cloud-link tag-link-68 tag-link-position-7" style="font-size: 8pt;" aria-label="bounding box (1 item)">bounding box</a>
<a href="https://www.naturalearthdata.com/tag/browser/" class="tag-cloud-link tag-link-47 tag-link-position-8" style="font-size: 8pt;" aria-label="browser (1 item)">browser</a>
<a href="https://www.naturalearthdata.com/tag/change-log/" class="tag-cloud-link tag-link-74 tag-link-position-9" style="font-size: 8pt;" aria-label="change log (1 item)">change log</a>
<a href="https://www.naturalearthdata.com/tag/corrections/" class="tag-cloud-link tag-link-34 tag-link-position-10" style="font-size: 8pt;" aria-label="corrections (1 item)">corrections</a>
<a href="https://www.naturalearthdata.com/tag/countries/" class="tag-cloud-link tag-link-41 tag-link-position-11" style="font-size: 8pt;" aria-label="countries (1 item)">countries</a>
<a href="https://www.naturalearthdata.com/tag/downloads/" class="tag-cloud-link tag-link-432 tag-link-position-12" style="font-size: 8pt;" aria-label="Downloads (1 item)">Downloads</a>
<a href="https://www.naturalearthdata.com/tag/error/" class="tag-cloud-link tag-link-67 tag-link-position-13" style="font-size: 8pt;" aria-label="error (1 item)">error</a>
<a href="https://www.naturalearthdata.com/tag/extent/" class="tag-cloud-link tag-link-69 tag-link-position-14" style="font-size: 8pt;" aria-label="extent (1 item)">extent</a>
<a href="https://www.naturalearthdata.com/tag/ext-js/" class="tag-cloud-link tag-link-56 tag-link-position-15" style="font-size: 8pt;" aria-label="ext js (1 item)">ext js</a>
<a href="https://www.naturalearthdata.com/tag/forums/" class="tag-cloud-link tag-link-35 tag-link-position-16" style="font-size: 8pt;" aria-label="forums (1 item)">forums</a>
<a href="https://www.naturalearthdata.com/tag/geoext/" class="tag-cloud-link tag-link-57 tag-link-position-17" style="font-size: 8pt;" aria-label="geoext (1 item)">geoext</a>
<a href="https://www.naturalearthdata.com/tag/hans/" class="tag-cloud-link tag-link-63 tag-link-position-18" style="font-size: 8pt;" aria-label="hans (1 item)">hans</a>
<a href="https://www.naturalearthdata.com/tag/imagery/" class="tag-cloud-link tag-link-59 tag-link-position-19" style="font-size: 8pt;" aria-label="imagery (1 item)">imagery</a>
<a href="https://www.naturalearthdata.com/tag/import/" class="tag-cloud-link tag-link-66 tag-link-position-20" style="font-size: 8pt;" aria-label="import (1 item)">import</a>
<a href="https://www.naturalearthdata.com/tag/mapnik/" class="tag-cloud-link tag-link-53 tag-link-position-21" style="font-size: 8pt;" aria-label="mapnik (1 item)">mapnik</a>
<a href="https://www.naturalearthdata.com/tag/maptiler/" class="tag-cloud-link tag-link-51 tag-link-position-22" style="font-size: 8pt;" aria-label="maptiler (1 item)">maptiler</a>
<a href="https://www.naturalearthdata.com/tag/map-tiles/" class="tag-cloud-link tag-link-49 tag-link-position-23" style="font-size: 8pt;" aria-label="map tiles (1 item)">map tiles</a>
<a href="https://www.naturalearthdata.com/tag/marine-boundary/" class="tag-cloud-link tag-link-76 tag-link-position-24" style="font-size: 8pt;" aria-label="marine boundary (1 item)">marine boundary</a>
<a href="https://www.naturalearthdata.com/tag/national-parks/" class="tag-cloud-link tag-link-75 tag-link-position-25" style="font-size: 8pt;" aria-label="national parks (1 item)">national parks</a>
<a href="https://www.naturalearthdata.com/tag/new-data/" class="tag-cloud-link tag-link-36 tag-link-position-26" style="font-size: 8pt;" aria-label="new data (1 item)">new data</a>
<a href="https://www.naturalearthdata.com/tag/nsd/" class="tag-cloud-link tag-link-72 tag-link-position-27" style="font-size: 8pt;" aria-label="nsd (1 item)">nsd</a>
<a href="https://www.naturalearthdata.com/tag/openlayers/" class="tag-cloud-link tag-link-55 tag-link-position-28" style="font-size: 8pt;" aria-label="openlayers (1 item)">openlayers</a>
<a href="https://www.naturalearthdata.com/tag/physical-labels/" class="tag-cloud-link tag-link-38 tag-link-position-29" style="font-size: 8pt;" aria-label="physical labels (1 item)">physical labels</a>
<a href="https://www.naturalearthdata.com/tag/pngng/" class="tag-cloud-link tag-link-52 tag-link-position-30" style="font-size: 8pt;" aria-label="pngng (1 item)">pngng</a>
<a href="https://www.naturalearthdata.com/tag/populated-places/" class="tag-cloud-link tag-link-39 tag-link-position-31" style="font-size: 8pt;" aria-label="populated places (1 item)">populated places</a>
<a href="https://www.naturalearthdata.com/tag/raster/" class="tag-cloud-link tag-link-58 tag-link-position-32" style="font-size: 16.4pt;" aria-label="raster (2 items)">raster</a>
<a href="https://www.naturalearthdata.com/tag/terrestrial-hypsography/" class="tag-cloud-link tag-link-45 tag-link-position-33" style="font-size: 8pt;" aria-label="terrestrial hypsography (1 item)">terrestrial hypsography</a>
<a href="https://www.naturalearthdata.com/tag/tfw/" class="tag-cloud-link tag-link-62 tag-link-position-34" style="font-size: 8pt;" aria-label="tfw (1 item)">tfw</a>
<a href="https://www.naturalearthdata.com/tag/thematic-mapping/" class="tag-cloud-link tag-link-48 tag-link-position-35" style="font-size: 8pt;" aria-label="thematic mapping (1 item)">thematic mapping</a>
<a href="https://www.naturalearthdata.com/tag/themese/" class="tag-cloud-link tag-link-37 tag-link-position-36" style="font-size: 8pt;" aria-label="themese (1 item)">themese</a>
<a href="https://www.naturalearthdata.com/tag/tif/" class="tag-cloud-link tag-link-71 tag-link-position-37" style="font-size: 8pt;" aria-label="tif (1 item)">tif</a>
<a href="https://www.naturalearthdata.com/tag/tilecache/" class="tag-cloud-link tag-link-54 tag-link-position-38" style="font-size: 8pt;" aria-label="tilecache (1 item)">tilecache</a>
<a href="https://www.naturalearthdata.com/tag/tiles/" class="tag-cloud-link tag-link-50 tag-link-position-39" style="font-size: 8pt;" aria-label="tiles (1 item)">tiles</a>
<a href="https://www.naturalearthdata.com/tag/time-zones/" class="tag-cloud-link tag-link-44 tag-link-position-40" style="font-size: 8pt;" aria-label="time zones (1 item)">time zones</a>
<a href="https://www.naturalearthdata.com/tag/towns/" class="tag-cloud-link tag-link-42 tag-link-position-41" style="font-size: 8pt;" aria-label="towns (1 item)">towns</a>
<a href="https://www.naturalearthdata.com/tag/transportation/" class="tag-cloud-link tag-link-43 tag-link-position-42" style="font-size: 8pt;" aria-label="transportation (1 item)">transportation</a>
<a href="https://www.naturalearthdata.com/tag/update/" class="tag-cloud-link tag-link-33 tag-link-position-43" style="font-size: 22pt;" aria-label="update (3 items)">update</a>
<a href="https://www.naturalearthdata.com/tag/visitors/" class="tag-cloud-link tag-link-73 tag-link-position-44" style="font-size: 8pt;" aria-label="visitors (1 item)">visitors</a>
<a href="https://www.naturalearthdata.com/tag/world-file/" class="tag-cloud-link tag-link-70 tag-link-position-45" style="font-size: 8pt;" aria-label="world file (1 item)">world file</a></div>
</li>
<li id="recent-comments-3" class="widget widget_recent_comments"><h2 class="widgettitle">Recent Comments</h2>
<ul id="recentcomments"><li class="recentcomments"><span class="comment-author-link"><a href='http://www.bbscode.top/index.php/2022/03/17/aligning-natural-earth-geojson-and-raster-to-render-in-d3/' rel='external nofollow ugc' class='url'>Aligning Natural Earth Geojson and Raster to render in D3 &#8211; BBSCODE</a></span> on <a href="https://www.naturalearthdata.com/downloads/50m-raster-data/50m-shaded-relief/comment-page-1/#comment-6144">1:50m Shaded Relief</a></li><li class="recentcomments"><span class="comment-author-link"><a href='https://wp.csusm.edu/adahn/2022/03/14/qgis-a-mapping-tool/' rel='external nofollow ugc' class='url'>QGIS a Mapping Tool &#8211; April Dahn</a></span> on <a href="https://www.naturalearthdata.com/downloads/50m-raster-data/50m-shaded-relief/comment-page-1/#comment-6143">1:50m Shaded Relief</a></li><li class="recentcomments"><span class="comment-author-link"><a href='https://wp.csusm.edu/rsheehan/2022/03/13/more-mapping-with-qgis/' rel='external nofollow ugc' class='url'>More Mapping with QGIS &#8211; History 502</a></span> on <a href="https://www.naturalearthdata.com/downloads/50m-raster-data/50m-shaded-relief/comment-page-1/#comment-6142">1:50m Shaded Relief</a></li><li class="recentcomments"><span class="comment-author-link"><a href='http://ivermectin6mg.quest' rel='external nofollow ugc' class='url'>buy ivermectin 12 mg tablets</a></span> on <a href="https://www.naturalearthdata.com/forums/topic/download-urls-double-slash/comment-page-1/#comment-6141">Download URLs double slash</a></li><li class="recentcomments"><span class="comment-author-link"><a href='https://slacker.ro/2021/10/01/building-a-beautiful-and-clear-map-from-massive-complex-data/' rel='external nofollow ugc' class='url'>Building A Beautiful And Clear Map From Massive, Complex Data &#8211; Slacker News</a></span> on <a href="https://www.naturalearthdata.com/downloads/10m-raster-data/10m-shaded-relief/comment-page-1/#comment-6140">1:10m Shaded Relief</a></li></ul></li>
<li id="bbp_topics_widget-2" class="widget widget_display_topics"><h2 class="widgettitle">Recent Forum Topics</h2>
<ul class="bbp-topics-widget newness">
<li>
<a class="bbp-forum-title" href="https://www.naturalearthdata.com/forums/topic/natural-earth-in-wagner-vii/">Natural Earth in Wagner VII</a>
by <span class="topic-author"><a href="https://www.naturalearthdata.com/forums/users/frax/" title="View Hugo Ahlenius&#039;s profile" class="bbp-author-link"><span class="bbp-author-avatar"><img alt='' src='http://2.gravatar.com/avatar/2bd3b3347fd34f7dd734bf4b78fb353d?s=14&#038;d=retro&#038;r=g' srcset='http://2.gravatar.com/avatar/2bd3b3347fd34f7dd734bf4b78fb353d?s=28&#038;d=retro&#038;r=g 2x' class='avatar avatar-14 photo' height='14' width='14' loading='lazy'/></span><span class="bbp-author-name">Hugo Ahlenius</span></a></span>
</li>
<li>
<a class="bbp-forum-title" href="https://www.naturalearthdata.com/forums/topic/downloads-are-404ing/">Downloads are 404ing</a>
by <span class="topic-author"><a href="https://www.naturalearthdata.com/forums/users/nathaniel/" title="View Nathaniel&#039;s profile" class="bbp-author-link"><span class="bbp-author-avatar"><img alt='' src='http://2.gravatar.com/avatar/e679fead4b7cb50b7b60e7c4f99bc348?s=14&#038;d=retro&#038;r=g' srcset='http://2.gravatar.com/avatar/e679fead4b7cb50b7b60e7c4f99bc348?s=28&#038;d=retro&#038;r=g 2x' class='avatar avatar-14 photo' height='14' width='14' loading='lazy'/></span><span class="bbp-author-name">Nathaniel</span></a></span>
</li>
<li>
<a class="bbp-forum-title" href="https://www.naturalearthdata.com/forums/topic/disputed-territories-type-field/">Disputed Territories: &quot;type&quot; field</a>
by <span class="topic-author"><a href="https://www.naturalearthdata.com/forums/users/alykat/" title="View alykat&#039;s profile" class="bbp-author-link"><span class="bbp-author-avatar"><img alt='' src='http://2.gravatar.com/avatar/8c60e36c6b6542afb738eb950429d6ba?s=14&#038;d=retro&#038;r=g' srcset='http://2.gravatar.com/avatar/8c60e36c6b6542afb738eb950429d6ba?s=28&#038;d=retro&#038;r=g 2x' class='avatar avatar-14 photo' height='14' width='14' loading='lazy'/></span><span class="bbp-author-name">alykat</span></a></span>
</li>
<li>
<a class="bbp-forum-title" href="https://www.naturalearthdata.com/forums/topic/iso-code-confusion/">ISO code confusion</a>
by <span class="topic-author"><a href="https://www.naturalearthdata.com/forums/users/nth/" title="View nth&#039;s profile" class="bbp-author-link"><span class="bbp-author-avatar"><img alt='' src='http://0.gravatar.com/avatar/f5060dc4d25dbced2933380279e0c1c5?s=14&#038;d=retro&#038;r=g' srcset='http://0.gravatar.com/avatar/f5060dc4d25dbced2933380279e0c1c5?s=28&#038;d=retro&#038;r=g 2x' class='avatar avatar-14 photo' height='14' width='14' loading='lazy'/></span><span class="bbp-author-name">nth</span></a></span>
</li>
<li>
<a class="bbp-forum-title" href="https://www.naturalearthdata.com/forums/topic/bad-adm1name-encoding-in-version-3-0-0-and-missing-diacritics-in-name/">Bad ADM1NAME, encoding in version 3.0.0 and missing diacritics in NAME</a>
by <span class="topic-author"><a href="https://www.naturalearthdata.com/forums/users/pfunes/" title="View pfunes&#039;s profile" class="bbp-author-link"><span class="bbp-author-avatar"><img alt='' src='http://2.gravatar.com/avatar/eded29f5ea7062bfe350281260b0596b?s=14&#038;d=retro&#038;r=g' srcset='http://2.gravatar.com/avatar/eded29f5ea7062bfe350281260b0596b?s=28&#038;d=retro&#038;r=g 2x' class='avatar avatar-14 photo' height='14' width='14' loading='lazy'/></span><span class="bbp-author-name">pfunes</span></a></span>
</li>
<li>
<a class="bbp-forum-title" href="https://www.naturalearthdata.com/forums/topic/u-s-county-shape-file-2/">U.S. County Shape File</a>
by <span class="topic-author"><a href="https://www.naturalearthdata.com/forums/users/gzingsheim/" title="View gzingsheim&#039;s profile" class="bbp-author-link"><span class="bbp-author-avatar"><img alt='' src='http://1.gravatar.com/avatar/d617957f9d5d7d062deeadbfa011d8b6?s=14&#038;d=retro&#038;r=g' srcset='http://1.gravatar.com/avatar/d617957f9d5d7d062deeadbfa011d8b6?s=28&#038;d=retro&#038;r=g 2x' class='avatar avatar-14 photo' height='14' width='14' loading='lazy'/></span><span class="bbp-author-name">gzingsheim</span></a></span>
</li>
<li>
<a class="bbp-forum-title" href="https://www.naturalearthdata.com/forums/topic/projection-proportion-compatibility/">Projection / Proportion / Compatibility?</a>
by <span class="topic-author"><a href="https://www.naturalearthdata.com/forums/users/liquidized/" title="View Liquidized&#039;s profile" class="bbp-author-link"><span class="bbp-author-avatar"><img alt='' src='http://0.gravatar.com/avatar/06422086ab7aab2b767e3df7f7a67bdd?s=14&#038;d=retro&#038;r=g' srcset='http://0.gravatar.com/avatar/06422086ab7aab2b767e3df7f7a67bdd?s=28&#038;d=retro&#038;r=g 2x' class='avatar avatar-14 photo' height='14' width='14' loading='lazy'/></span><span class="bbp-author-name">Liquidized</span></a></span>
</li>
<li>
<a class="bbp-forum-title" href="https://www.naturalearthdata.com/forums/topic/download-urls-double-slash/">Download URLs double slash</a>
by <span class="topic-author"><a href="https://www.naturalearthdata.com/forums/users/vastur/" title="View vastur&#039;s profile" class="bbp-author-link"><span class="bbp-author-avatar"><img alt='' src='http://2.gravatar.com/avatar/e07b4667376982e080d64cf0250acc9b?s=14&#038;d=retro&#038;r=g' srcset='http://2.gravatar.com/avatar/e07b4667376982e080d64cf0250acc9b?s=28&#038;d=retro&#038;r=g 2x' class='avatar avatar-14 photo' height='14' width='14' loading='lazy'/></span><span class="bbp-author-name">vastur</span></a></span>
</li>
<li>
<a class="bbp-forum-title" href="https://www.naturalearthdata.com/forums/topic/map-soft-writer-me/">map soft &#8211; writer: me</a>
by <span class="topic-author"><a href="https://www.naturalearthdata.com/forums/users/krzysztof/" title="View krzysztof&#039;s profile" class="bbp-author-link"><span class="bbp-author-avatar"><img alt='' src='http://2.gravatar.com/avatar/be9767706435aa6e10d50185f6def05e?s=14&#038;d=retro&#038;r=g' srcset='http://2.gravatar.com/avatar/be9767706435aa6e10d50185f6def05e?s=28&#038;d=retro&#038;r=g 2x' class='avatar avatar-14 photo' height='14' width='14' loading='lazy'/></span><span class="bbp-author-name">krzysztof</span></a></span>
</li>
<li>
<a class="bbp-forum-title" href="https://www.naturalearthdata.com/forums/topic/unicode-encoding-issue-ne_10m_lakes-dbf/">Unicode encoding issue &#8211; ne_10m_lakes.dbf</a>
by <span class="topic-author"><a href="https://www.naturalearthdata.com/forums/users/filter-1/" title="View filter.1&#039;s profile" class="bbp-author-link"><span class="bbp-author-avatar"><img alt='' src='http://1.gravatar.com/avatar/daae13b2efd52a3865320ada9ed3ae18?s=14&#038;d=retro&#038;r=g' srcset='http://1.gravatar.com/avatar/daae13b2efd52a3865320ada9ed3ae18?s=28&#038;d=retro&#038;r=g 2x' class='avatar avatar-14 photo' height='14' width='14' loading='lazy'/></span><span class="bbp-author-name">filter.1</span></a></span>
</li>
</ul>
</li>
</ul>
</div>
</div>
<hr />
<div id="footer">
<div id="footerarea">
<div id="footerlogos">
<p>Supported by:</p>
<div class="footer-ad-box">
<a href="http://www.nacis.org" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/nacis.png" alt="NACIS" /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.cartotalk.com" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/cartotalk_ad.png" alt="Cartotalk" /></a>
</div>
<div class="footer-ad-box">
<img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/mapgiving.png" alt="Mapgiving" />
</div>
<div class="footer-ad-box">
<a href="http://www.geography.wisc.edu/cartography/" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/wisconsin.png" alt="University of Wisconsin Madison - Cartography Dept." /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.shadedrelief.com" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/shaded_relief.png" alt="Shaded Relief" /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.xnrproductions.com " target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/xnr.png" alt="XNR Productions" /></a>
</div>
<p style="clear:both;"></p>
<div class="footer-ad-box">
<a href="http://www.freac.fsu.edu" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/fsu.png" alt="Florida State University - FREAC" /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.springercartographics.com" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/scllc.png" alt="Springer Cartographics LLC" /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.washingtonpost.com" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/wpost.png" alt="Washington Post" /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.redgeographics.com" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/redgeo.png" alt="Red Geographics" /></a>
</div>
<div class="footer-ad-box">
<a href="http://kelsocartography.com/blog " target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/kelso.png" alt="Kelso Cartography" /></a>
</div>
<p style="clear:both;"></p>
<div class="footer-ad-box">
<a href="http://www.avenza.com" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/avenza.png" alt="Avenza Systems Inc." /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.stamen.com" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/stamen_ne_logo.png" alt="Stamen Design" /></a>
</div>
</div>
<p style="clear:both;"></p>
<span id="footerleft">
&copy; 2009 - 2022. Natural Earth. All rights reserved.
</span>
<span id="footerright">
<!-- Please help promote WordPress and simpleX. Do not remove -->
<div>Powered by <a href="http://wordpress.org/">WordPress</a></div>
<div><a href="http://www.naturalearthdata.com/wp-admin">Staff Login &raquo;</a></div>
</span>
</div>
</div>
<script type='text/javascript' src='http://www.naturalearthdata.com/wp-includes/js/wp-embed.min.js?ver=5.5.9' id='wp-embed-js'></script>
</body>
</html>
<!-- Dynamic page generated in 0.239 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2022-05-09 00:28:31 -->
<!-- Compression = gzip -->
<!-- super cache -->

View File

@ -0,0 +1 @@
5.1.1

View File

@ -0,0 +1 @@
UTF-8

BIN
shp/ne_110m_admin_0_countries.dbf Executable file

Binary file not shown.

View File

@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]]

BIN
shp/ne_110m_admin_0_countries.shp Executable file

Binary file not shown.

BIN
shp/ne_110m_admin_0_countries.shx Executable file

Binary file not shown.

View File

@ -18,8 +18,6 @@ impl SimpleComponent for RenderPanelModel {
#[root] #[root]
Monitor::new( Monitor::new(
Render::new( Render::new(
BackgroundWidget::new(BackgroundConfig{ show_lat_lines: true, show_lon_lines: true, ..Default::default() }),
ForegroundWidget::new(ForegroundConfig::default()),
Some(Mercator::new().into()) Some(Mercator::new().into())
) )
), ),

View File

@ -54,39 +54,3 @@ fn main() {
let relm = relm4::RelmApp::new(APP_ID); let relm = relm4::RelmApp::new(APP_ID);
relm.run::<AppModel>(AppMode::Edit); relm.run::<AppModel>(AppMode::Edit);
} }
fn build_ui(app: &Application) {
// Create a window and set the title
let window = ApplicationWindow::builder()
.application(app)
.title("My GTK App")
.build();
let mut background_config = BackgroundConfig::new()
.change_painter(Paint::color(Color::white()))
.change_show_lat_lines(true)
.change_show_lon_lines(true);
let mut foreground_config = ForegroundConfig::new();
let background_widget = BackgroundWidget::new(background_config);
let foreground_widget = ForegroundWidget::new(foreground_config);
let render = Render::new(background_widget, foreground_widget,None);
let path = "/Users/ruomu/projects/cinrad_g/test2.npz";
let data = Radar2d::<i8>::load(path, Npz).unwrap();
let projection = Mercator::new();
let mut mapper: Mapper = projection.into();
mapper.set_lat_range(29.960..30.764);
mapper.set_lon_range(120.038..120.965);
render.set_mapper(mapper);
let monitor = Monitor::new(render);
monitor.load_data_2d(data).unwrap();
window.set_child(Some(&monitor));
window.set_default_width(1000);
window.set_default_height(800);
window.present();
}

View File

@ -21,11 +21,10 @@ impl Monitor {
let this: Self = glib::Object::new(); let this: Self = glib::Object::new();
let pointer_location_detecture = gtk::EventControllerMotion::new(); let pointer_location_detecture = gtk::EventControllerMotion::new();
pointer_location_detecture.connect_motion( pointer_location_detecture.connect_motion(
clone!(@weak this as s => move |_context, x, y| { clone!(@weak this as s, @weak render as r => move |_context, x, y| {
s.imp().renderer.borrow_mut().change_pointer(x as f32, y as f32); r.update_status(|s| {
let c = s.imp().renderer.borrow(); s.pointer_location = (x as f32, y as f32);
let cc = c.imp().config.borrow(); });
println!("pointer location: {},{}", cc.pointer_lon_lat.0, cc.pointer_lon_lat.1);
} }
), ),
); );
@ -33,21 +32,13 @@ impl Monitor {
scale_detecture.connect_scroll(clone!( scale_detecture.connect_scroll(clone!(
@weak this as s, @weak render as r => @default-panic,move |_context, _x, y| { @weak this as s, @weak render as r => @default-panic,move |_context, _x, y| {
let renderer = s.imp().renderer.borrow(); let renderer = s.imp().renderer.borrow();
let p = r.imp().config.borrow().pointer_lon_lat;
let (px,py) = r.imp().mapper.borrow().map(p).unwrap();
let mut scale = 1.0; let mut scale = 1.0;
r.update_status(|status|{
renderer.change_cfg(|cfg| { let current_scale = status.scale;
let current_scale = cfg.scale; let s = (current_scale - y as f32 / 5.0).max(1.0).min(5.0);
let s = (current_scale - y as f32 / 10.0).max(1.0).min(5.0); status.scale = s;
cfg.scale = s;
scale = s; scale = s;
}); });
r.set_translate((
px as f32 * (scale - 1.0),
(1.0-py) as f32 * (scale - 1.0)
));
r.queue_render(); r.queue_render();
Inhibit(false) Inhibit(false)
} }
@ -57,15 +48,15 @@ impl Monitor {
drag_detecture.connect_drag_update(clone!( drag_detecture.connect_drag_update(clone!(
@weak render as r => move |this, _, _| { @weak render as r => move |this, _, _| {
let (ox, oy) = this.offset().unwrap_or((0.0,0.0)); let (ox, oy) = this.offset().unwrap_or((0.0,0.0));
r.change_cfg(|cfg|{ r.update_status(|s| {
cfg.updated_translate = ( - ox as f32, -oy as f32); s.updated_translate = ( - ox as f32, -oy as f32);
} ); });
r.queue_render(); r.queue_render();
})); }));
drag_detecture.connect_drag_end(clone!( drag_detecture.connect_drag_end(clone!(
@weak render as r => move |this,_,_|{ @weak render as r => move |this,_,_|{
let t = r.imp().translate(); let t = r.imp().translate();
r.change_cfg(|cfg| { r.update_status(|cfg| {
cfg.translate = t ; cfg.translate = t ;
cfg.updated_translate = (0.0,0.0); cfg.updated_translate = (0.0,0.0);
}) })

View File

@ -23,7 +23,7 @@ impl BackgroundWidget {
let this: Self = glib::Object::new(); let this: Self = glib::Object::new();
let imp = this.imp(); let imp = this.imp();
let polygons = shapefile::read_as::<_, shapefile::Polygon, shapefile::dbase::Record>( let polygons = shapefile::read_as::<_, shapefile::Polygon, shapefile::dbase::Record>(
"/Users/tsuki/Downloads/ne_110m_admin_0_countries/ne_110m_admin_0_countries.shp", "shp/ne_110m_admin_0_countries.shp",
) )
.unwrap(); .unwrap();
@ -153,30 +153,15 @@ impl BackgroundWidget {
canvas: &mut Canvas<OpenGl>, canvas: &mut Canvas<OpenGl>,
scale: f32, scale: f32,
dpi: i32, dpi: i32,
width: f32,
hdight: f32,
translate: (f32, f32), translate: (f32, f32),
mapper: Ref<'_, Mapper>, mapper: Ref<'_, Mapper>,
bound: (Range, Range), bound: (Range, Range),
) { ) {
let canvas_width = canvas.width();
let canvas_height = canvas.height();
let config = self.imp().config.borrow(); let config = self.imp().config.borrow();
self.mesh_lines( self.mesh_lines(canvas, scale, translate, width, hdight, &mapper, bound);
canvas, self.shp(mapper, canvas, translate, scale, width, hdight);
scale,
translate,
canvas_width,
canvas_height,
&mapper,
bound,
);
self.shp(
mapper,
canvas,
translate,
scale,
canvas_width,
canvas_height,
);
} }
fn shp( fn shp(

View File

@ -5,6 +5,8 @@ use geo_types::{line_string, LineString, Point};
use glib::subclass::types::ObjectSubclassIsExt; use glib::subclass::types::ObjectSubclassIsExt;
use std::cell::Ref; use std::cell::Ref;
use super::imp::{RenderStatus, RenderConfig};
glib::wrapper! { glib::wrapper! {
pub struct ExteriorWidget(ObjectSubclass<imp::ExteriorWidget>); pub struct ExteriorWidget(ObjectSubclass<imp::ExteriorWidget>);
} }
@ -21,7 +23,7 @@ impl ExteriorWidget {
this this
} }
pub(super) fn draw(&self, canvas: &mut Canvas<OpenGl>, mapper: Ref<'_, Mapper>) { pub(super) fn draw(&self, canvas: &mut Canvas<OpenGl>, mapper: Ref<'_, Mapper>, status:Ref<'_, RenderStatus>, _c:Ref<'_, RenderConfig>) {
let imp = self.imp(); let imp = self.imp();
let canvas_width = canvas.width(); let canvas_width = canvas.width();
let canvas_height = canvas.height(); let canvas_height = canvas.height();

View File

@ -1,5 +1,6 @@
use super::background::BackgroundWidget; use super::background::BackgroundWidget;
use super::exterior::ExteriorWidget; use super::exterior::ExteriorWidget;
use super::interior::InteriorWidget;
use super::foreground::ForegroundWidget; use super::foreground::ForegroundWidget;
use super::WindowCoord; use super::WindowCoord;
use crate::coords::proj::Mercator; use crate::coords::proj::Mercator;
@ -17,9 +18,14 @@ use std::num::NonZeroU32;
pub struct RenderConfig { pub struct RenderConfig {
pub dim1: Option<Array2<f64>>, pub dim1: Option<Array2<f64>>,
pub dim2: Option<Array2<f64>>, pub dim2: Option<Array2<f64>>,
pub padding: [f32; 4],
// pub pointer_lon_lat: (f64, f64),
}
#[derive(Debug, Default, Clone)]
pub struct RenderStatus{
pub scale: f32, pub scale: f32,
pub pointer_location: WindowCoord, pub pointer_location: WindowCoord,
pub pointer_lon_lat: (f64, f64),
pub translate: WindowCoord, pub translate: WindowCoord,
pub updated_translate: WindowCoord, pub updated_translate: WindowCoord,
} }
@ -31,10 +37,10 @@ struct Fonts {
} }
pub struct Render { pub struct Render {
pub(super) background: RefCell<BackgroundWidget>,
pub(super) foreground: RefCell<ForegroundWidget>,
pub(super) exterior: RefCell<ExteriorWidget>, pub(super) exterior: RefCell<ExteriorWidget>,
pub(super) interior: RefCell<InteriorWidget>,
pub config: RefCell<RenderConfig>, pub config: RefCell<RenderConfig>,
pub status: RefCell<RenderStatus>,
pub mapper: RefCell<Mapper>, pub mapper: RefCell<Mapper>,
pub(super) canvas: RefCell<Option<femtovg::Canvas<femtovg::renderer::OpenGl>>>, pub(super) canvas: RefCell<Option<femtovg::Canvas<femtovg::renderer::OpenGl>>>,
} }
@ -42,10 +48,10 @@ pub struct Render {
impl Default for Render { impl Default for Render {
fn default() -> Self { fn default() -> Self {
Self { Self {
background: RefCell::new(BackgroundWidget::default()),
foreground: RefCell::new(ForegroundWidget::default()),
exterior: RefCell::new(ExteriorWidget::default()), exterior: RefCell::new(ExteriorWidget::default()),
interior: RefCell::new(InteriorWidget::default()),
config: RefCell::new(RenderConfig::default()), config: RefCell::new(RenderConfig::default()),
status: RefCell::new(RenderStatus::default()),
mapper: RefCell::new(Mercator::new().into()), mapper: RefCell::new(Mercator::new().into()),
canvas: RefCell::new(None), canvas: RefCell::new(None),
} }
@ -65,7 +71,6 @@ impl ObjectImpl for Render {
self.parent_constructed(); self.parent_constructed();
let area = self.obj(); let area = self.obj();
area.set_has_stencil_buffer(true); area.set_has_stencil_buffer(true);
// area.add_tick_callback(|area, _| { // area.add_tick_callback(|area, _| {
// area.queue_render(); // area.queue_render();
// glib::Continue(true) // glib::Continue(true)
@ -105,9 +110,12 @@ impl GLAreaImpl for Render {
(h as i32 * dpi) as u32, (h as i32 * dpi) as u32,
Color::rgba(0, 0, 0, 255), Color::rgba(0, 0, 0, 255),
); );
let mapper = self.mapper.borrow(); let mapper = self.mapper.borrow();
let (lon_range, lat_range) = mapper.range.clone(); self.interior.borrow().draw(canvas, mapper, self.status.borrow(), configs);
// let (lon_range, lat_range) = mapper.range.clone();
// { // {
// let background_widget = self.background.borrow_mut(); // let background_widget = self.background.borrow_mut();
// background_widget.set_lat_lines(lat_range.key_points(9)); // background_widget.set_lat_lines(lat_range.key_points(9));
@ -116,9 +124,9 @@ impl GLAreaImpl for Render {
// let background_widget = self.background.borrow_mut(); // let background_widget = self.background.borrow_mut();
// background_widget.set_lon_lines(lon_range.key_points(20)); // background_widget.set_lon_lines(lon_range.key_points(20));
// } // }
let translate = self.translate(); // let translate = self.translate();
self.exterior.borrow().draw(canvas,self.mapper.borrow()); // self.exterior.borrow().draw(canvas,self.mapper.borrow());
// self.foreground // self.foreground
// .borrow() // .borrow()
// .draw(canvas, configs.scale, dpi, self.mapper.borrow()); // .draw(canvas, configs.scale, dpi, self.mapper.borrow());
@ -171,7 +179,7 @@ impl Render {
} }
pub fn translate(&self) -> WindowCoord { pub fn translate(&self) -> WindowCoord {
let cfg = self.config.borrow(); let cfg = self.status.borrow();
let (rx, ry) = cfg.translate; let (rx, ry) = cfg.translate;
let (ux, uy) = cfg.updated_translate; let (ux, uy) = cfg.updated_translate;

View File

@ -0,0 +1,20 @@
use gtk::glib;
use gtk::subclass::prelude::*;
use std::cell::RefCell;
use crate::render::background::BackgroundWidget;
use crate::render::foreground::ForegroundWidget;
#[derive(Default)]
pub struct InteriorWidget {
pub(super) background: RefCell<BackgroundWidget>,
pub(super) foreground: RefCell<ForegroundWidget>,
}
#[glib::object_subclass]
impl ObjectSubclass for InteriorWidget {
const NAME: &'static str = "InteriorWidget";
type Type = super::InteriorWidget;
}
impl ObjectImpl for InteriorWidget{}

View File

@ -0,0 +1,58 @@
mod imp;
use crate::coords::{Mapper, Range};
use femtovg::{renderer::OpenGl, Canvas, Color, Paint, Path};
use geo_types::{line_string, LineString, Point};
use glib::subclass::types::ObjectSubclassIsExt;
use std::cell::Ref;
use super::imp::{RenderConfig, RenderStatus};
glib::wrapper! {
pub struct InteriorWidget(ObjectSubclass<imp::InteriorWidget>);
}
impl Default for InteriorWidget {
fn default() -> Self {
Self::new()
}
}
impl InteriorWidget {
pub fn new() -> Self {
let this: Self = glib::Object::new();
this
}
pub(super) fn draw(
&self,
canvas: &mut Canvas<OpenGl>,
mapper: Ref<'_, Mapper>,
status: Ref<'_, RenderStatus>,
_c: Ref<'_, RenderConfig>,
) {
let imp = self.imp();
let canvas_width = canvas.width();
let canvas_height = canvas.height();
let padding = _c.padding;
let w = canvas_width - padding[1] - padding[3];
let h = canvas_height - padding[0] - padding[2];
let scale = status.scale;
let dpi = 2;
let (tx, ty) = status.translate;
let range = mapper.range.clone();
self.imp().background.borrow().draw(
canvas,
scale,
dpi,
w,
h,
(tx + padding[3], ty + padding[0]),
mapper,
range,
);
}
}

View File

@ -1,23 +1,21 @@
mod background; mod background;
mod foreground;
mod exterior; mod exterior;
mod foreground;
mod imp; mod imp;
mod interior;
use crate::coords::Mapper; use crate::coords::Mapper;
use crate::data::{MultiDimensionData, RadarData2d}; use crate::data::RadarData2d;
use crate::pipeline::ProjPipe; use crate::pipeline::ProjPipe;
use crate::pipeline::{Pipeline, ShadePipe}; use crate::pipeline::{Pipeline, ShadePipe};
use std::fmt::Debug; use std::fmt::Debug;
pub use self::background::{BackgroundConfig, BackgroundWidget}; pub use self::background::{BackgroundConfig, BackgroundWidget};
use self::exterior::ExteriorWidget;
pub use self::foreground::{ForegroundConfig, ForegroundWidget}; pub use self::foreground::{ForegroundConfig, ForegroundWidget};
use self::imp::RenderConfig; use self::imp::{RenderConfig, RenderStatus};
use crate::data::DownSampleMeth;
use adw::prelude::WidgetExt; use adw::prelude::WidgetExt;
use femtovg::Color; use femtovg::Color;
pub use glib::subclass::prelude::*; pub use glib::subclass::prelude::*;
use image::RgbImage; use ndarray::{self, Array2};
use ndarray::{self, s, Array2, Axis, Dimension, Ix2, Zip};
use num_traits::{AsPrimitive, FromPrimitive, Num}; use num_traits::{AsPrimitive, FromPrimitive, Num};
use proj::ProjError; use proj::ProjError;
@ -30,26 +28,17 @@ glib::wrapper! {
impl Default for Render { impl Default for Render {
fn default() -> Self { fn default() -> Self {
Self::new( Self::new(None)
BackgroundWidget::default(),
ForegroundWidget::default(),
None,
)
} }
} }
impl Render { impl Render {
pub fn new( pub fn new(mapper: Option<Mapper>) -> Self {
background: BackgroundWidget,
foreground: ForegroundWidget,
mapper: Option<Mapper>,
) -> Self {
let this: Self = glib::Object::new(); let this: Self = glib::Object::new();
this.imp().background.replace(background);
this.imp().foreground.replace(foreground);
{ {
let mut configs = this.imp().config.borrow_mut(); let mut configs = this.imp().config.borrow_mut();
configs.scale = 1.0; let mut status = this.imp().status.borrow_mut();
status.scale = 1.0;
} }
if let Some(mapper) = mapper { if let Some(mapper) = mapper {
this.set_mapper(mapper); this.set_mapper(mapper);
@ -65,33 +54,41 @@ impl Render {
f(&mut cfg); f(&mut cfg);
} }
pub fn change_pointer(&mut self, x: f32, y: f32) { pub fn update_status<F>(&self, mut f: F)
if let Some(canvas) = self.imp().canvas.borrow().as_ref() { where
let dpi = self.scale_factor(); F: FnMut(&mut RenderStatus),
let cw = canvas.width(); {
let ch = canvas.height(); let mut status = self.imp().status.borrow_mut();
let (tx, ty) = self.imp().translate(); f(&mut status);
let scale = self.imp().config.borrow().scale;
let (lon, lat) = self
.imp()
.mapper
.borrow()
.fore_map((
(x * dpi as f32 + tx) / cw / scale,
(1.0 - (y * dpi as f32 + ty) / ch / scale),
))
.unwrap();
let mut cfg = self.imp().config.borrow_mut();
cfg.pointer_lon_lat = (lon, lat);
cfg.pointer_location = (x, y);
}
} }
pub fn set_translate(&self, trans: (f32, f32)) { // pub fn change_pointer(&mut self, x: f32, y: f32) {
if let Some(c) = self.imp().canvas.borrow().as_ref() { // if let Some(canvas) = self.imp().canvas.borrow().as_ref() {
self.imp().config.borrow_mut().translate = (c.width() * trans.0, c.height() * trans.1); // let dpi = self.scale_factor();
} // let cw = canvas.width();
} // let ch = canvas.height();
// let (tx, ty) = self.imp().translate();
// let scale = self.imp().config.borrow().scale;
// let (lon, lat) = self
// .imp()
// .mapper
// .borrow()
// .fore_map((
// (x * dpi as f32 + tx) / cw / scale,
// (y * dpi as f32 + ty) / ch / scale,
// ))
// .unwrap();
// let mut cfg = self.imp().config.borrow_mut();
// cfg.pointer_lon_lat = (lon, lat);
// cfg.pointer_location = (x, y);
// }
// }
// pub fn set_translate(&self, trans: (f32, f32)) {
// if let Some(c) = self.imp().canvas.borrow().as_ref() {
// self.imp().config.borrow_mut().translate = (c.width() * trans.0, c.height() * trans.1);
// }
// }
pub fn set_mapper(&self, mapper: Mapper) { pub fn set_mapper(&self, mapper: Mapper) {
self.imp().mapper.replace(mapper); self.imp().mapper.replace(mapper);
@ -140,11 +137,8 @@ impl Render {
let pjp = ProjPipe::new(&mapper); let pjp = ProjPipe::new(&mapper);
let rrp = ShadePipe::new(levels, colors.into_iter().map(|v| v.into()).collect()); let rrp = ShadePipe::new(levels, colors.into_iter().map(|v| v.into()).collect());
let rainbow = pjp.run(&data).unwrap(); let rainbow = pjp.run(&data).unwrap();
self.imp().foreground.borrow_mut().set_data(rainbow);
let pbow: Array2<Option<Color>> = rrp.run(&data).unwrap(); let pbow: Array2<Option<Color>> = rrp.run(&data).unwrap();
self.imp().foreground.borrow_mut().set_colors(pbow);
Ok(()) Ok(())
} }
} }