It is currently Thu, 15-11-18, 12:41 GMT

All times are UTC




Post new topic Reply to topic  [ 101 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
 Post subject:
PostPosted: Tue, 13-05-08, 17:54 GMT 
Offline
User avatar

Joined: Thu, 25-10-07, 15:20 GMT
Posts: 992
Location: NE PA, USA
Quote:
I was checking out this page.
http://www.ngdc.noaa.gov/dmsp/download_ ... 94-95.html
I downloaded the Stable Lights which is about 12 MB and it has a nice map 43200x21600 in geotif format. I used gdal to translate it to png. Fridgers FTex-Tools should be able to VT it like the BMNG textures. Just run png2bin, tx2pow2, tx2half, txtiles, etc.
New page. Added some context.

To translate the image from geotif to png or other supported format, users may need gdal installed. I've always built my installation of gdal from source or svn. There are binaries available here for those that don't compile their own.
http://fwtools.maptools.org/
cartrite[/quote]


Last edited by cartrite on Tue, 13-05-08, 17:59 GMT, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue, 13-05-08, 17:57 GMT 
Offline
User avatar

Joined: Sat, 13-10-07, 18:18 GMT
Posts: 373
cartrite wrote:
To translate the image from geotif to png or other supported format, users may need gdal installed. I've always built my installation of gdal from source or svn. There are binaries available here for those that don't compile their own.
http://fwtools.maptools.org/
cartrite


Have already been there and gotten the base package for Windows, but thanks again. :wink:

See?
I'm not really as stupid as most people think I am. :D


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 13-05-08, 21:52 GMT 
Offline
User avatar

Joined: Sat, 13-10-07, 18:18 GMT
Posts: 373
I take it back...
Maybe I AM as stupid as people seem to think. :roll:

I figured out how to unzip the original tar ball file I got from the site Steve mentioned, and then I managed to use GZIP to get to the tif file I was interested in.

That's the good news...

I have also managed to convert the original .tif file to a .png file, but I really have absolutely NO idea how it got done. After spending hours looking for some documentation which would explain how one USES the GDAL command line utilities, I simply gave up and started playing with it. Either I installed the tools correctly and they can now be used via my Windows Explorer, or I have some other utility which allows me to convert the tif files via a right-click and then selection of "Convert Into..." which I finally did use to create a PNG file with the following dimensions:

world_stable_lights.png
43200 x 21600 pixels, 8-bits depth
8.86 MB

I don't mean to complain here, but these command line utilities are very difficult to understand without proper documentation. Believe me, I searched the web for hours trying to find a page which explains the exact typing and format of the GDAL utilities for us Brain-Dead types, and I simply could NOT find anything which explained the parameters which must be typed into the command line, along with the appropriate program commands in order to get anything done.

Now, I find myself in the same boat as far as the PNG2BIN and other command-line utilities are concerned. What's up with you Genius-Scientist-Types?

Are we supposed to infer how the tools are to be used because we have superior intellects?

Sorry...
Just venting my frustration again. I'm getting there, but it really could be a LOT easier with some proper documentation.

Now, someone will probably show me a page with the documentation I'm looking for here, but, believe me, I HAVE looked. I'll shut up for a while now... :oops:

EDIT: Found usage in Fridger's column. THANK YOU Good Doctor. Will update when I really understand what I'm doing here.


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 13-05-08, 22:22 GMT 
Offline
User avatar

Joined: Thu, 25-10-07, 15:20 GMT
Posts: 992
Location: NE PA, USA
Here are the "modified for windows" commands I ran with linux to create a night light VT. They should work with windows. I got them from my bash history and did make some mistakes but hopefully I weeded the mistakes all out and changed everything I needed to change to get them to run on Windows.
Code:
gdal_translate -of png world_stable_lights.tif nightlights.png
png2bin < nightlights.png > nightlights.bin
tx2pow2 1 43200 < nightlights.bin > level4\32k-nightlights.bin
tx2half 1 32768 < level4\32k-nightlights.bin > level3\16k-nightlights.bin
tx2half 1 16384 < level3\16k-nightlights.bin > level2\8k-nightlights.bin
tx2half 1 8192 < level2\8k-nightlights.bin > level1\4k-nightlights.bin
tx2half 1 4096 < level1\4k-nightlights.bin > level0\2k-nightlights.bin
cd level4
txtiles 1 32768 4 < 32k-nightlights.bin
cd ..\level3
txtiles 1 16384 3 < 16k-nightlights.bin
cd ..\level2
txtiles 1 8192 2 < 8k-nightlights.bin
cd ..\level1
txtiles 1 4096 1 < 4k-nightlights.bin
cd ..\level0
txtiles 1 2048 0 < 2k-nightlights.bin

cartrite


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 13-05-08, 22:34 GMT 
Offline
User avatar

Joined: Sat, 13-10-07, 18:18 GMT
Posts: 373
cartrite wrote:
Here are the "modified for windows" commands I ran with linux to create a night light VT. They should work with windows. I got them from my bash history and did make some mistakes but hopefully I weeded the mistakes all out and changed everything I needed to change to get them to run on Windows.
cartrite


I very much appreciate that, Steve. Thank you once again. :wink:

What I want to know though, is WHERE did you find the knowledge you needed in order to learn the order of the commands (along with their respective options) on the web?

I certainly looked for this stuff... :roll:


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 13-05-08, 22:39 GMT 
Offline
User avatar

Joined: Thu, 25-10-07, 15:20 GMT
Posts: 992
Location: NE PA, USA
Here is what I get by running the gdal_translate command with no parameters.
Code:
gdal_translate
Usage: gdal_translate [--help-general]
       [-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
             CInt16/CInt32/CFloat32/CFloat64}] [-strict]
       [-of format] [-b band] [-outsize xsize[%] ysize[%]]
       [-scale [src_min src_max [dst_min dst_max]]]
       [-srcwin xoff yoff xsize ysize] [-projwin ulx uly lrx lry]
       [-a_srs srs_def] [-a_ullr ulx uly lrx lry] [-a_nodata value]
       [-gcp pixel line easting northing [elevation]]*
       [-mo "META-TAG=VALUE"]* [-quiet] [-sds]
       [-co "NAME=VALUE"]*
       src_dataset dst_dataset

