Thursday, September 13, 2007

Many are probably familiar with John Magliacane's RF Signal Propagation, Loss, And Terrain analysis software (SPLAT!). This software is useful for visualizing terrain and performing Longley-Rice path loss and coverage prediction using the Irregular Terrain Model. It had been only available for the Linux OS. I was able to compile it for Windows with a few minor modifications. This is a command line program, freely available under the GNU GPL. I would be happy to include the source code if you are so inclined.

There is a PDF version of the instructions for the Linux version, which is pretty much exactly how it works in Windows too. Some utilities are included as well as instructions for downloading free terrain data for your area. I have only tested it in Windows XP SP2, so if you have any problems, let me know.

Fixes for Windows Port

11-12-07 - Fixed error in srtm2sdf.exe that caused it to not work with hgt or bil files.

11-15-07 - Fixed error in splat.exe that caused it to generate coverage maps without any loss data plotted when analyzing sites with anything other than default settings.

11-15-07 - Changed a trailing "/" to a "\" in the data path option. This never caused a problem in my setup, but might have in others.

2-15-08 - Successfully ported the usgs2sdf.exe utility to Windows. Now those who prefer the USGS DEM's as raw terrain data can convert them to Splat data files.

82 comments:

Hi John,I was trying your SPLAT windows version and I have some trouble with srtm2sdf converter: I got most of time the Error warning: ..Premature EOF detected while reading hgt files!The hgt files I was using are: N14W090.hgt, N14W089.hgtThen splat application don't found any elevation data from the sdf generated files.Could you please help me?Thank you in advance.

Hi Federico. I think I know what the problem is. I had this happen once before. I guess I didn't test the srtm2sdf converter with this upgrade. I must have forgotten to change one more thing in the source code. I will recompile it ASAP and comment here when it is fixed.

Thanks again for pointing out the bug Federico. I have fixed it and reuploaded the whole package. You should be able to download it again and have the fixed version. Let me know if you have any more problems.

Hi John,Thanks for the new version, it's working fine.I have and additional comment: I think option -d is not working. I needed to put sdf files in the same working directory of Splat application to make it work with it.

I tried putting in a long path with spaces in folder names and I did not have a problem. Is there any thing special about your installation or the way you typed in the command line? What did you use as an example of a path?

Federico, I went ahead and changed the trailing "/" in the code to a "\" for Windows. I could not reproduce the problem you described but I thought it would at least be more consistent. I found a couple of other things I had to fix anyway. I hope you can get it working.

I found what's wrong with my command line! Just some minutes ago I was trying with the last version but still not working: The point is that I was using -d \sdf\ and it has to be -d sdf\. I forgot to say you that all sdf files are on a directory under splat's directory.Thanks again for your help and congratulations for your very useful contribution on Splat for windows.

Hi John,I have another comment:The Line-of-Sight Path line within the kml file have the same data as Point-to-Point Path line, so actually LOS is not a straight line.I get a real LOS line deleting all the coordinates between the first and last and changing the correcting the tx and rx altitude.

This error seems to indicate that the Windows version of GnuPlot is not installed on your computer, or that it can't find the "pgnuplot.exe" in your system path. The SPLAT! author uses gnuplot, a separate program, for plotting terrain and elevation profiles.

You can download a Windows version of GnuPlot at http://gnuplot.sourceforge.net/download.html. Install it and add the "bin" folder to the system path. Test it by typing "pgnuplot" at a command prompt. If that works, SPLAT! should be able to use it for generating profiles.

Unfortunately, I don't have access to Vista Home Premium, so I don't know if there are any problems or not. I would definitely invite anyone to post their experiences using Splat on the different versions of Windows that are available.

I have been able to use Splat! and the associated utilities in Vista Home and Vista Enterprise successfully. I was also able to use the Windows Gnuplot binaries for graph plotting and IrfanView to view and convert the PPM images in both versions of Vista without any problems. I can't see any real reason why it wouldn't work on any version of XP, Server or Vista, but invite any experiences to the contrary.

Hi John, this is a very good program. Has been successfully used it compute RF propagation. There are locations in the US that are below Sea Level (Salton Sea area in California). I downloaded the STRM data and I do not know if this data only goes to 0 mts or if the program only computes above 0 mts. Also entered the Seamless server from the USGS and the data posted there has negative values. Any insight on this topic would be very appreciated.

