Comments (22)
Hello,
my answers:
- It's an identified "issue". A terrain provider must implements a
function named getTileDataAvailable which returns a boolean indicating
if a tile is available. With this function Cesium draws only the
availables tiles beginning by the biggest tiles to end with smallest
tile (if nexessary). Also there is two solutions:
a) change the code of the plug in order to always return true!
b) add some tiles of the other hemisphere as resource! - & 3. Could you send me a gdalinformation of a tiff used as resource?
I fear your geotiff wasn't generated with the good format (integer 16)
On 24/03/2015 08:24, bik20 wrote:
I have to render a terrain tile of particular area on the cesium
globe. For that, I have used srtm data in geotiff format and used gdal
utility 'gdal_retilepy' to create tiles and then added in Geoserver
through imagepyramid plugin. I have inserted mySLD.xml (styled geotiff
format), as mentioned in readme.md. I am using bing map as base layer.
I am getting following issues with the plugin -
- On rendering I am getting only half of the globe ( the half where
my tile lies).- All lat lon informations are wrong. I am getting random values.
- Elevation values are negative and too small (eg. -2.045453453e-9)
β
Reply to this email directly or view it on GitHub
#7.
from cesium-geoserverterrainprovider.
Here is the gdalinformation for srtm_52_10.tif (which was used as resource to create tiles through gdal_retile.py) -
C:> gdalinfo srtm_52_10.tif
Driver: GTiff/GeoTIFF
Files: srtm_52_10.tif
srtm_52_10.tfw
Size is 6001, 6001
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 = (74.999583696539048,15.000416884586059)
Pixel Size = (0.000833333333333,-0.000833333333333)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 74.9995837, 15.0004169) ( 74d59'58.50"E, 15d 0' 1.50"N)
Lower Left ( 74.9995837, 9.9995836) ( 74d59'58.50"E, 9d59'58.50"N)
Upper Right ( 80.0004170, 15.0004169) ( 80d 0' 1.50"E, 15d 0' 1.50"N)
Lower Right ( 80.0004170, 9.9995836) ( 80d 0' 1.50"E, 9d59'58.50"N)
Center ( 77.5000004, 12.5000002) ( 77d30' 0.00"E, 12d30' 0.00"N)
Band 1 Block=6001x1 Type=Int16, ColorInterp=Gray
NoData Value=-32768
/* END*/
Should this tiff file be in integer16 or in some other format for proper results ?
For issue 1, I'll try to resolve by using for suggested solutions.
Thanks !
from cesium-geoserverterrainprovider.
Ok for the original resource but could you give me the result of the command for the generated tif with gdal_retile (one file is suffisant)
from cesium-geoserverterrainprovider.
This is the gdalinfo -
C:>gdalinfo srtm_52_10_1_1.tif
Driver: GTiff/GeoTIFF
Files: srtm_52_10_1_1.tif
srtm_52_10_1_1.tif.ovr
srtm_52_10_1_1.tif.aux.xml
Size is 2048, 2048
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 = (74.999583999999999,15.000417000000001)
Pixel Size = (0.000833333333333,-0.000833333333333)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 74.9995840, 15.0004170) ( 74d59'58.50"E, 15d 0' 1.50"N)
Lower Left ( 74.9995840, 13.2937503) ( 74d59'58.50"E, 13d17'37.50"N)
Upper Right ( 76.7062507, 15.0004170) ( 76d42'22.50"E, 15d 0' 1.50"N)
Lower Right ( 76.7062507, 13.2937503) ( 76d42'22.50"E, 13d17'37.50"N)
Center ( 75.8529173, 14.1470837) ( 75d51'10.50"E, 14d 8'49.50"N)
Band 1 Block=256x256 Type=Int16, ColorInterp=Gray
Overviews: 1024x1024, 512x512, 256x256, 128x128
/* END */
Is there any problem with corner coordinates ? In other tiles' gdalinfo what I checked over internet, I observed that the corner coordinates were from 0.0-90.0, 0.0-0.0, 90.0-90.0,90.0-0.0,45.0-45.0, for first tile.
from cesium-geoserverterrainprovider.
No for the corner it's OK,
I don't find any issue. Could you use the translate tools in order to
convert your resource?
On 24/03/2015 12:16, bik20 wrote:
This is the gdalinfo -
C:>gdalinfo srtm_52_10_1_1.tifDriver: GTiff/GeoTIFF
Files: srtm_52_10_1_1.tif
srtm_52_10_1_1.tif.ovr
srtm_52_10_1_1.tif.aux.xml
Size is 2048, 2048
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 = (74.999583999999999,15.000417000000001)
Pixel Size = (0.000833333333333,-0.000833333333333)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 74.9995840, 15.0004170) ( 74d59'58.50"E, 15d 0' 1.50"N)
Lower Left ( 74.9995840, 13.2937503) ( 74d59'58.50"E, 13d17'37.50"N)
Upper Right ( 76.7062507, 15.0004170) ( 76d42'22.50"E, 15d 0' 1.50"N)
Lower Right ( 76.7062507, 13.2937503) ( 76d42'22.50"E, 13d17'37.50"N)
Center ( 75.8529173, 14.1470837) ( 75d51'10.50"E, 14d 8'49.50"N)
Band 1 Block=256x256 Type=Int16, ColorInterp=Gray
Overviews: 1024x1024, 512x512, 256x256, 128x128/* END */
Is there any problem with corner coordinates ? In other tiles'
gdalinfo what I checked over internet, I observed that the corner
coordinates were from 0.0-90.0, 0.0-0.0, 90.0-90.0,90.0-0.0,45.0-45.0,
for first tile.β
Reply to this email directly or view it on GitHub
#7 (comment).
from cesium-geoserverterrainprovider.
Ok, thanks I will try to use gdal_translate and gdal2tiles for converting srtm tiff file into tiles .
from cesium-geoserverterrainprovider.
No I meant to use
https://github.com/kaktus40/Cesium-GeoserverTerrainProvider/blob/master/GeotiffTranslate.zip
with your original geotiff. See
https://github.com/kaktus40/Cesium-GeoserverTerrainProvider/blob/master/GeotiffTranslate.md
.
In fact which server do you use? geoserver?
On 24/03/2015 13:29, bik20 wrote:
Ok, thanks I will try to use gdal_translate and gdal2tiles for
converting srtm tiff file into tiles .β
Reply to this email directly or view it on GitHub
#7 (comment).
from cesium-geoserverterrainprovider.
Oh... my mistake, I will give it a try.
Yes I am using Geoserver.
from cesium-geoserverterrainprovider.
Did you insert bil/dds plug in in geoserver?
On 24/03/2015 17:06, bik20 wrote:
Oh... my mistake, I will give it a try.
Yes I am using Geoserver.β
Reply to this email directly or view it on GitHub
#7 (comment).
from cesium-geoserverterrainprovider.
Yes I insterted bil/dds plugin in geoserver and than provided the format type and other parameters of image/bil. What parameters I gave were similar as given in WMSparamters.md.
I tried both the methods, bil/dds plugin and styled format.
from cesium-geoserverterrainprovider.
Thanks for the help. I resolved first issue (getting only half of the globe) by making getTileDataAvailable as always true, and the terrain is successfully draped aldo, but still I am getting wrong lat, lon and elevation values. Still I am facing this issue.
This time I am getting altitude as undefined, and lat-lon some random location value such as
lat= 30.789288932601426Β°; long=-123.70412384131085Β°; altitude=undefined meters
Here lat should be almost 13Β° and lon should be almost 73Β°,
The code what I am using is - ( In geoserver, geotifftransformed image is saved in store by adding raster data source as Geotiff)
var viewer = new Cesium.Viewer('cesiumContainer');
var scene =new Cesium.Scene(viewer);
var globe =new Cesium.Globe(Cesium.Ellipsoid.WGS84);
scene.globe=globe;
var ellipsoid = scene.globe.ellipsoid;
var terrainProvider = new Cesium.GeoserverTerrainProvider({
url : "http://localhost:8080/geoserver/bik20/wms",
layerName : "geotiff_image" // This is the Geotifftransformed image.
});
viewer.terrainProvider =terrainProvider;
var hand = new Cesium.ScreenSpaceEventHandler(scene.canvas);
hand.setInputAction(
function (movement) {
if(movement.position != null) {
var cartesian = scene.camera.pickEllipsoid(movement.position, ellipsoid);
if (cartesian) {
var cartographic = ellipsoid.cartesianToCartographic(cartesian);
cartographic.height=globe.getHeight(cartographic);
console.log("lat= "+(cartographic.latitude_180/Math.PI)+"Β°; long="+(cartographic.longitude_180/Math.PI)+"Β°; altitude="+cartographic.height+" meters")
}
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
from cesium-geoserverterrainprovider.
Ok now to force the plug in to use the translated geotif, you must
declare an image format in the parameters:
terrainProvider = new Cesium.GeoserverTerrainProvider({
url : "http://localhost:8080/geoserver/bik20/wms",
layerName: "geotiff_image",
formatImage:{format : "image/png",extension: "png"},
service: "WMS"
});
On 24/03/2015 21:08, bik20 wrote:
Thanks for the help. I resolved first issue (getting only half of the
globe) by making getTileDataAvailable as always true, and the terrain
is successfully draped aldo, but still I am getting wrong lat, lon and
elevation values. Still I am facing this issue.The code what I am using is - ( In geoserver, geotifftransformed image
is saved in store by adding raster data source as Geotiff)var viewer = new Cesium.Viewer('cesiumContainer');
var scene =new Cesium.Scene(viewer);
var globe =new Cesium.Globe(Cesium.Ellipsoid.WGS84);
scene.globe=globe;
var ellipsoid = scene.globe.ellipsoid;var terrainProvider = new Cesium.GeoserverTerrainProvider({
url : "http://localhost:8080/geoserver/bik20/wms",
layerName : "geotiff_image" // This is the Geotifftransformed image.
});
viewer.terrainProvider =terrainProvider;var hand = new Cesium.ScreenSpaceEventHandler(scene.canvas);
hand.setInputAction(
function (movement) {
if(movement.position != null) {
var cartesian = scene.camera.pickEllipsoid(movement.position, ellipsoid);
if (cartesian) {
var cartographic = ellipsoid.cartesianToCartographic(cartesian);
cartographic.height=globe.getHeight(cartographic);
console.log("lat= "+(cartographic.latitude/180/Math.PI)+"Β°;
long="+(cartographic.longitude/180/Math.PI)+"Β°;
altitude="+cartographic.height+" meters")
}
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);β
Reply to this email directly or view it on GitHub
#7 (comment).
from cesium-geoserverterrainprovider.
Still I am getting same problem with lat, lon and elevation. Infact at some locations over the terrain area on mouse click event I am not getting any values in console. I tried both ways, I created tiles after using Geotifftranslate.jar utility, then also I am getting same problem and I directly stored the translated tif in the Geoserver as Geotiff raster source. Is there any problem with my code itself.
from cesium-geoserverterrainprovider.
You should use Geotifftranslate.jar on your original geotiff, generate a
pyramid with gdal_retile (don't forget to create a 0 folder for the root
geotiff) and declare a format image in geoserverTerrainProvider. Can
you send me the getCapabilities document of geoserver (in the first page
of geoserver on the right)
On 25/03/2015 06:18, bik20 wrote:
Still I am getting same problem with lat, lon and elevation. Do I have
to create tiles after using Geotifftranslate.jar utility or directly I
have to store in the Geoserver as Geotiff raster source after
translating; or is there any problem with my code itself. I have used
offset as 0 while using Geotifftranslate.jar.β
Reply to this email directly or view it on GitHub
#7 (comment).
from cesium-geoserverterrainprovider.
The issue with wrong lat and lon and elevation is resolved, there was some error with the conversion of cartesian and cartographic coordinates. I changed the example code, which I was took from readme.md of plugin, for elevation.
I changed this following code :
if (cartesian) {
var cartographic = ellipsoid.cartesianToCartographic(cartesian);
cartographic.height=globe.getHeight(cartographic);
console.log(altitude="+cartographic.height+" meters")
}
to
if (cartesian) {
var cartographic = ellipsoid.cartesianToCartographic(cartesian);
cartographic.height=globe.getHeight(cartographic);
var lon = Cesium.Math.toDegrees(cartographic.longitude);
var lat = Cesium.Math.toDegrees(cartographic.latitude);
var positions=[ Cesium.Cartographic.fromDegrees(lon, lat)];
var promise = Cesium.sampleTerrain(terrainProvider, 12, positions);
Cesium.when(promise, function(updatedPositions) {
console.log('Elevation is' +position[0].height);
});
And I removed if(movement.position != null) {
, for solving the problem of not displaying any information at some click events.
Thanks for the help ! π π π
from cesium-geoserverterrainprovider.
Ok I see what is the problem:
When you use globe.getHeight(cartographic), you have the height that Cesium knows on the cartographic position. This knowledge depends of the tiles those were downloaded. For example if only the level 0 tiles were downloaded for a position A you will have 400 meters. Once Cesium downloaded the level 12 tiles, the same request will return 150 meters.
When you use sampleTerrain, it request the tiles at the level you wished (here 12).
from cesium-geoserverterrainprovider.
Just one more issue, the terrain tiles what I am getting is having flat surface at the peak, not pointed. Can you give me the reason behind this ?
from cesium-geoserverterrainprovider.
for the flat surface on peak, you gave a too high level in parameter. For SRTM that have a precision of 90 meters for each pixel, level 11 should be a max. And you could use the bil/DDS plugin
from cesium-geoserverterrainprovider.
Thanks, just for verification, I inserted bil/DDS plugin and I am using -
formatImage: {format : "image/png",extension: "png"},
formatArray: {
format : "image/bil",
/**
* bufferIn : buffer to process (switch byte order and check the data limitations)
* size: defines the dimension of the array (size.height* size.width cells)
* highest: defines the highest altitude (without offset) of the data.
* lowest: defines the lowest altitude (without offset) of the data.
* offset: defines the offset of the data in order to adjust the limitations
*/
postProcessArray : function(bufferIn, size,highest,lowest,offset) {
var resultat;
var viewerIn = new DataView(bufferIn);
var littleEndianBuffer = new ArrayBuffer(size.height * size.width * 2);
var viewerOut = new DataView(littleEndianBuffer);
if (littleEndianBuffer.byteLength === bufferIn.byteLength) {
// time to switch bytes!!
var temp, goodCell = 0, somme = 0;
for (var i = 0; i < littleEndianBuffer.byteLength; i += 2) {
temp = viewerIn.getInt16(i, false)-offset;
if (temp > lowest && temp < highest) {
viewerOut.setInt16(i, temp, true);
somme += temp;
goodCell++;
} else {
var val = (goodCell == 0 ? 1 : somme / goodCell);
viewerOut.setInt16(i, val, true);
}
}
resultat = new Int16Array(littleEndianBuffer);
}
return resultat;
}
}
I am not getting any option for BIL format setting in Geoserver. So I am directly using. Is this procedure OK ? Or what should I do to get the settings back in Geoserver.
from cesium-geoserverterrainprovider.
By default the plug in use BIL/DDS format if it's available. So You don't need to explicit formatArray or formatImage
from cesium-geoserverterrainprovider.
Thanks again for solving the issues! π
from cesium-geoserverterrainprovider.
bik20 Hi,
can you help me, where did you put the getTileDataAvailable to return always true?
Thanks
from cesium-geoserverterrainprovider.
Related Issues (20)
- only half of the world map is rendered/wrapped around cesium globe when loaded the terrain from geoserver HOT 3
- only half of the world map is rendered HOT 4
- loading DEM of larger area than given area. HOT 1
- blocky terrain question HOT 12
- Using latest version of cesium HOT 5
- conditions when zooming in on the terrain HOT 8
- How to solve βSome tiffs are not int16 Gray images ? HOT 3
- Using with BIL DTM format ? HOT 1
- The speed of GeoserverTerrainProvider vs Cesium Terrain Format HOT 2
- Distorted terrain images HOT 11
- Stepped Terrain on Low Elevation Zooming HOT 1
- Transparent Globe instead of map HOT 4
- Stepped relief. Please help me understand my error HOT 3
- Authkey add in geoseerver wms Service HOT 2
- large dem file not able to show
- Dem showing issue
- issue in showing large dsm files showing spikes and cuts HOT 17
- import? HOT 1
- Not compatible to Cesium 1.105 HOT 5
- hello , the code cannot run , npm run dev failed ,
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cesium-geoserverterrainprovider.