GDAL 1.5.1, released 2008/03/14

The following format drivers are configured and support output:
  VRT: Virtual Raster
  GTiff: GeoTIFF
  NITF: National Imagery Transmission Format
  HFA: Erdas Imagine Images (.img)
  ELAS: ELAS
  AAIGrid: Arc/Info ASCII Grid
  DTED: DTED Elevation Raster
  PNG: Portable Network Graphics
  JPEG: JPEG JFIF
  MEM: In Memory Raster
  GIF: Graphics Interchange Format (.gif)
  XPM: X11 PixMap Format
  BMP: MS Windows Device Independent Bitmap
  PCIDSK: PCIDSK Database File
  PCRaster: PCRaster Raster File
  ILWIS: ILWIS Raster Map
  SRTMHGT: SRTMHGT File Format
  Leveller: Leveller heightfield
  Terragen: Terragen heightfield
  PNM: Portable Pixmap Format (netpbm)
  ENVI: ENVI .hdr Labelled
  EHdr: ESRI .hdr Labelled
  PAux: PCI .aux Labelled
  MFF: Vexcel MFF Raster
  MFF2: Vexcel MFF2 (HKV) Raster
  BT: VTP .bt (Binary Terrain) 1.3 Format
  IDA: Image Data and Analysis
  ERS: ERMapper .ers Labelled
  JPEG2000: JPEG-2000 part 1 (ISO/IEC 15444-1)
  FIT: FIT Image
  RMF: Raster Matrix Format
  RST: Idrisi Raster A.1
  INGR: Intergraph Raster
  GSAG: Golden Software ASCII Grid (.grd)
  GSBG: Golden Software Binary Grid (.grd)
  USGSDEM: USGS Optional ASCII DEM (and CDED)
  ADRG: ARC Digitized Raster Graphics

It shows what options are available and some of the formats that can be used. I used
Code:
gdal_translate -of png world_stable_lights.tif nightlights.png

The only option I used was -of for output format and the format was png.
Then I entered the src_dataset and dst_dataset. That is source dataset and destination dataset. GDAL does have some hard to understand documentation.
cartrite


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 13-05-08, 22:42 GMT 
Offline
User avatar

Joined: Sat, 13-10-07, 18:18 GMT
Posts: 373
Very interesting...

