0

I am programmatically generating data to use in Cesium's 3D Tile System. The data I have is in (Latitude, Longitude, Altitude) format. To display the data in Cesium, I have to first define a region to render the data in, and for that I am trying to use a region. However, I do not understand what the values they use to define their North, East, West, South. I try to use the following line of code to transform my data, which is in EPSG 4326, to EPSG 4979, but it spits out the same values:

> gdaltransform -s_srs EPSG:4326 -t_srs EPSG:4979
-134 47
-134 47

I am using Python's GDAL bindings, and I need to do two things:

  1. Convert (LAT,LON,ALT) to Cesium's ECEF co-ordinate system (X,Y,Z) to display the objects at the right position.
  2. Convert the edges of my dataset to a region that Cesium's tileset.json will understand. Here's my dataset format:

GDAL_INFO:

PROJCS["unnamed",
    GEOGCS["Coordinate System imported from GRIB file",
        DATUM["unknown",
            SPHEROID["Sphere",6371229,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",38.5],
    PARAMETER["standard_parallel_2",38.5],
    PARAMETER["latitude_of_origin",38.5],
    PARAMETER["central_meridian",262.5],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["Metre",1]]
Origin = (-2699020.142521935515106,1588193.847443337785080)
Pixel Size = (3000.000000000000000,-3000.000000000000000)
Corner Coordinates:
Upper Left  (-2699020.143, 1588193.847) (134d 7'17.14"W, 47d50'44.64"N)
Lower Left  (-2699020.143,-1588806.153) (122d43'44.80"W, 21d 7'19.89"N)
Upper Right ( 2697979.857, 1588193.847) ( 60d53'28.48"W, 47d50'57.51"N)
Lower Right ( 2697979.857,-1588806.153) ( 72d16'48.48"W, 21d 7'28.62"N)
Center      (    -520.143,    -306.153) ( 97d30'21.52"W, 38d29'50.09"N)

How do I go about achieving this?


Just to add some more information, my source dataset coverts CONUS. And my playing around with the values, this is an approximate tileset "region" that covers that area:

enter image description here

"region": [
        -2.2197004795898053,
    0.488582109,
    -1.2196595204101946,
    0.7988897891,
    0,
    300000
    ]
}
  • Sorry, I am probably confused. Is the one you have posted output of GDAL_INFO, the same as the one you put into gdal_transform function? Looks like it is on projected CRS , not geographic. – Kazuhito Jun 14 at 14:13
  • No, the inputs on the gdaltranform are the latitude, longitude I got from converting the source data to (LAT, LON, HEIGHT) in my Python code. If there is a way to directly transform my source data to ECEF and EPSG4979, I'd love to know. I am converting it to LAT, LON, HEIGHT because I figured that would make it easier for me to get an answer. – Sam Fischer Jun 14 at 14:29
  • Try 4978 instead. It's geodetic CRS (geocentric). 4979 is geodetic CRS (3D geographic) AKA latitude, longitude, ellipsoidal height. Which is something else to deal with. Your altitude may be geoidal/gravity-related and off up to 100 m compared to ellipsoidal heights which is what you should use to convert to geocentric coordinates. – mkennedy Jun 14 at 18:41
  • In what format do you have the input data? if you just want to define a region, get the bounding box coordinates and transform them with shapely. stackoverflow.com/questions/27943093/… – zwnk Jun 19 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.