BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Yiting
Quartz | Level 8

I have a dataset with a geography item Region, a categorical variable Customer Category 1, and a measure Frequency which is a count of values in Customer Category 1 for each Region. These can be seen in a List. All right. But when I put it into a Geo map, (I defined Region variable via Custom polygon shapes), the frequency in the map is not right. Each bubble has a frequency of 1, which is not right. But if I have a geography item defined by Predefined geographic names and codes, frequency, shown as the size of the bubble, will be rightly the count of items in that category. Why???

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
FalkoSchulz
SAS Employee

Yes, that's correct - a custom polygon based geo item - does not require latitude/longitude. However, not specifying these - will limit the geo map to render region based overlay only. If you want to see bubble/coordinates overlays you will need to provide the centroid latitude/longitude columns for your custom region. Yes, I noticed you have selected the only other pair available in your data source - the lat/lng pair from your customers. However, this would result in having multiple lat/lng values for each of your regions.

 

Example: Assume you have 10 customers in region "Region 1". You assign the lat/lng customer locations to your "Region 1" geo item. At this point this specific region has 10x data points even though you really only have one region - resulting in 10x data points being rendered on the map. What you need, are two additional data columns describing the centroid (center) of your polygon, let's label those latitudeRegion, longitudeRegion. These columns are unique for each region (the same values in each row for the region) and can be generated using a simple data step or sql query - most people use something like the %CENTROID macro as part of the SAS/Graph package. Alternatively you could probably also use a simple average aggregation out of your customer locations (not as accurate but maybe sufficient for what you need). 

 

I'm not sure I understand what you mean by the empty map if you don't specify lat/lng. In this case the geo map should default to the region map and render your custom region. If that doesn't happen - than there is an issue with your custom polygon provider. A little information icon in the bottom right corner - usually has some information about potential problems. But you are right - if you only need to render regions on geo - you don't need lat/lng columns in your data source. These are only required for data point based overlays such as bubble/coordinate.

 

Hope this helps. Regards, Falko

View solution in original post

11 REPLIES 11
Madelyn_SAS
SAS Super FREQ

In the geo map, in the very lower right corner there is an "i" icon indicating that there is some information. If you click on that icon, what does the message say.

Yiting
Quartz | Level 8

it says some features might be missing from the map because of missing location data

 

I think that is fine with me. most of my records have location data.... 

FredrikE
Rhodochrosite | Level 12

It's because you use Norwegian coordinates (bad swedish joke.......:))

 

No seriously...

 

For some strange reason I have found that the automatic frequency variable not always work as you want.

I use to create a calculated measure (i.e with the value1) and use that one instead when that happens.

 

Might be helpful here 🙂

 

//Fredrik

Yiting
Quartz | Level 8

Hi, 

 

Hahaha... I like Swedish jokes...

 

But my frequency is fine in the list and I also tried to make a measure of count, and put it on the map instead of frequency, but got the same thing... 😞

 

Yiting
Quartz | Level 8

Also, if my map type is "Region", the correct frequency will be shown on the map, but then for each map, it can only show one value of the variable interested, that means I will need 3 maps since my variable has 3 different values.

 

 

FalkoSchulz
SAS Employee

The calculation of the frequency depends on the distinct count for each unique data point in geo. So the actual type of overlay has an effect here. A unique data point for 'region' is one of your custom polygons - however for things like 'bubble' or 'coordinates' a unique data point is determined by the given latitude/longitude pair.

 

You mentioned - that you get correct results if you configure your item using the 'predefined geographic names and codes' but don't if you configure a custom polygon based geo item. This indicates that the lat/lng coordinates used in the latter do not correctly match your regions. For instance, in order for the geo map to properly determine the frequency of all your customers in region 'Region Midt', it needs to have a unique lat/lng pair for each corresponding row in your data (no variations of this number nor missing). Each pair must contain the same value. Such unique pairs are provided if you use the VA provided data - but you may have to double check the lat/lng values in your data source. I'm assuming the lat/lng values used to configure the region geo item are in fact the customer locations, right? This would explain your results.

 

As a side-affect - and I'm sure you have noticed - the geo map renders far too many data points. In your example - you only have 5 or so regions - so you shouldn't get more than 5 data points on the map if configured properly. You may be able to create separate regionLatitude & regionLongitude measures in your data source here before loading into VA.

 

Now, once you have fixed the above - you may notice that you get 3x data points on top of each other for each of your regions. That is because you have colored by 'Customer Category 1' with 3x distinct values. Given each category belongs to the same region - the bubbles will overlap. Using a lower detail data item such as customer category may not be as useful here.

 

Hope this makes sense. Regards, Falko

Yiting
Quartz | Level 8

Thank you very much. I guess you figured out the problem, but I am not sure I understand your solution.

 

Yes, there is something tricky there.

 

When defining my Region as geo item,I supplied a table in the step "Edit Polygon Provider", but coming back to the step of "Edit geography item", I have to provide longitude and latitude, (even though these do not have the *, if I dont provide something here, there will be nothing on my map). So I used the LAT and LON of my object (customers). I dont think this is right, but in the dataset, I have no other LAT and LON.

 

Back to the input dataset, do you mean that I have to have the same LAT/LON for all customers in a Region? But then what that value should be? A Region is defined by tens of thousands of LAT/LON pairs. What do you mean by "Such unique pairs are provided if you use the VA provided data"?

 

What feels right to me is ... to define Region with those tens of thousands of LAT/LON pairs and the input dataset does not even need to carry LAT/LON information, it only needs Region name... but I am not able to do that as well.

 

 

FalkoSchulz
SAS Employee

Yes, that's correct - a custom polygon based geo item - does not require latitude/longitude. However, not specifying these - will limit the geo map to render region based overlay only. If you want to see bubble/coordinates overlays you will need to provide the centroid latitude/longitude columns for your custom region. Yes, I noticed you have selected the only other pair available in your data source - the lat/lng pair from your customers. However, this would result in having multiple lat/lng values for each of your regions.

 

Example: Assume you have 10 customers in region "Region 1". You assign the lat/lng customer locations to your "Region 1" geo item. At this point this specific region has 10x data points even though you really only have one region - resulting in 10x data points being rendered on the map. What you need, are two additional data columns describing the centroid (center) of your polygon, let's label those latitudeRegion, longitudeRegion. These columns are unique for each region (the same values in each row for the region) and can be generated using a simple data step or sql query - most people use something like the %CENTROID macro as part of the SAS/Graph package. Alternatively you could probably also use a simple average aggregation out of your customer locations (not as accurate but maybe sufficient for what you need). 

 

I'm not sure I understand what you mean by the empty map if you don't specify lat/lng. In this case the geo map should default to the region map and render your custom region. If that doesn't happen - than there is an issue with your custom polygon provider. A little information icon in the bottom right corner - usually has some information about potential problems. But you are right - if you only need to render regions on geo - you don't need lat/lng columns in your data source. These are only required for data point based overlays such as bubble/coordinate.

 

Hope this helps. Regards, Falko

Yiting
Quartz | Level 8

I finally got it! Yes, as you said, in LAT and LON, I need to make them same for all customers in a Region... puh... thanks a lot for help!

FalkoSchulz
SAS Employee

Glad this worked for you! If my last response was the key - maybe tag it as solution for this discussion - this way others can find answers more quickly. Regards, Falko

Yiting
Quartz | Level 8

I did! Thanks! its crazy... it took me lots of time to query the coordinates of each customer and eventually I just need pairs of mean for each region... sigh...

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 11 replies
  • 1872 views
  • 0 likes
  • 4 in conversation