[osg-users] [vpb] Correct way to get texture data from USGS or any other source?

Elias Tarasov elias.tarasov at gmail.com
Thu Jun 11 01:52:48 PDT 2015


Hello!

My statement about the problem, that had been solved, looks a little premature.

The problem: 
Terrain is displayed incorrectly.
Results:
1. https://drive.google.com/file/d/0ByDDImhSolf6cGFyV21PRXZuZHM/view?usp=sharing
2. https://drive.google.com/file/d/0ByDDImhSolf6N3FvRkNJUW1nMlk/view?usp=sharing

Step-by-step actions to make a terrain

0. Gathering required data
	0.1. Choose texture:
	https://drive.google.com/file/d/0ByDDImhSolf6S3E0M1VmR2xDd1U/view?usp=sharing
	0.2. Choose dem:
	https://drive.google.com/file/d/0ByDDImhSolf6cDNtWjlUa3VqdXc/view?usp=sharing
	0.3. Downloaded texture:
	https://drive.google.com/file/d/0ByDDImhSolf6eXRpYlhxMFN3NnM/view?usp=sharing
	0.4. Downloaded dem:
	https://drive.google.com/file/d/0ByDDImhSolf6MXVLUV9kOG1xR2c/view?usp=sharing

1. Straightforward
	vpbmaster --geocentric -d dem/n30_w086_1arc_v3.tif -t texture/44442.tif -o output/out.osgb

	answer:
	--geocentric
	-d dem/n30_w086_1arc_v3.tif
	ADD: dem/n30_w086_1arc_v3.tif
	-t texture/44442.tif
	ADD: texture/44442.tif
	-o output/out.osgb
	Adding terrainTile
	Error: vpbmaster can not run without all source data being in the correct destination coordinates system, please reproject them.
	Recieved signal 15, doing TERMINATE_RUNNING_TASKS_THEN_EXIT.
	Setting up MachinePool to use all 8 cores on this machine.
	MachinePool::signal(15)
	Machine::signal(15)
	Machine::cancelThreads() hostname=, threads=8
		Cancel thread
		Cancel thread
		Cancel thread
		Cancel thread
		Cancel thread
		Cancel thread
		Cancel thread
		Cancel thread
	Completed Machine::cancelThreads() hostname=, threads=8

2. osgdem
	osgdem --geocentric -d dem/n30_w086_1arc_v3.tif -t texture/44442.tif -o output/out.osgb

	answer:
	--geocentric
	-d dem/n30_w086_1arc_v3.tif
	ADD: dem/n30_w086_1arc_v3.tif
	-t texture/44442.tif
	ADD: texture/44442.tif
	-o output/out.osgb
	Adding terrainTile
	DataSet::_run() 0 0
	Now checking for plug-in osgPlugins-3.3.8/osgdb_nvtt.dll
	osg::Registry::addImageProcessor(ImageProcessor)
	Loaded plug-in osgPlugins-3.3.8/osgdb_nvtt.dll and located ImageProcessor
	started DataSet::createDestination(30)
	reprojecting to file temporaryfile_44442.tif
	ERROR 1: No PROJ.4 translation for source SRS, coordinate
	transformation initialization has failed.
	Failed to reproject texture/44442.tif
	Time for after_reproject 0.003934

	And here program crashes.

