<?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: Proc gmap for longitude latitude data of a city in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/445414#M111608</link>
    <description>&lt;P&gt;Have you tried and looked at the examples?&lt;/P&gt;</description>
    <pubDate>Wed, 14 Mar 2018 08:32:26 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2018-03-14T08:32:26Z</dc:date>
    <item>
      <title>Proc gmap for longitude latitude data of a city</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/445382#M111596</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Base SAS to analyze a crime dataset related to one of the cities of US. I have a dataset that has x-coordinate, y-coordinate, longitude, and latitude data related to the city.&amp;nbsp;Can I use Proc gmap or any other function to map these crime locations for this city?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am stuck and I could not proceed ahead with it. Again, I am aware of SAS visual&amp;nbsp;analytics but that is not what I want to use. I want this to be done through Base SAS. Please provide some help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 04:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/445382#M111596</guid>
      <dc:creator>aaaaaaaa21</dc:creator>
      <dc:date>2018-03-14T04:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc gmap for longitude latitude data of a city</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/445396#M111600</link>
      <description>&lt;P&gt;You need SAS/Graph, which comes with mapping data sets.&lt;/P&gt;
&lt;P&gt;When you have this, see &lt;A href="http://support.sas.com/documentation/cdl/en/graphref/65389/HTML/default/viewer.htm#p0bk91yvdq77lbn1ihcsq30tewn5.htm" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 07:37:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/445396#M111600</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-14T07:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc gmap for longitude latitude data of a city</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/445403#M111604</link>
      <description>Thank you for the information. I have the SAS/Graph. But I am still not sure which statement to use to run my longitude and latitude (or my x and y-coordinates). If you do not mind, can you give me an example of a statement where I can use longitude and latitude (or my x and y-coordinates)?</description>
      <pubDate>Wed, 14 Mar 2018 07:53:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/445403#M111604</guid>
      <dc:creator>aaaaaaaa21</dc:creator>
      <dc:date>2018-03-14T07:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc gmap for longitude latitude data of a city</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/445414#M111608</link>
      <description>&lt;P&gt;Have you tried and looked at the examples?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 08:32:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/445414#M111608</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-14T08:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc gmap for longitude latitude data of a city</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/445416#M111610</link>
      <description>I did. I went through the third edition (the link you provided). I actually had already went through it a few days back too. I searched through the search box - I came across several examples that usese longitutde and latitude. But all of them either have Zipcode along with it or are used to trim a given map. In my case, I have the dataset related to San Fransisco, for each date (01/01/2018) and for those dates, I have crime types, where the crime happened (interms of longitude and latitude; x and y-coordinates). This data is in excel file. Now, I know how to draw a .shp file or use a zipcode for mapping. I know how to use SAS VA too. However, I did not find an example of how to create a map/graph based on those limited information. Any suggestions will be appreciated.</description>
      <pubDate>Wed, 14 Mar 2018 08:39:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/445416#M111610</guid>
      <dc:creator>aaaaaaaa21</dc:creator>
      <dc:date>2018-03-14T08:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc gmap for longitude latitude data of a city</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/445430#M111617</link>
      <description>I'm not even at work to help you, but a Google search brings heaps of examples like this one. &lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/42077817/map-latitude-and-longitude-to-state-in-sas" target="_blank"&gt;https://stackoverflow.com/questions/42077817/map-latitude-and-longitude-to-state-in-sas&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Mar 2018 10:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/445430#M111617</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-14T10:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc gmap for longitude latitude data of a city</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/457791#M116120</link>
      <description>&lt;P&gt;I am assuming that you have imported the shapefile for the city (using Proc Mapimport), and have projected the lat/long values to get projected y/x values (using Proc Gproject).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you do the above, you can use Proc Gproject's parmout= option, and save the projection parameters, to use in the next step...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now you can take your crime lat/long dataset, and project it using Proc Gproject, and use the same projection parameters as you used for the city map (by using Gproject's parmin= option). And then use those projected x/y coordinates, and use them to annotate markers on the map. You could either use the annotate function='label' and annotate symbols from a font, or use the annotate function='pie' to annotate colored bubbles.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example that uses the parmout and parmin, that might help get you started...&lt;/P&gt;
