<?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 it possible to &amp;quot;spatial match&amp;quot;? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-quot-spatial-match-quot/m-p/765619#M242524</link>
    <description>&lt;P&gt;Sorry, I missed this one in my inbox.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just did my own test run on my own data, and this is what I did.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import
	datafile = "/your/data/here/"
	out = needs_geo (rename = (longitude = x latitude = y)) 
	dbms = csv
	replace;
	guessingrows = 5000;
run;

proc mapimport
	datafile = "/your/shape/file"
	out = shape;
run;

proc sort
	data = needs_geo;
		by x y;
run;

proc sort
	data = shape;
		by x y;
run;

proc ginside
	map = shape
	data = needs_geo
	out = needs_geo_w_shape;
	id var-you-want-from-shape-file;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am by no means advanced with mapping -- it's something I've learned on my own, and I have a crude working knowledge on how things work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would recommend renaming your respective latitude and longitude coordinates on your EDMT dataset to x and y (as I do on the PROC IMPORT).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Essentially, just use my code and tailor it to your data set. Let me know if there are any issues. It worked for me, but I would be careful and check everything to make sure it makes sense. My own local data seemed to make sense.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Sep 2021 12:37:36 GMT</pubDate>
    <dc:creator>maguiremq</dc:creator>
    <dc:date>2021-09-02T12:37:36Z</dc:date>
    <item>
      <title>Is it possible to "spatial match"?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-quot-spatial-match-quot/m-p/764451#M242146</link>
      <description>&lt;P&gt;Hi everyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know, if it is possible to spatial match?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I mean is that I have a shape-file with some polygons, and I have another file with a lot of different coordinates. I want to merge the coordinate-dataset with the shape-file, so the coordinates can get the right polygon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does my question make sense? Thanks in advance &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 13:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-quot-spatial-match-quot/m-p/764451#M242146</guid>
      <dc:creator>hkgejd</dc:creator>
      <dc:date>2021-08-27T13:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to "spatial match"?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-quot-spatial-match-quot/m-p/764458#M242149</link>
      <description>&lt;P&gt;I've had luck in the past with importing the shapefile using PROC MAPIMPORT, and then using PROC GINSIDE to project the coordinates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without data, that's all I can give you. Hopefully that helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some documentation:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grmapref/p1rvpewhocha4yn1gipf920vchn3.htm" target="_self"&gt;PROC MAPIMPORT&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/grmapref/n1em0w0lpfi8qdn1jhervlg4lsyw.htm" target="_self"&gt;PROC GINSIDE&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 13:26:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-quot-spatial-match-quot/m-p/764458#M242149</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2021-08-27T13:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to "spatial match"?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-quot-spatial-match-quot/m-p/765060#M242307</link>
      <description>&lt;P&gt;Hi maguiremq&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your suggestion, but I could not really get it to work... If you don't mind, you could try it out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The shapes I'm trying to spatial match are from this site &lt;A href="https://www.efgs.info/data/" target="_blank"&gt;https://www.efgs.info/data/&lt;/A&gt; under "Denmark".&lt;/P&gt;&lt;P&gt;I did have luck using "proc mapimport". I have taken a subset of this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.SHAPE;
  infile datalines dsd truncover;
  input X 7. Y 9. SEGMENT 1. GRD_NEWID:$25.;
datalines;
4442000 3519000 1 1kmN3519E4441
4441000 3519000 1 1kmN3519E4441
4441000 3520000 1 1kmN3519E4441
4442000 3520000 1 1kmN3519E4441
4442000 3519000 1 1kmN3519E4441
;;;;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The dataset I want to match it with is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.EDMT;
  infile datalines dsd truncover;
  input DDKNcelle1km $12. wgs84_bredde 14. wgs84_laengde 12.;
datalines;
1km_6072_684 54.765037537 11.871144295
1km_6072_684 54.765060425 11.871236801
1km_6072_684 54.765117645 11.871257782
1km_6072_684 54.765144348 11.871356964
1km_6072_684 54.765148163 11.870749474
1km_6072_684 54.765159607 11.870833397
1km_6072_684 54.765193939 11.871382713
1km_6072_684 54.765197754 11.871330261
1km_6072_684 54.765220642 11.870867729
;;;;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 13:51:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-quot-spatial-match-quot/m-p/765060#M242307</guid>
      <dc:creator>hkgejd</dc:creator>
      <dc:date>2021-08-31T13:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to "spatial match"?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-quot-spatial-match-quot/m-p/765619#M242524</link>
      <description>&lt;P&gt;Sorry, I missed this one in my inbox.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just did my own test run on my own data, and this is what I did.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import
	datafile = "/your/data/here/"
	out = needs_geo (rename = (longitude = x latitude = y)) 
	dbms = csv
	replace;
	guessingrows = 5000;
run;

proc mapimport
	datafile = "/your/shape/file"
	out = shape;
run;

proc sort
	data = needs_geo;
		by x y;
run;

proc sort
	data = shape;
		by x y;
run;

proc ginside
	map = shape
	data = needs_geo
	out = needs_geo_w_shape;
	id var-you-want-from-shape-file;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am by no means advanced with mapping -- it's something I've learned on my own, and I have a crude working knowledge on how things work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would recommend renaming your respective latitude and longitude coordinates on your EDMT dataset to x and y (as I do on the PROC IMPORT).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Essentially, just use my code and tailor it to your data set. Let me know if there are any issues. It worked for me, but I would be careful and check everything to make sure it makes sense. My own local data seemed to make sense.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 12:37:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-quot-spatial-match-quot/m-p/765619#M242524</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2021-09-02T12:37:36Z</dc:date>
    </item>
  </channel>
</rss>

