BookmarkSubscribeRSS Feed
t75wez1
Pyrite | Level 9

Hi All,

I try to create a map to show about 2,000 LTA(local trading area) group from about 40,000 U.S. zip codes.

 

Each LTA has its own unique ID# from "0001" to "2000".

 

I've used "Proc GMAP" and "Proc SGMAP" on SAS version 9.4M6.

 

But I don't know how to best handle those 2,000 geography areas.

 

Any insight would be highly appreciated.

 

Regards,

Ethan

3 REPLIES 3
ballardw
Super User

What size display are you looking at?

Do you intend to show the geographic boundaries of a zip code to show the LTA, or do you want to place a symbol, such as a dot, on the map of a location for an LTA?

If the symbol is all you want do you intend to place a label on the map or have a pop-up to indicate the LTA identifier?

 

If you want to show zip code geographic areas then you may have a significant problem as there are Zip codes assigned to single buildings when enough mail is involved that could be contained in other areas. Also finding an actual boundary map for Zip codes is problematic for much of the western states in areas of low population density. The US Census site has boundary files for Zipcode Tabulation areas but that has lots of "holes" where no one lives or the population density is low.

 

The SASHELP.ZIPCODE data set you should have includes Latitude and Longitude variables for the estimated geographic center of the 5 digit Zip code. If you SAS Install is a bit old you can get an updated Zipcode data set from the SAS site for map data. If you need to have a Zip +4 then you may be out of luck.

 

I asked about the display size because you may even at just showing points have a lot of crowding and be unable to show much detail if trying to cram a map of the entire US with Alaska and Hawaii into a 6 inch by 6 inch display.

t75wez1
Pyrite | Level 9

1)I use the goption below in my code: 

goptions reset=all device=png xpixels=2000 ypixels=1500 gsfname=gout

cback=aliceblue ftext='arial/bo' htext=3 gunit=pct;

 

2) I downloaded the TIGER zip code shape files "tl_2018_zcta510.shp" to obtain all latitude & longitude of boundaries for each zip code. 

 

3)Use SAS function polycont to form the area.

 

But struggling with limited # of colors to show.

ballardw
Super User

@t75wez1 wrote:

1)I use the goption below in my code: 

goptions reset=all device=png xpixels=2000 ypixels=1500 gsfname=gout

cback=aliceblue ftext='arial/bo' htext=3 gunit=pct;

 

2) I downloaded the TIGER zip code shape files "tl_2018_zcta510.shp" to obtain all latitude & longitude of boundaries for each zip code. 

 

3)Use SAS function polycont to form the area.

 

But struggling with limited # of colors to show.


The ZCTA in tl_2018_zcta510.shp stands for Zip Code Tabulation Area. So will likely have the issue about not complete coverage or funny looking boundaries in some places.

 

SHOW the actual code using to make the map. I don't see that. I'm not sure what you may have been doing with POLYCONT. Proc Mapimport would typically be the better way to get a SHP file into a SAS format.

 

You are going to have a very hard time getting 2000 colors that are going to make sense. So describe what you are trying to do with that many colors. So describe what/how you want to use color.

 

Likely one thing you would need to do is remove the boundaries between zip codes that make up an LTA assuming they are contiguous areas. and assign an identification variable in the map data that matches that of your LTA. 

 

PIXELS are generally a poor measurement unit as it depends on the display device. Better would be to set either XMAX and YMAX or HSIZE and VSIZE in inches, cm or mm for consistency.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 488 views
  • 1 like
  • 2 in conversation