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

6 REPLIES 6
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 6 replies
  • 932 views
  • 1 like
  • 3 in conversation