Panda3D for GIS?

Hello!
I’m new to both Python and Panda3D and I was wondering if anyone has experience using Panda for GIS applications? I’d like to create a 3D scene using a digital elevation model and possibly a satellite image but I’m not sure where to start. I’m under the impression the TIFF and TIN files I’ll be using are compatible with Panda.
Any help you can offer would be greatly appreciated.
Thank you!

I haven’t used GIS in panda3d directly, however panda comes with two different terrain systems (heightmap and geomipterrain) which uses greyscale images for heightmaps for elevation data. If you are a bit more specific with what you are trying to achieve we can be more helpful.

Thank you for your reply.
I’d like to create a 3d representation of a digital elevation model, basically digitally recreating the elevations expressed in the DEM. DEMs are grayscale images showing higher elevations as lighter, so I imagine they’ll be suitable. Rather than having to create the contours of the terrain like you folks do for games, they are provided in the image.
I’m not sure if that clears up my goal. I just need a 3d surface but I want to make it from a digital elevation model of an actual geographic location. If I can get that to work, at some point I would like to overlay a satellite image of the same area to make the surface look more natural.
Here is an example DEM: http://gsp.humboldt.edu/cwis438/Websites/HDH/DataSources/DataSet_Info.php?DataSetID=293&CallingPage=%2Fcwis438%2FWebSites%2FHDH%2FDataSources%2FDataSet_List.php%3FSearchString%3Ddem%26AdvancedSearch%3D0%26CurrentRow%3D0%26OrderByField%3DTitle%26DescendingFlag%3D0%26Title%3D%26Recommended%3D0%26StandardWindowFlag%3D1%26WebsiteID%3D1%26AreaID%3D&CallingLabel=Back%20To%20Data%20Sets
This one is really huge and I’ll clip it down considerably (maybe a 2km square). I can also convert the raster into a TIN fairly easily.

I’ve used dem data before to make sc4 and cities skylines height map. Do you want panda to read the dem files directly?

That would be great if possible.
This project sounds simple enough, but I’m a in a bit over my head with the panda libraries, I’ve only taken one semester in Python and it was aimed at working with GIS software.

I assume you are more familiar using python for GIS and convert DEM to greyscale rastery images (maybe a combo of numpy and pillow if you can;t find a library).

Here is the manual link to use geomip terrain: panda3d.org/manual/index.php … MipMapping

I’ve converted the dem to a heightmap but now I get a :grutil(error): No valid heightfield image has been set!
Am I supposed to point the terrain.setHeightfield() to the path of the heightfield or is there a folder structure I’m supposed to be using so the heightfield can be located by the function?
This is what I have at the moment:

from panda3d.core import GeoMipTerrain

# Set up the GeoMipTerrain
terrain = GeoMipTerrain("genTerrain")
terrain.setHeightfield("mt-tarawera-15m-dem.png")
terrain.setBlockSize(64)
terrain.setBruteforce(1) 
# Store the root NodePath for convenience
root = terrain.getRoot()
root.reparentTo(render)
root.setScale(4)
root.setSz(200)
terrain.generate()

What are the other error messages you are getting? Perhaps it’s not a power-of-two-plus-one in either dimension? (129, 513, 1025, 2049…)

“:grutil(error): Failed to load heightfield image mt-tarawera-15m-dem.png!”
“:grutil(error): No valid heightfield image has been set!”

This is the complete error. I believe the image is 513*513. I changed setBlocksize value to 513 as well, but am getting the same error.
I apologize if this thread is silly, I’m used to kindergarten code that has comments on basically every line so I’m having trouble deciphering what all these lines do.
If it means anything, I’m using Wing IDE and saving all of my .png and scripts into the same folder within the samples folder provided by Panda, which, as of right now, is one .png and one script.

It can’t find the image. You could try using an absolute path (on Windows, use a unix-style path like “/c/path/to/something.png”) which would prove it’s simply trying to load it from the wrong directory.