3. Manual reprojection using gdalwarp
	3.1. gdalinfo for dem file:
			Driver: GTiff/GeoTIFF
			Files: n30_w086_1arc_v3.tif
			Size is 3601, 3601
			Coordinate System is:
			GEOGCS["WGS 84",
					DATUM["WGS_1984",
							SPHEROID["WGS 84",6378137,298.257223563,
									AUTHORITY["EPSG","7030"]],
							AUTHORITY["EPSG","6326"]],
					PRIMEM["Greenwich",0],
					UNIT["degree",0.0174532925199433],
					AUTHORITY["EPSG","4326"]]
			Origin = (-86.000138888888884,31.000138888888891)
			Pixel Size = (0.000277777777778,-0.000277777777778)
			Metadata:
				AREA_OR_POINT=Point
				DTED_CompilationDate=0002
				DTED_DataEdition=02
				DTED_DigitizingSystem=SRTM
				DTED_HorizontalAccuracy=0013
				DTED_HorizontalDatum=WGS84
				DTED_MaintenanceDate=0000
				DTED_MaintenanceDescription=0000
				DTED_MatchMergeDate=0000
				DTED_MatchMergeVersion=A
				DTED_NimaDesignator=DTED2
				DTED_OriginLatitude=0300000N
				DTED_OriginLongitude=0860000W
				DTED_Producer=USCNIMA
				DTED_RelHorizontalAccuracy=NA
				DTED_RelVerticalAccuracy=0004
				DTED_SecurityCode_DSI=U
				DTED_SecurityCode_UHL=U
				DTED_UniqueRef_DSI=H24 084
				DTED_UniqueRef_UHL=H24 084
				DTED_VerticalAccuracy_ACC=0005
				DTED_VerticalAccuracy_UHL=0005
				DTED_VerticalDatum=E96
			Image Structure Metadata:
				INTERLEAVE=BAND
			Corner Coordinates:
			Upper Left  ( -86.0001389,  31.0001389) ( 86d 0' 0.50"W, 31d 0' 0.50"N)
			Lower Left  ( -86.0001389,  29.9998611) ( 86d 0' 0.50"W, 29d59'59.50"N)
			Upper Right ( -84.9998611,  31.0001389) ( 84d59'59.50"W, 31d 0' 0.50"N)
			Lower Right ( -84.9998611,  29.9998611) ( 84d59'59.50"W, 29d59'59.50"N)
			Center      ( -85.5000000,  30.5000000) ( 85d30' 0.00"W, 30d30' 0.00"N)
			Band 1 Block=3601x1 Type=Int16, ColorInterp=Gray
				NoData Value=-32767
				Unit Type: m
				
	3.2. gdalinfo for texture file
			Driver: GTiff/GeoTIFF
			Files: 44442.tif
			Size is 5000, 5000
			Coordinate System is:
			LOCAL_CS["unnamed",
					UNIT["US survey foot",0.3048006096012192,
							AUTHORITY["EPSG","9003"]]]
			Origin = (1655000.330000000100000,559999.510000000010000)
			Pixel Size = (1.000000000000000,-1.000000000000000)
			Metadata:
				AREA_OR_POINT=Area
				TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
				TIFFTAG_XRESOLUTION=1
				TIFFTAG_YRESOLUTION=1
			Image Structure Metadata:
				INTERLEAVE=PIXEL
			Corner Coordinates:
			Upper Left  ( 1655000.330,  559999.510)
			Lower Left  ( 1655000.330,  554999.510)
			Upper Right ( 1660000.330,  559999.510)
			Lower Right ( 1660000.330,  554999.510)
			Center      ( 1657500.330,  557499.510)
			Band 1 Block=5000x1 Type=Byte, ColorInterp=Red
				Overviews: 1024x1024
			Band 2 Block=5000x1 Type=Byte, ColorInterp=Green
				Overviews: 1024x1024
			Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue
				Overviews: 1024x1024
	
	3.3. Conclusion: 
	We need to reproject texture file to match dem file
	
	3.4. Reprojection
	Since I was pointed that t_srs for texture file is EPSG:2238 and WGS_1984 is EPSG:4326 (at least what i was able to find), then:
	c:\Terrain\FromUSGS\texture>gdalwarp -s_srs EPSG:2238 -t_srs EPSG:4326 44442.tif 44442_conv.tif
	Creating output file that is 5386P x 4662L.
	Processing input file 44442.tif.
	0...10...20...30...40...50...60...70...80...90...100 - done.
	
	3.5. gdalinfo for reprojected texture file
			Driver: GTiff/GeoTIFF
			Files: 44442_conv.tif
			Size is 5386, 4662
			Coordinate System is:
			GEOGCS["WGS 84",
					DATUM["WGS_1984",
							SPHEROID["WGS 84",6378137,298.257223563,
									AUTHORITY["EPSG","7030"]],
							AUTHORITY["EPSG","6326"]],
					PRIMEM["Greenwich",0],
					UNIT["degree",0.0174532925199433],
					AUTHORITY["EPSG","4326"]]
			Origin = (-85.495785570955590,30.536183332655433)
			Pixel Size = (0.000002974135230,-0.000002974135230)
			Metadata:
				AREA_OR_POINT=Area
				TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
				TIFFTAG_XRESOLUTION=1
				TIFFTAG_YRESOLUTION=1
			Image Structure Metadata:
				INTERLEAVE=PIXEL
			Corner Coordinates:
			Upper Left  ( -85.4957856,  30.5361833) ( 85d29'44.83"W, 30d32'10.26"N)
			Lower Left  ( -85.4957856,  30.5223179) ( 85d29'44.83"W, 30d31'20.34"N)
			Upper Right ( -85.4797669,  30.5361833) ( 85d28'47.16"W, 30d32'10.26"N)
			Lower Right ( -85.4797669,  30.5223179) ( 85d28'47.16"W, 30d31'20.34"N)
			Center      ( -85.4877762,  30.5292506) ( 85d29'15.99"W, 30d31'45.30"N)
			Band 1 Block=5386x1 Type=Byte, ColorInterp=Red
			Band 2 Block=5386x1 Type=Byte, ColorInterp=Green
			Band 3 Block=5386x1 Type=Byte, ColorInterp=Blue
			
	3.6. Conclusion: 
	Seems like both files are now in the same projection?
	
4. Try to use vpbmaster again with the converted texture file:        vpbmaster --geocentric -t texture/44442_conv.tif -d dem/n30_w086_1arc_v3.tif -o output/out.osgb

	Now vpb seems work but the result is:
	https://drive.google.com/file/d/0ByDDImhSolf6cGFyV21PRXZuZHM/view?usp=sharing
	https://drive.google.com/file/d/0ByDDImhSolf6N3FvRkNJUW1nMlk/view?usp=sharing
	Conclusion: 
	vpbmaster did not make texture "elevated" and too much area of elevation compared to small area of texture caused artefacts.
	Need to crop elevation here? 
	If yes, what tool is the most user friendly for a newbie?
	
5. Try to use osgdem again - result is the same as №4.

Again, what am i doing wrong?

Thank you!

Cheers,
Elias

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64048#64048








More information about the osg-users mailing list