I am not an expert on the formats of the elevation data, so I am not sure how to answer your question. For starters, Doug Lung from TV Technology has been using this program for years and has written some good articles on terrain data and Splat in particular. You might look over his columns at TV Technology for some more details.

I think that the data providers (USGS Seamless or ftp) usually have some kind of text file or description of what the data format and range is. See for example, ftp://e0srp01u.ecs.nasa.gov/srtm/version2/Documentation for some information on the HGT files at that site. You might find some similar info on the USGS Seamless server for those data files.

Last, don't forget that you can manually specify the ground elevation of certain locations in Splat with the "-udt" switch if you need to compensate for some special case.

Thanks for your comments! I am glad that the program is useful to you.

Sorry I didn't have a good answer for your question Pedro. Here is what the software's author has to say:

"As far as I know, SPLAT! handles regions below sea-level just fine. The only "oddity" that will occur is that as terrain reaches sea-level, it will be displayed as the color blue in .PPM images, even though water isn't really there.

"Computer simulations are only as good as the assumptions we make. :-)"

Hello John. yes in fact. The only thing I needed to do is input the correct parameters to the srtm2sdf.exe program to handle negative altitudes on the input file. I also found a glitch. Splat gets blocked when the antenna size is below sea level. Lets say, Imperial City in California is 235 feet below sea level. If you set up the antenna to less than that, splat does not produce a result. So you have to input an antenna height to more than 235. But really, this tool is great.

Thanks for the windows version John. I am having trouble producing the grayscale topographic image in the resulting ppm file. My output (when viewed with Irfanview) has the path loss color map with blue background. I like to get the grayscale topographic backgound. I used the following command line with the sample data file:

splat -t wnju-dt -L 30.0 -db 140 -o plot.ppm

I installed the gnuplot successfully too thinking that would help but that is needed for linear plots I suppose.

Apologies for the "anaynomous" post - wanted to get the question in quickly.

A few questions come to mind:Does the output look like a smooth, regular ellipse? Have you downloaded terrain data for the location in the sample transmitter file (wnju-dt) and generated Splat Data Files? When you run Splat, do you see any messages about regions being "assumed as sea-level"?

I would guess that there is some problem relating to terrain data. You are correct that Gnuplot is used only for linear plots. If you have properly prepared the terrain data and the ".sdf" files are not in the same folder as "splat.exe" you should pass the path to the data files with the "-d" switch.

I hope this helps you get it working. I appreciate all feedback, but if you are so inclined, you can always sign your comments with the "Name/URL" identity option below the comment field without having to log in or anything.

I imagine this could happen if you double click the splat.exe in Windows. This version of Splat is command line driven, like the Linux version, so you'll need to run it from the Command Prompt in Windows. There is a good article with examples on running Splat at TV Technology magazine that I think would help you out.

Hi ! I came across SPLAT ! and really find it quite interesting. Before i go through the docus & installation procedures, can someone tellme whether i can use this system for interference analysis and prediction of interference free zones in an area . Also what all parameters of Transmitters, antennaes & receiver are reqd to be fed in .

Im really new to this software and how to use it. I would like to know if you have any kind of guide (where to put the hgt files, how to arrange the files in the splat folder and where to put the splat folder)

Salomon, thanks for your interest in SPLAT!. It doesn't take a lot of configuration to use SPLAT!, you should be able to unzip the files into whatever folder you want and run it from the command line.

There should be a pretty complete set of documentation included in the zip file. I would also highly recommend reading Doug Lung's series of articles on running SPLAT!. The later ones cover running the Windows version specifically and are a good intro to using it.

First of all, let me thank you for your effort on making splat function for windows users.

I've been using your splat windows version and i have two dudes, one is when i use the -metric command i get wrong distance on the transmitter report, but in the receiver it`s ok. The other dude is, if i can actually draw on the normalized height an obstacle all along the terrain with an specific height? for example, if need to know if a 15 m height trees through my LOS could obstruc my LOS. Thanks a lot

I will have to defer to the software architect on the issues you mentioned. I will give you my best guess, however.