&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd95/scottish_festivals_nc_info.htm" target="_blank"&gt;http://robslink.com/SAS/democd95/scottish_festivals_nc_info.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 15:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/457791#M116120</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2018-04-26T15:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc gmap for longitude latitude data of a city</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/470413#M120398</link>
      <description>&lt;P&gt;/*Here's an example from&amp;nbsp;Central Texas Ya'll*/&lt;img id="robotwink" class="emoticon emoticon-robotwink" src="https://communities.sas.com/i/smilies/16x16_robot-wink.png" alt="Robot wink" title="Robot wink" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*This example shows how to convert GPS to planar, and then gplot&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Create a sample data set&amp;nbsp;a location in Central Texas - Google says this is Austin*/&lt;BR /&gt;data have;&lt;BR /&gt;input lat long POINT_ID;&lt;BR /&gt;datalines;&lt;BR /&gt;30.2272&amp;nbsp;-97.7431&amp;nbsp;1&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*Project Lat Long onto Central Texas Map - See Sashelp.Proj4def */&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*Project your lat long onto NAD 1983 StatePlane Texas Central FIPS 4203 Feet*/&lt;BR /&gt;/*Parameters: +proj=lcc +lat_1=30.11666666666667 +lat_2=31.88333333333333 +lat_0=29.66666666666667&lt;BR /&gt;+lon_0=-100.3333333333333 +x_0=700000 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 no_defs*/&lt;BR /&gt;proc gproject latlon&lt;BR /&gt;project=proj4 to="ESRI:102739" /*NAD 1983 StatePlane Texas Central FIPS 4203 Feet*/&lt;BR /&gt;data=have out=want;&lt;BR /&gt;id POINT_ID;&amp;nbsp;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*Now plot using sgplot*/&lt;/P&gt;&lt;P&gt;proc sgplot data=want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; scatter x=x y=y;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*But wait - there's more...*/&lt;/P&gt;&lt;P&gt;/*You can download public maps (.gov websites usually have these) as shapefiles and convert them to your local planar coordinate system*/&lt;/P&gt;&lt;P&gt;PROC MAPIMPORT OUT=&amp;lt;your filename here&amp;gt; DATAFILE='&amp;lt;public shapefile here&amp;gt;.shp';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Check - You must call&amp;nbsp;lat long 'lat' 'long' before you can proc gproject...if not rename&amp;nbsp;them*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Convert Shape file map to Central Texas State Plane*/&lt;BR /&gt;proc gproject latlon&lt;BR /&gt;project=proj4 to="ESRI:102739" /*NAD 1983 StatePlane Texas Central FIPS 4203 Feet*/&lt;BR /&gt;data=&lt;SPAN&gt;&amp;lt;your filename here&amp;gt;&lt;/SPAN&gt; out=&amp;lt;file with planar coordinates&amp;gt;;&lt;BR /&gt;id SHAPE_ID; /*SHAPE_ID is the field common to all the points that define a shape*/&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*Now concatenate the point and the shape file - Note You will need to rename the X and Y in your points file, call them XP and YP*/&lt;/P&gt;&lt;P&gt;data combined; set want &amp;lt;&lt;SPAN&gt;file with planar coordinates&lt;/SPAN&gt;&amp;gt;; run;&lt;BR /&gt;proc sgplot data=combined;&lt;BR /&gt;polygon x=x y=y ID=SHAPE_ID / fill outline;&lt;BR /&gt;scatter x=XP y=YP;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*Even cooler...You&amp;nbsp;can also use proc ginside to see if your point lies inside any of the shapes from your shape file...for example*/&lt;/P&gt;&lt;P&gt;proc ginside data=want map=&amp;lt;your filename&amp;gt; out=Inside INSIDEONLY;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;id SHAPE_ID;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;run;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 18:34:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/470413#M120398</guid>
      <dc:creator>mich1</dc:creator>
      <dc:date>2018-06-14T18:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc gmap for longitude latitude data of a city</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/749880#M235748</link>
      <description>&lt;P&gt;Now that Proc SGmap is available, you might want to use it as a simple way to see crime data points on a city map. SGmap uses tile-based maps (such as Openstreetmap), therefore you don't have to worry about getting a city map polygon, and projecting your map and crime point-data the same way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a simple example (using fake data):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data my_data;&lt;BR /&gt;length crime $20;&lt;BR /&gt;input lat long crime;&lt;BR /&gt;datalines;&lt;BR /&gt;35.7922679 -78.7771215 robbery&lt;BR /&gt;35.7894014 -78.772710 disorderly&lt;BR /&gt;35.7943392 -78.7666627 jaywalking&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title h=22pt "Fake Crime Data in Cary, NC";&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sgmap plotdata=my_data;&lt;BR /&gt;openstreetmap;&lt;BR /&gt;scatter x=long y=lat / group=crime markerattrs=(size=25px symbol=circlefilled);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cary_crime.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60661iFA5D3EB77AEDF1AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="cary_crime.png" alt="cary_crime.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 14:28:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/749880#M235748</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2021-06-23T14:28:33Z</dc:date>
    </item>
    <item>
      <title>More cool stuff...Weather</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/749889#M235755</link>
      <description>&lt;P&gt;* Update...The National Oceanic and Atmospheric Administration (NOAA) has forecast data available on a Microsoft Public Blob...;&lt;BR /&gt;* Download a specific date and forecast from the Windows DOS CMD line (or Linux);&lt;BR /&gt;* Windows azcopy example...&lt;BR /&gt;* azcopy cp "&lt;A href="https://noaahrrr.blob.core.windows.net/hrrr/hrrr.20210601/conus/hrrr.t12z.wrfsfcf00.grib2" target="_blank"&gt;https://noaahrrr.blob.core.windows.net/hrrr/hrrr.20210601/conus/hrrr.t12z.wrfsfcf00.grib2&lt;/A&gt;" "C:\YOURFOLDER\conus.grib2";&lt;BR /&gt;* or Windows curl...&lt;BR /&gt;* curl &lt;A href="https://noaahrrr.blob.core.windows.net/hrrr/hrrr.20210601/conus/hrrr.t12z.wrfsfcf00.grib2" target="_blank"&gt;https://noaahrrr.blob.core.windows.net/hrrr/hrrr.20210601/conus/hrrr.t12z.wrfsfcf00.grib2&lt;/A&gt; --output "C:\YOURFOLDER\conus.grib2";&lt;/P&gt;&lt;P&gt;* But this is a "grib2" file, so you also need to install the wgrib2.exe application from NOAA to parse it...&lt;BR /&gt;* Get a copy of wgrib2.exe (Linux version also available) from NOAA to parse the binary weather file;&lt;BR /&gt;* Use the NOAA link below to install wgrib2.exe in DOS;&lt;BR /&gt;* NOAA link to wgrib2.exe install...&lt;A href="https://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/Windows10/v3.0.2/" target="_blank"&gt;https://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/Windows10/v3.0.2/&lt;/A&gt;;&lt;/P&gt;&lt;P&gt;* You can parse-out your local data and overlay on a city map. Here's how...;&lt;BR /&gt;* wgrib2 C:\YOURFOLDER\conus.grib2 -set_grib_type j -small_grib -98.2:-97.35 29.95:30.78 C:\YOURFOLDER\austin.grib2;&lt;BR /&gt;* Convert the filtered grib2 file to .csv...&lt;BR /&gt;* wgrib2 "C:\YOURFOLDER\austin.grib2" -csv "C:\YOURFOLDER\austin.csv";&lt;BR /&gt;* Now import the file into SAS...;&lt;BR /&gt;data WORK.austin;&lt;BR /&gt;infile 'C:\YOURFOLDER\austin.csv' dsd truncover ;&lt;BR /&gt;length COL1 $30. COL2 $30. COL3 $30. COL4 $30. COL5 $30. COL6 $30. COL7 $30.;&lt;BR /&gt;input COL1 -- COL7 ;&lt;BR /&gt;run;&lt;BR /&gt;* Assign an ID to each coordinate;&lt;BR /&gt;data have (KEEP = ID lat long Weather Value);&lt;BR /&gt;set WORK.austin;&lt;BR /&gt;format ID 10. lat long best20.;&lt;BR /&gt;ID = _N_;&lt;BR /&gt;lat = COL6;&lt;BR /&gt;long = COL5;&lt;BR /&gt;Weather = COL3;&lt;BR /&gt;Value = COL7;&lt;BR /&gt;run;&lt;BR /&gt;* Convert weather coodinates to Texas planer XY coordinates;&lt;BR /&gt;proc gproject latlon&lt;BR /&gt;project=proj4 to="ESRI:102739"&lt;BR /&gt;data=have out=want;&lt;BR /&gt;id ID;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;* Now you have the lat, long, X and Y projection, and weather forecast parameters for a grid of locations over your city - pretty cool, huh?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 15:39:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-gmap-for-longitude-latitude-data-of-a-city/m-p/749889#M235755</guid>
      <dc:creator>mich1</dc:creator>
      <dc:date>2021-06-23T15:39:51Z</dc:date>
    </item>
  </channel>
</rss>

