{"id":511,"date":"2018-06-29T20:12:38","date_gmt":"2018-06-30T00:12:38","guid":{"rendered":"http:\/\/brian.digitalmaddox.com\/blog\/?p=511"},"modified":"2018-06-29T20:12:38","modified_gmt":"2018-06-30T00:12:38","slug":"added-a-gnis-fixer-to-my-misc_gis_scripts-repository","status":"publish","type":"post","link":"https:\/\/brian.digitalmaddox.com\/blog\/?p=511","title":{"rendered":"Added a GNIS &#8220;Fixer&#8221; to my misc_gis_scripts repository"},"content":{"rendered":"<p>As I&#8217;ve posted before, the download from the <a href=\"https:\/\/geonames.usgs.gov\/domestic\/download_data.htm\">USGS Geonames<\/a> site has some problems.\u00a0 The feature_id column should be unique, but it is not because the file contains some of the same feature names in Mexico and Canada with the same id which breaks the unique constraint.<\/p>\n<p>I just added a very quick and dirty python program to my <a href=\"https:\/\/github.com\/briangmaddox\/misc_gis_scripts\">misc_gis_scripts<\/a> repo on Github.\u00a0 It&#8217;s run by<\/p>\n<pre>python3 gnisfixer.py downloadedgnisfile newgnisfile<\/pre>\n<p>For the latest download, it removed over 7,000 non-US or US Territory entries and into the DB perfectly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I&#8217;ve posted before, the download from the USGS Geonames site has some problems.\u00a0 The feature_id column should be unique, but it is not because the file contains some of the same feature names in Mexico and Canada with the &hellip; <a href=\"https:\/\/brian.digitalmaddox.com\/blog\/?p=511\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-511","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=511"}],"version-history":[{"count":1,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/511\/revisions"}],"predecessor-version":[{"id":512,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/511\/revisions\/512"}],"wp:attachment":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}