When I did that on my Vista System, I did NOT get the same output the first time around. After I re-booted my system, I did get the output you show.

Thanks, still learning here. Brain-Dead Bob

_________________
Brain-Dead Geezer Bob
Windows 8.1 Home Premium
AMD A8-5500 APU with Radeon HD Graphics
8.00 GB RAM, 64-bit Operating System
HP Hardware


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 13-05-08, 22:47 GMT 
Offline
User avatar

Joined: Thu, 25-10-07, 15:20 GMT
Posts: 992
Location: NE PA, USA
BobHegwood wrote:
cartrite wrote:
Here are the "modified for windows" commands I ran with linux to create a night light VT. They should work with windows. I got them from my bash history and did make some mistakes but hopefully I weeded the mistakes all out and changed everything I needed to change to get them to run on Windows.
cartrite


I very much appreciate that, Steve. Thank you once again. :wink:

What I want to know though, is WHERE did you find the knowledge you needed in order to learn the order of the commands (along with their respective options) on the web?

I certainly looked for this stuff... :roll:

For commands with FTexTools, I got my start from Fridger's tutorial. Experience fills in the rest. For GDAL I learned some from here.
http://www.gdal.org/gdal_utilities.html
I also subscribe to the developers list and scan what others are experiencing while trying to accomplish different tasks.
http://lists.osgeo.org/pipermail/gdal-dev/
PS Every command line tool worth it's salt has some sort of help menu that is accessed by typing the command followed by -h or --h or -help or --help or some other means. This is usually the standard.
cartrite


Top
 Profile  
 
 Post subject:
PostPosted: Wed, 14-05-08, 0:15 GMT 
Offline
User avatar

Joined: Sat, 13-10-07, 18:18 GMT
Posts: 373
Again, I appreciate the help here, my friend. Why you continue to put up with ME is beyond understanding. :wink:

I created a bat file from your commands above, and it works flawlessly. I then added the following to my
own version of the BlueMarble.ssc file:
Code:
AltSurface "BlueMarble" "Sol/Earth"
{
   Color            [ 0.85 0.85 1.0 ]
   Texture          "BlueMarble.ctx"
   NormalMap        "EarthNormal.ctx"
   NightTexture     "EarthNight.ctx"
   SpecularPower    15.0
   SpecularColor    [ 0.5 0.5 0.55 ]
}


and I created my own EarthNight.ctx file which I located inside my own particular Celestia\extras\EarthHires directory for these Blue Marble files:

Code:
VirtualTexture
{
   ImageDirectory      "EarthNight"
   BaseSplit            0
   TileSize            1024
   TileType            "png"
}


Again, MANY thanks here to ALL of you brilliant types, but especially to Steve, aka Cartrite for all of his help.
Your patience and understanding here is VERY much appreciated my friend...

If ever I can buy you a Brewsky, or if ever I can do anything else for you, please just lemme know. :lol:

One other note for the Brain-Dead here...

After I installed the GDAL package, it inserted the right-click dialogs I was referring to my earlier post. Apparently, I no longer need the command-line in order to convert a tif file. I simply use my Windows Explorer in order to view the file, and then right-click on the tif file in order to convert it with a click.

Just FYI...

Thanks one last time and good bye for now. I am worn the Hell out now... 8)


Top
 Profile  
 
 Post subject:
PostPosted: Wed, 14-05-08, 0:38 GMT 
Offline
User avatar

Joined: Thu, 25-10-07, 15:20 GMT
Posts: 992
Location: NE PA, USA
BobHegwood wrote:
After I installed the GDAL package, it inserted the right-click dialogs I was referring to my earlier post. Apparently, I no longer need the command-line in order to convert a tif file. I simply use my Windows Explorer in order to view the file, and then right-click on the tif file in order to convert it with a click.

Just FYI...

Thanks one last time and good bye for now. I am worn the Hell out now... 8)

Your very Welcome Bob. :D
I never installed the fwtools because I've always built the command line tools and I almost always use Linux to do most of my work. I heard they were simple to use but I never realized how simple though. Maybe I'll install these on my Windows system just in case. Good info to know. :D
cartrite


Top
 Profile  
 
 Post subject:
PostPosted: Wed, 14-05-08, 4:49 GMT 
Offline
User avatar

