PDA

View Full Version : Digital Elevation Model data importer



uaraus
15-Feb-05, 07:35
Hey mom, look, another newbie ....

Hi everybody.
First post here, so please be patient
I'm tweaking around with blender and python in my too-little-spare-time and, as a beginner project, with another guy I wrote a Digital Elevation Model data importer for Blender (SRTM earth elevation).
Hoping this could be useful, we would like to share our result.
The first usable version (with doc) could be downloaded from the page
http://uaraus.altervista.org/index.php?filename=en/content/categories/Blender/DEM_importer.html
The page, well the whole site, was built in a hurry: if the script could be of some interest I could enrich it and upload some nice sceenshot.

Critics and comments welcome
Let me know
Bye

S68
15-Feb-05, 08:42
Looks interesting :=)

Stefano

Enzoblue
15-Feb-05, 11:27
Seems interesting indeed. Where can you get SRMT data? I looked at GTOPO and you have to pay dearly for it.

uaraus
15-Feb-05, 17:26
Home page for SRTM data is:
http://www2.jpl.nasa.gov/srtm/

data sets could be freely downloaded by anonymous ftp from:
ftp://e0mss21u.ecs.nasa.gov/srtm/

I suppose they are free because they are 'raw': they are not processed with other sources to recover from (eventual) missing data.

Fortunately the DEM importer script could make a filtering these missing data ;) (reducing the overall resolution) ;)

celeriac
15-Feb-05, 22:35
Wow! That's a great script! Cheers.

celeriac
15-Feb-05, 23:13
One thing, I tried it on a partial set of .hgt files for Australia and found that I had to change the line


fName += "S%2d" % (lat)

to

fName += "S%2d" % (-lat)

because the filenames for south-of-the-equator don't have a negative latitude.

Also, is it possble to make it use a partial dataset, or do you need all the files ?

Enzoblue
16-Feb-05, 00:22
Yeah, like if I d/l'ed N47W068.hgt, how would I get any part of that to show up?

uaraus
16-Feb-05, 19:04
@celeriac
ooops .... :-|
thanks for the feedback.
fixed it, and tested with the west australian coast.
cannot upload it now, i will do tomorrow.



Also, is it possble to make it use a partial dataset, or do you need all the files ?
well, the hgt files must be integer (cannot subdivide one file in smaller chunks); if you need to import only a subset of a file, you can specify a Lat & Lon interval "inside" a file, and the script will take only the relevant part.

@Enzoblue
Same bug as for celeriac, fixed.
d/l'ed and imported N47W068.hgt ok, but the landscape itself is almost flat.

Stay tuned .... ;)
Bye

celeriac
16-Feb-05, 20:32
Cheers.

By 'partial' I meant a subset of the files (not a subset of a file) - say I'd only downloaded a few of them in a given solid angle because I'm on a dial-up connection. It looks as though the loop assumes that all files corresponding to lat/long numbers given are present. Could it be changed so that it completes as much as it can ?

hopperrr
17-Feb-05, 10:36
Yeah, like if I d/l'ed N47W068.hgt, how would I get any part of that to show up?

Enzoblue - You can get a more complete dataset if you pull the same area as a GeoTIFF which can be found here ftp://ftp.glcf.umiacs.umd.edu/glcf/SRTM/Degree_Tiles/n047/SRTM_u01_n047w068/SRTM_u01_n047w068.tif.gz
This can then be converted over to an Ascii DEM either by using a command line program called "gdal_convert.exe" or by using a freeware program called 3DEM.

Here is some info on the "hgt" files -
">From the Documentation directory:
ftp://e0dps01u.ecs.nasa.gov/srtm/Documentation/QuickStart.txt

"Height files have the extension .HGT and are signed two byte integers.
The bytes are in Motorola "big-endian" order with the most significant byte
first, directly readable by systems such as Sun SPARC, Silicon Graphics and
Macintosh. DEC Alpha and most PCs use Intel ("little-endian") order so some byte-swapping may be necessary. Heights are in meters referenced to the WGS84 geoid. Data voids are assigned the value -32768."

You end up with a mesh like this in Blender
http://gallery.mudpuddle.co.nz/albums/hopper/n47w068.jpg

uaraus
17-Feb-05, 16:02
Ok, fixed and uploaded the 0.0.4 version.
Uploaded even a couple of screenshots in the gallery (more to come)

@celeriac
now I see (after 1:00am my brain get out of sync)
yes, by now the loops tries to read all the files associated with a solid angle
if not found it gives all the area corrisponding to the missing files a zero height.
Cannot implement all at once :D

Hope this helps

celeriac
17-Feb-05, 18:17
It works beautifully - cheers!

Enzoblue
18-Feb-05, 11:15
Works awesome now. Small FYI, I found a really nice map thing to find the lat and longs of places, it's really cool. Take a look here. (http://brainoff.com/worldkit/geocoder/)

hopperrr
18-Feb-05, 11:43
Small FYI, I found a really nice map thing to find the lat and longs of places, it's really cool. Take a look here. (http://brainoff.com/worldkit/geocoder/)

Another one I like to use is http://mappoint.msn.com. Once you request the address, look in th URL and the lat and long are part of the URL.

3DUser
26-May-06, 14:54
I just found this earlier set of posts and hope it isn't too late to ask for additional capability.
I read the pdf manual quickly and saw the example displayed in this post.
It isn't immediately apparent that placing the cursor on the screen displays latitude (lat) and longitude (long) coordinates like many geographic information systems (GIS) viewers. I know that Blender is not a GIS viewer. Would it be possible to modify your script to display the lat and long coordinates in decimal form or some other useful form for wherever the cursor is placed on the mesh? You've done good work, and I hope that this extra capability is easily added.
Regards.