<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is there a way to get County using latitude and longitude? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145240#M28978</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One caution with Arthur's approach.&amp;nbsp; At least in NC, ZIP codes and City boundaries cross county lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reeza's approach will have more precision.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doc Muhlbaier&lt;/P&gt;&lt;P&gt;Duke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jan 2014 15:08:10 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2014-01-23T15:08:10Z</dc:date>
    <item>
      <title>Is there a way to get County using latitude and longitude?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145233#M28971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have files which contain data for addresses that have been geocoded.&amp;nbsp; They contain latitude and longitude.&amp;nbsp; Is there a way (a function or procedure) within SAS that will return the U.S. county from these coordinates?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 16:49:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145233#M28971</guid>
      <dc:creator>KathyWiz</dc:creator>
      <dc:date>2014-01-17T16:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get County using latitude and longitude?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145234#M28972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you taken a look at the SASHELP.ZIPCODE dataset?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 18:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145234#M28972</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2014-01-17T18:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get County using latitude and longitude?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145235#M28973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can get the lat and long projected (Proc Gproject) to match the USCounty map dataset provided by SAS then Proc Ginside should work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 19:33:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145235#M28973</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-01-17T19:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get County using latitude and longitude?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145236#M28974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ballard's suggestion may be preferable, but to elaborate further on my comment . . . .one could use GEODIST function to determine the closest location in the ZIPCODE dataset. This would be somewhat hit-and-miss, since the closest location may, in fact, be in a different county. Ideally, Ballard's approach makes better sense since your lat and long can only fall into unique counties (unless it happens to be exactly on a county boundary).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 19:56:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145236#M28974</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2014-01-17T19:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get County using latitude and longitude?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145237#M28975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just FWIW, if you enter a coordinate pair as a search string at &lt;A href="http://www.mapquest.com" target="_blank"&gt;www.mapquest.com&lt;/A&gt;, part of the output will contain the zipcode, city and state and, given that info, you can get the county name from sashelp.zipcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following paper provides example code for automating such a lookup process:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings12/091-2012.pdf" title="http://support.sas.com/resources/papers/proceedings12/091-2012.pdf"&gt;http://support.sas.com/resources/papers/proceedings12/091-2012.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use it, you would have to get an API key from Mapquest, but that is free and easily done from their web site.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 20:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145237#M28975</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-01-17T20:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get County using latitude and longitude?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145238#M28976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's a proc for that!&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#a003166866.htm" title="http://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#a003166866.htm"&gt;SAS/GRAPH(R) 9.2: Reference, Second Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ballardw suggest is probably the easiest and the example in the documentation is for example that problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the projections don't match you can also find the proper version for&amp;nbsp; US county data online in many places and bring that into SAS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 20:10:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145238#M28976</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-01-17T20:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get County using latitude and longitude?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145239#M28977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the link and suggestions. I haven't worked with geographic data before, so it is very helpful to be pointed in the right direction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This questions was actually something I was asked by another programmer, so I'll forward the comments to her so she can try this out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 15:14:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145239#M28977</guid>
      <dc:creator>KathyWiz</dc:creator>
      <dc:date>2014-01-22T15:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get County using latitude and longitude?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145240#M28978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One caution with Arthur's approach.&amp;nbsp; At least in NC, ZIP codes and City boundaries cross county lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reeza's approach will have more precision.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doc Muhlbaier&lt;/P&gt;&lt;P&gt;Duke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 15:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145240#M28978</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2014-01-23T15:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get County using latitude and longitude?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145241#M28979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Doc: Before &lt;A __default_attr="255172" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; mentioned it, I wasn't even aware of proc ginside and it is definitely the easiest to implement. However, since both methods start with coordinates thus should be attempting to match with polygons, I wouldn't jump to the conclusion that one would necessarily be more accurate than the other.&amp;nbsp; Can you provide a couple of examples that we could compare?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 15:54:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145241#M28979</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-01-23T15:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get County using latitude and longitude?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145242#M28980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its not my suggestion, its &lt;A __default_attr="260198" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;But I will test it with Canadian data...out of curiousity. I have ArcGIS that can be the source of "truth" &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 15:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145242#M28980</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-01-23T15:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to get County using latitude and longitude?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145243#M28981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You seem to forget the OP has long and lat for each address.&amp;nbsp; No need to involve ZIP code that I can see.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 16:06:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-get-County-using-latitude-and-longitude/m-p/145243#M28981</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-01-23T16:06:10Z</dc:date>
    </item>
  </channel>
</rss>