Joined: Sat, 13-10-07, 18:18 GMT
Posts: 373
One more quick piece of information here...

The Night Textures work very well, but they look like crap. The brightness/contrast and image quality need to be improved if the Night maps are to be used in conjunction with the rest of the BMNG textures. I have managed to convert about half of my new night map textures into a much more pleasing (to me) appearance. This is taking me a while because I'm having to adjust each and every tile by hand, but I think the end result will be worth it. Will give you a before/after image or two when I get it finished.

Thanks again, all, and finally Good Night... ZZZzzzzz... :|


Top
 Profile  
 
 Post subject:
PostPosted: Wed, 14-05-08, 8:13 GMT 
Offline
User avatar

Joined: Thu, 25-10-07, 15:20 GMT
Posts: 992
Location: NE PA, USA
BobHegwood wrote:
One more quick piece of information here...

The Night Textures work very well, but they look like crap. The brightness/contrast and image quality need to be improved if the Night maps are to be used in conjunction with the rest of the BMNG textures. I have managed to convert about half of my new night map textures into a much more pleasing (to me) appearance. This is taking me a while because I'm having to adjust each and every tile by hand, but I think the end result will be worth it. Will give you a before/after image or two when I get it finished.

Thanks again, all, and finally Good Night... ZZZzzzzz... :|

Bob,
If you are changing the brightness/contrast, I would change it on the original full resolution png file and then tile/run them again. Also there are other maps there. The Radiance Calibrated Lights: 1996-1997 or Version 2 DMSP-OLS Nighttime Lights Time Series may be worth looking into. The latter is a larger download of 300+ mb. The data is from 2003. It only covers 65 to -65 latitude though. The program gdalmerge or something similar can probably be used to add it to one of the full nightlight maps. A good image editor like the gimp can also be used.
PS After checking out 3 of them, my personal preference is the Radiance Calibrated Lights found on this page.
http://www.ngdc.noaa.gov/dmsp/download_ ... 96-97.html
This seems to be the best quality. It has varying degrees of brightness in the lit up areas. The other data seems to be mono tone in the lit up areas.

Radiance Calibrated Lights from http://www.ngdc.noaa.gov/dmsp/download_ ... 96-97.html

Image

http://img48.imageshack.us/img48/5207/n ... htsvu0.jpg


Stable Lights from http://www.ngdc.noaa.gov/dmsp/download_ ... 94-95.html

Image

http://img111.imageshack.us/img111/6541 ... ts2mc4.jpg

cartrite


Top
 Profile  
 
 Post subject:
PostPosted: Wed, 14-05-08, 21:37 GMT 
Offline
User avatar

Joined: Sat, 13-10-07, 18:18 GMT
Posts: 373
Have added my own screen shots to your new topic HERE.

Doctor Schrempp?

You MAY wish to point all newbies and other Brain-Dead Users to this entire topic when they ask how to get your tools (and the NASA images) to work now. :wink:

Seems as if I have uncovered damn-near EVERY wrong thing you can do in order to screw up their use, so this topic may be worth something for others.

Thanks for allowing me the space to vent here. Much appreciated. :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Wed, 14-05-08, 22:57 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4585
Location: Hamburg, Germany
See my comment over there... ;-)

Fridger

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu, 15-05-08, 12:57 GMT 
Offline
User avatar

Joined: Sat, 13-10-07, 18:18 GMT
Posts: 373
I have but one more Brain-Dead question for you geniuses here. :wink:

Is there a way to correct the Gamma of the tiles using GDAL (or some other) command-line utility? I have managed to convert Andrea's beautiful new Night Light tif images into PNG tiles, but I will now have to do the same thing that I did for each and every one of the resulting tiles I got in the exercises above unless there is a way to do this via a command-line utility...

In other words, I had to use a Windows program (IrfanView) to adjust the gamma values of ALL of the resulting tiles (each and every one by hand) in order to use them properly on my system, and I really do NOT wish to do this again.

Again, is there some way to adjust Gamma Offsets using one of these utilities? Have looked at the help layouts for most of the GDAL commands, but didn't see anything which would work here.

Any other suggestions?

Thanks again, Brain-Dead

EDIT: Hah... Never mind. I found out how to do this with IrfanView's very own batch converter.
Thanks. Great stuff, this command line feature. :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 101 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group