Archive for the ‘Geospatial’ Category

Black terrain after conversion to .vsb

Saturday, May 1st, 2010

Terrain in Vega PrimeAfter my last big visual database delivery on a tight deadline, I thought I had Terra Vista terrain generation mastered:  simply convert the OpenFlight to .vsb and make sure to specify the path to your vt_sub.rgb texture.

Then this time around, my texture came out black.  What now?  Turns out I had gotten used to using the -ct flag for the to_vsb.exe command when converting my culture layers.  -ct compresses the texture maps to .dds format.  Make sure to leave that off when converting the terrain layer that is textured with a virtual texture!

White terrain after conversion to .vsb

Saturday, May 1st, 2010

Terrain in Vega PrimeUsing Terra Vista I generated a large terrain surface covered with a large Virtual Texture.  It looked fine when I loaded the OpenFlight version of it into Vega Prime.  But when I converted it to .vsb format, the terrain came up white.

Dan Oller from Presagis explained why.  The vsb converter (to_vsb.exe)  is creating an optimized file for fast runtime loading, so it doesn’t want to include anything that does not exist.  So if it does not find a texture map, it will not include it.  The terrain that is to be covered with the Virtual Texture has a placeholder texture on it called vt_sub.rgb.  A copy of that texture needs to be somewhere where the vsb converter can find it when it converts your OpenFlight files.  You can specify a search path for the vsb converter.  In the GUI, under Options -> VSB Options…, add folders to the Search Path Options list.  On the command line, use the -p option followed by one or more pathnames to search, separated by semicolons.  On the command line, remember to use quotes if your pathnames contain spaces.

Terra Vista kills to_vsb.exe

Friday, April 30th, 2010

I have a Terra Vista project big enough that it takes about 6 hours to convert all the OpenFlight that gets generated to the fast-loading .vsb format.  I use the command line version of the to_vsb.exe tool because there are too many files for the GUI version to handle (because it tries to put them all into its scrolling list boxes).

I was nearing my delivery deadline, so I was doing some Terra Vista processing, and converting some .flt data that had already been generated.  I was waiting and waiting for to_vsb to finish.  Finally I decided to check the processes in the Task Manager.  to_vsb had disappeared!  I finally figured out Terra Vista was killing it, but why!?

Presagis Support had an explanation:  Terra Vista invokes to_vsb to convert its output.  When it is done using to_vsb, it kills all the to_vsb processes.  Not an elegant bit of programming, that.  Anyway, mystery solved.

Presagis suggests that if you want to run to_vsb and Terra Vista concurrently, you should make a copy of to_vsb.exe and rename it so TV won’t kill it.

Convert CSV to Shapefile in ArcView 9.3

Thursday, March 18th, 2010

This is so I don’t forget, since I’m an infrequent ArcView user.  I had a CSV file (text file with comma-separated values) that I wanted to convert to a point Shapefile.

Before I tried ArcView (because it is complicated) I tried a free tool called CSV to Shapefile Converter 2.0.  See below for more on that.

The ArcGIS docs tell you it can be done, but then describe how to import a text file with just 2 columns of data for X and Y point values.  You could do some shenanigans with OIDs and creating a separate table with the attribute fields, then joining them somehow.

Turns out there is an easy way to load the coordinates and the attributes all in one shot.  (I’m using ArcGIS Desktop 9.3.1.)

My input data looks like this:

x, y, z, name, tmapname, tmapsize, rlevel
40.778975, -111.899080, 1296.846000, slca_0434, R0_region_019, 2948400, 0
40.778956, -111.898698, 1297.241000, slca_0435, R0_region_019, 2948400, 0
40.778969, -111.898482, 1297.195000, slca_0436, R0_region_019, 2948400, 0
40.778753, -111.898620, 1297.972000, slca_0437, R0_region_019, 2948400, 0
40.777677, -111.898004, 1300.5800 ...

In ArcCatalog, navigate to your file, right mouse on it and select Create Feature Class -> From XY Table…