BookmarkSubscribeRSS Feed
liztraore
Calcite | Level 5

I am trying to recreate a map I creates using ESRI ArcGIS using SAS.  The first map below is what I originally created in ESRI. The second was created with SAS. In ESRI, I can clip shape files based on the size of another shape file but I haven't been able to figure out how to do this in SAS. The data set I am using can be down loaded from https://data.hrsa.gov/data/download under mental health chose the parent boundaries shape file.

 

Below is the SAS code I used to create the second map.

proc mapimport datafile="....../HPSA_PLYMH_SHP_DET_CUR_VX.shp"
out=MHShortageArea;
run;
proc gproject
data=MHShortageArea
out=MI_MHShortageArea
project=ALBERS degrees eastlong
parmentry=mi
dupok;
where CStFips eq "26";
id HpsSrcID;
run;

 

proc gmap data=MI_MHShortageArea map=MI_MHShortageArea RES=NONE ;
id HpsSrcID;
choro CStFips / nolegend levels=1 coutline=white;
run; quit;

 

Capture v3.PNGCapture.PNG

9 REPLIES 9
ballardw
Super User

I'm not sure I quite understand what you mean by: " clip shape files based on the size of another shape file."

Does that mean to have the same outside boundary?

liztraore
Calcite | Level 5

Yes, Clipping in ESRI allows you to make the outside boundaries the same.

ballardw
Super User

GPROJECT changes spherical coordinates so I am not quit sure that "clipping" would be an appropriate concept to try with that procedure.

 

Did you try displaying the MHShortageArea data set with GMAP?

 

Display size would be controlled typically by setting the GOPTIONS HSIZE and VSIZE, horizontal and vertical size and/or XMAX and YMAX.

liztraore
Calcite | Level 5

It isn't a projection issue. The shape file for what every reason included the water surrounding Michigan. I want to cut the water out so only the land associated with the state of Michigan is showing.

TomKari
Onyx | Level 15

Just to be clear, are you saying that the top map would be fine if the areas that are in white were completely missing, the way they are in the bottom map? Or are there other changes you need as well.

 

Tom

liztraore
Calcite | Level 5

No, the top map was produce in ESRI ARC GIS. Using the same shape file that was used in the second map but I was able to "clip" the map or modify the outer boarder so it didn't include the water surrounding Michigan. I am now trying to replicate the map using SAS as I don't have access to ESRI ARC GIS software any more. 

 

It is the bottom map that I am trying to get to look like the top one. 

TomKari
Onyx | Level 15

Now I'm confused. I'm not an expert with SAS mapping, but I've used it a couple of times. Using the following code does a simple Michigan county map:

 

data MI1;
	set mapsgfk.us_counties (where=(StateCode = "MI"));
run;

proc sql noprint;
	create table QData as select distinct County, 1 as DataVar
		from MI1 order by County;
quit;

pattern1 v=s c=aliceblue;

/* Draw the map */
proc gmap data=QData map=MI1 density=5 all;
	id county;
	choro DataVar / coutline="White";
run;

which looks like this:

MI1.png

 

That to me is identical to your ESRI map, except that a few counties aren't blanked out. I'm not sure what you mean about the "water surrounding Michigan". I don't see any water.

 

Tom

liztraore
Calcite | Level 5

 

The map below highlights the water issue. I can't use the maps within SAS alone. I am bring a shape file in that was created by Health and Human Services. This shape file shows areas that they've designated as under served for mental health providers; which is most of Michigan.  This shape file includes the water (the great lakes) that is part of Michigan. I need to clip the shape file so the water isn't part of the map. The shape file that I am bringing in is the blue layer shown on the map below. 

 

Designations are a combination of counties, municipalities, and census tracks. So I can't create an excel file and then map that by county either.

 

 

MI HPSA Mental Health 2.PNG

TomKari
Onyx | Level 15

Now I understand. Thanks for the clarification!

 

Unfortunately, this goes beyond my basic knowledge of SAS mapping software (or any other mapping software, for that matter). Hopefully someone else will be able to provide some guidance.

 

Good luck!
Tom

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 9 replies
  • 1204 views
  • 0 likes
  • 3 in conversation