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

Hello,

 

VIYA LTS 2022.1

 

Can anyone advise how can I create the geography role for Geo line object?

 

I saw very interesting examples in VA Galery (https://communities.sas.com/t5/SAS-Visual-Analytics-Gallery/tkb-p/vagallery) but not many details in the documentation about how to create this role. So far I found how to use the geo map objects (https://documentation.sas.com/doc/en/vacdc/v_017/vaobj/n14ezqxeg2a195n1au1q980gbkte.htm

and how to create the geography data items 

https://documentation.sas.com/doc/en/vacdc/v_018/vareportdata/p031vp9uc5y5iun0zipy3c1trkqn.htm

 

Thank you for your help.

 

Regards,

smm662002

 

1 ACCEPTED SOLUTION

Accepted Solutions
FalkoSchulz
SAS Employee
Hi, looking at your output screenshots - it seems you have used the Geo Coordinate visual object which will indeed always render locations using markers. You would want to use the Geo Line object instead now that your geographic items is configured using a polyline based geo data provider. Hope this helps. Falko

View solution in original post

8 REPLIES 8
Sam_SAS
SAS Employee

Hello,

 

In general you will need to perform these high-level steps:

 

1. Obtain or create a table or Esri shapefile that contains polyline data.

2. Load that data either into CAS or into an Esri feature service.

3. In VA, create your geographic data item, which will entail defining a geographic provider unless one already exists.

 

Do you already have your polyline data?

 

Thanks,
Sam

 

smm662002
Quartz | Level 8

Hi Sam,

 

Thank you for your answer. 

I thought that might be the case. 

Are there any other "pure" SAS methods not using ESRI shp files?

 

Thank you,

smm662002 

Sam_SAS
SAS Employee

Esri shapefiles are easiest way to get started. You can import shapefiles into CAS rather than host it on an Esri feature service.

 

I seem to remember there was a SAS Global Forum paper on this topic (polylines), but I can't seem to find it. I'll keep looking.

 

Making your own data, you need to have data like this:

 

lines.png

 

That is, you need these columns:

  • X and Y (latitude/longitude) projected coordinates
  • A sequence column that tells what order the coordinates should be connected in
  • An ID column that identifies the lines and is used for matching. The values for this need to match the values of a column in your report.
  • A segment identifier column that identifies the segments in each line. I believe this is optional? It has been a little while since I worked with polylines. In the data set I am testing with, the value for every row is "1" for this column.

Hopefully that will help you get started. To define the geographic provider, you need to have special permissions. Usually it is easiest to just log in as an admin if you such a login available to you. Otherwise you could ask your administrator to grant you Create, Delete, and Update permissions for the /maps/providers URI. 

 

Let us know how it goes!

 

Thanks,

Sam

smm662002
Quartz | Level 8

Hello,

 

Thank you for your answer. 

Unfortunately, no success so far.

I have converted the shp file NC_RoadLink.shp (all the SHP related files are in the zip file attached NC_RoadLink.zip) using %shpimprt like below:

 

%shpimprt(shapefilepath=/folder1/folder2/NC_RoadLink.shp, id=identifier, outtable=road_links, cashost=controller.address, casport=5570, caslib='casuser');

 

This has created the table road_links in CASUSER caslib.

 

I have created a new Geography provider using the settings from "Edit_Geographic_Data_provider.zip" and the Geography data item using the settings from "Edit_geography_item.zip". 

 

Unfortunately, even if I selected "Polyline" Geometry Type the output created is made of points rather than links. The points created follow very well existing roads, as it can be seen in the results "Output_zoom_out.zip" and "Output_zoom_in.zip".

 

Can anyone advise way points are created instead of links?

 

Thank you,

smm662002      

Sam_SAS
SAS Employee

Sorry you are having trouble, but it looks like you have completed the more difficult steps successfully.

 

Can you show what the road_links table looks like? You could put it in a list table object and make a screen capture, or export to CSV. I don't have the tools handy to visualize the shapefile directly.

 

Thanks,

Sam

FalkoSchulz
SAS Employee
Hi, looking at your output screenshots - it seems you have used the Geo Coordinate visual object which will indeed always render locations using markers. You would want to use the Geo Line object instead now that your geographic items is configured using a polyline based geo data provider. Hope this helps. Falko
HAVIER
Calcite | Level 5

using your method i was able to create polyline but when i try to have multiple polylines using different identifiers it is showing as blank. when i make provider only for a specific identifier it works and otherwise it wont

FalkoSchulz
SAS Employee
Can you share how your geo data provider structure looks like? If you have more than one polyline - each of these lines would get a unique identifier assigned. Given it's a line - you will need more than two rows representing the lines (minimum a start and an end point). You would repeat this for any line - each with it's own identifier.

In your business data (the table used in the report) - would just carry the actual line identifiers and you would use related column when mapping the geo data provider. Assuming - those match successfully - you should be able to see multiple polylines in your geo map.

If you can't get it to work - maybe share the first couple of rows representing your lines as well as an extract of your business data. If you see any warnings via the small 'i' icon in the bottom right corner of the geo map - see whether it helps to narrow down the issue.

Falko

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!

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
  • 8 replies
  • 2076 views
  • 1 like
  • 4 in conversation