Regarding the -metric switch: I believe that this has been fixed in the 1.2.2 version according to the notes in this release. I am working on compiling this for Windows, so hopefully that will solve your problem.

Regarding the option to add obstacles: I think what you are looking for is the "user-defined terrain file" or -udt switch. The SPLAT! documentation outlines how to format a text file so as to pass information about lat, lon and height above ground of obstacles that you want to add to the analysis. It is basically one or more lines of comma seperated values (lat, lon, height) and the height at this point is added on to the height of the terrain determined by the SDF data for that point.

I hope this information is helpful. I will pass your comments along to John Magliacane and see if he has anything to add.

First, Thank you for a great port of Splat! I am working a making a server service that takes request from a web page and outputs splat elevation(line of site) images. When i specify a path to the output image everything runs ok but I don't get an image. If i remove the path and just pass a filename then splat outputs an image to the working folder. I have tested this via command prompt with the same results. Any ideas? By the way the output switch I'm using is -H

Hey John,I am having trouble with the aspect ratio on the maps that I make with the windows compile. Every map has a different ratio, but all are shorter longitudinally as opposed to a latitudinal width. Do you know what I am doing wrong?Thanks in advance,Kathy

Is it possible that your path has a space character in it? There might be some differences between Linux and Windows in how these kinds of paths are handled. You might try playing with some different path names to see if that is the problem.

Kathy, I am having a little trouble visualizing what you describe. Can you send me a jpg or something of your output and maybe the qth files you're using? Do you get different maps between the Linux and Windows versions?

Thanks for the work you're doing here. I'm having trouble getting Splat! to display the ground elevation of my site locations (they all show up as 0.00 feet AMSL) and I'm guessing it has to do with my sdf files not loading properly. When I run my command line I get a message stating Region "42:43:88:89" assumed as sea-level into page 1... Done!

I'm running the linux version but can't find help anywhere for it (aside from the man pages) so I was hoping maybe you could spot something. My command line is "splat -d /splat -t transmit.qth -r receive.qth"

Hey Andy,Isn't it amazing how often that happens that right after you ask a question, the answer comes to you. Happens to me all the time. :)

I'm glad the software is useful to others. I haven't had much time to work on it lately, a lot going on in my personal and professional life. I am certainly no expert, and I am always happy to let someone more experienced step in and answer questions.

I have been trying to compile your source code for Windows. I had trouble with adding bzlib. I have added the files: bzlib.c, bzlib.h and bzlib_private.h (from the Internet), installed MinGW enviromentand ran the following:

I'm sorry you're having trouble compiling the program. I think you have been misinformed on the proper use of the BZip2 library. You are on the right track, but what you need to do is download the BZip2 software package that has a binary library file for Windows. Try the "Developer Files" zip file here: http://gnuwin32.sourceforge.net/packages/bzip2.htm

Inside that zip file you will find subfolders named "include" and "lib". The contents of these folders should be copied into your MinGW installation in the include and lib folders, respectively. Once that is done, you can leave off the "bzlib.c" file in the compiler command line, as the "-lbz2" is what tells the compiler to link the BZip2 library into the Splat executable.

A second option would be to download the BZip2 source code and compile a library file yourself and manually put libbz2.a and the bzlib.h files into your MinGW installation.

I hope these suggestions help you get it working. Sorry it took me a few days to get back to you.

Hi John, I apologize if this is a repeat. I seem to be having trouble with the -L, Longley-Rice. It looks like it is not seeing my SRTM topo data. My output looks like concentric ellipses. However, it is clear that splat sees the topo data with -c, LOS plots. Here is my command:Splat -t kd7wlx.qth -L 5 -o Topo.ppm -d data\sdf-sd PS I am running Splat at Win 7

Jerry, I seem to recall a similar error, but I can't put my hands on the answer right now. I haven't been able to work much with the software lately. Have you tried the version maintained by Austin Wright? He's got a more up-to-date port than I do currently.

I'm trying to modify the source so that the max_west, min_west, max_north, min_north are printed to stdout.

