Desktop productivity for business analysts and programmers

Re: Problems with shapefiles and KML

Reply
Community Manager
Posts: 2,891

Re: Problems with shapefiles and KML

What sort of shapefiles do you have?  Something that PROC MAPIMPORT can support?

See this example:

Using 3rd party shape files to build map charts in SAS - The SAS Dummy

Chris

New Contributor
Posts: 4

Re: Problems with shapefiles and KML

I can draw the shapefile as a map on SAS, what I need to do is use that map with some stats related to each "county" and create a heat or distribution map from there. After that, transform the map on SAS format to .kml because I need to plot then with Google Earth. I will look at the links you guys posted here, if I have any new questions i will come back here, thanks a lot!

Community Manager
Posts: 2,891

Re: Problems with shapefiles and KML

My colleague Leonid Batkhan has a series of articles about integrating SAS data with Google Maps.  Perhaps they might help:

http://blogs.sas.com/content/sgf/tag/google-maps/

Chris

New Contributor
Posts: 4

Re: Problems with shapefiles and KML

Good Morning Chris! Your tutorial helped a lot! Now I can create a proper map with data values, now the only thing I need is convert the datamap into a .kml file, do you know if that is possible? The tutorial from Leonid Batkhan also helped with some codes but in general it was not really useful because it shows how to plot a map directly into google maps and I need the .kml because I need to share this file between a lot of areas into my company. Thanks in advance.

Community Manager
Posts: 2,891

Re: Problems with shapefiles and KML

There are several conference papers that discuss methods for creating KML.  Here are some:

http://support.sas.com/resources/papers/proceedings10/220-2010.pdf

http://www2.sas.com/proceedings/forum2008/253-2008.pdf

You can search for more on support.sas.com, or the useful SAS paper index site: http://lexjansen.com/.  Just search for "KML".

Chris

New Contributor
Posts: 4

Re: Problems with shapefiles and KML

Hello again Chris!

I tried to make it works with those tutorials but I have made no progress, I can create a proper map with SAS, everything works really fine, but the problem is to export those maps in a format that google earth can read. The tutorials you already presented really seems to help, but I am newbie on SAS (Only 2 months of experience) and I have access only to SAS Enterprise Guide, there is no other way or a proper paper wich explain how to do the export process with Enterprise Guide? Thanks a lot, you are really helping me : D

Community Manager
Posts: 2,891

Re: Problems with shapefiles and KML

I'm happy to hear that you've got your maps working in SAS.  The process to export KML is not automated in SAS Enterprise Guide, so you'll have to drop into a SAS program to accomplish it.

To produce a map in SAS Enterprise Guide, you're combining two data sources: a map data set with geospatial data and region identifiers, and a response data set that has the data you want to plot, also segmented by some region identifier.  PROC GMAP allows you to specify those two sources, indicate the ID variable, and then it performs the magic to produce the map.

To create a KML file, you need to provide code that does what PROC GMAP does -- combine the two data sources (MAP and response).  Then you use SAS code to emit that data to an output file in the KML format.  The first paper I referenced provides some examples for how to do that.  You might be able to find others by searching more paper archives or posting into the SAS/GRAPH forum.

Chris

Valued Guide
Posts: 765

Re: Problems with shapefiles and KML

Hi ... if you start with shapefiles and want to convert them to KML using SAS, take a look at ...

Converting shapefiles to KML for viewing in Google Earth and Google Maps - sasCommunity

ps  If you try the above and have any problems, Frank Boscoe's (a friend and the creator of the code on the above link) web site is ...

http://www.albany.edu/~fboscoe/

and there is a link to contact Frank on that page.

Ask a Question
Discussion stats
  • 7 replies
  • 588 views
  • 4 likes
  • 3 in conversation