I'm not a windows guy but am trying to compile the code under visual studio. I get the following errors:splat.cpp: In function ‘int mkstemp(char*)’:splat.cpp:77: error: ‘GetTempPath’ was not declared in this scopesplat.cpp:79: error: ‘GetTempFileName’ was not declared in this scopesplat.cpp: In function ‘void PlotLRPath(site, site, unsigned char, FILE*)’:splat.cpp:2876: warning: suggest parentheses around + or - inside shiftsplat.cpp: In function ‘int mkstemp(char*)’:splat.cpp:77: error: ‘GetTempPath’ was not declared in this scopesplat.cpp:79: error: ‘GetTempFileName’ was not declared in this scopesplat.cpp: In function ‘void PlotLRPath(site, site, unsigned char, FILE*)’:splat.cpp:2876: warning: suggest parentheses around + or - inside shift

I've done some more work with the Windows port of SPLAT. It is now version 1.3.1 as of November 14, 2010, incorporating a bugfix with the way antenna azimuth files are read, and using the updated itm.cpp Longley-Rice calculations.

My Windows GUI has also been updated. It can now import antenna patterns from 4NEC2 plots, and has a function to batch convert .hgt files to .sdf. The installer includes all the SPLAT executables for every combination of MAXPAGES in HD and SD. See www.ve3ncq.ca for more details.

Hi Matt. I haven't tried compiling SPLAT with Visual Studio, only MinGW GCC. I think that mkstemp() is a standard function in Linux to create temporary folders and files, but not on Windows. I found a workaround was to make my own mkstemp() function to replace it. Actually, I found the code on the net somewhere where a person posted about porting between Linux and Windows. I'm not really sure what needs to be changed in my mkstemp() function to make Visual Studio happy. You might try doing a search on those error messages and see what pops up.

Sara, I do not have any code available to convert ASCII or GeoTIFF to hgt or Splat files unfortunately. The strm2sdf.exe converter is built to recognize .hgt and BIL format files. I noticed that you can download SRTM data in BIL format from http://earthexplorer.usgs.gov/.

In the left-side panel ("Select your datasets"), click the plus sign next to Digital Elevation and put a check mark in the box marked SRTM. Then use the map on the right-side to find the locations of interest, in your case that is some location in Asia. Once you have the lat/lon coordinates, you can "Search" for that location, and there should be some 1 degree tiles that will be available for download in BIL format. Download as many as you need, and follow the instructions for the srtm2sdf.exe program.

Can you help me understand why Splat is so particular about data? It seems that it only lets me use 3 arc second and 1 arc second data. I have found data out there for 1/3rd arc second. Therefore, I thought I would use this to run in Splat. Therefore, I used some applications to get the 1/3rd data into SDF format. However, repeatedly in the code the largest precision allowed is 3600x3600 which is what you get if you build at 8x8 and use 1 arc second data. Why so specific? Why can't I just use my 1/3rd arc second data (as long as I keep it to 1x1 degree lat/lon)? Is there something I am missing here?

In summary, is it possible for me to use data with better precision than 1 arc second?

THANKS FOR ALL YOUR WORK IN DEVELOPING SPLAT. I HAVE A NEED TO HAVE THE HAAT REPORT LIST ALL 360 RADIALS FROM A SITE RATHER THAN JUST EIGHT. I'M USING THE WIN 32 VERSION AND WONDER IF THERE IS AN EASY WAY TO DO THIS.

is there a way to confirm that topo data is getting SPLAT? i am getting mixed signals: command prompt has comments "Region SDF file name assumed at sea-level..." yet the .. report.txt says "no terrain". also, is the format of the .sdf file available that i might plot the data?thanks

Do you know why SRTM2SDF seems to swap the longitude from East to West? For instance, if I convert N29E59.HGT to an SDF, I get 29x30x300x301.sdf, when I would expect to get something like 29x30x58x59.sdf or 29x30x59x60.sdf (don't know which is correct).

Splat seems to interpret the "flipped" SDF incorrectly as well, since I need to enter in a flipped longitude to get it to use the converted file.

Kindly i'm working in project that i use SPLAT! from commandline and i want to use more anenna patterns rather than the sample antenna (*.az, *.el) so i found a website that provide a huge list of antenna radiation patterns but in (*.Ant) format.

So kindly how to convert the Antenna radiation pattern from (*.ant) to (*.az, *.el) format.