osgearth
osgearth copied to clipboard
SRS xform errors trying to use layers on spherical bodies
I am unable to load layers on spherical bodies. I get errors such as this where it seems like there actually should be enough information to work:
[osgEarth]* [SpatialReference] SRS xform not possible:
From => unknown
To => unnamed ellipse
[osgEarth]* [SpatialReference] INPUT: GEOGCS["unknown",DATUM["unknown",SPHEROID["unknown",2439700,0]],PRIMEM["Reference meridian",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Longitude",EAST],AXIS["Latitude",NORTH]]
OUTPUT: GEOGCS["unnamed ellipse",DATUM["unknown",SPHEROID["unnamed",24397000,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST]]
[osgEarth]* [SpatialReference] ERROR: Cannot find coordinate operations from `GEOGCRS["unknown",DATUM["unknown",ELLIPSOID["unknown",2439700,0,LENGTHUNIT["metre",1,ID["EPSG",9001]]]],PRIMEM["Reference meridian",0,ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]],CS[ellipsoidal,2],AXIS["longitude",east,ORDER[1],ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]],AXIS["latitude",north,ORDER[2],ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]]]' to `GEOGCRS["unnamed ellipse",DATUM["unknown",ELLIPSOID["unnamed",24397000,0,LENGTHUNIT["metre",1,ID["EPSG",9001]]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]],CS[ellipsoidal,2],AXIS["latitude",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]],AXIS["longitude",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]]]'
Also, same layers work on older osgEarth versions with no problems.
Please report your osgEarth version, GDAL version, earth file snippet, and gdalinfo output on the source data.
osgEarth master branch GDAL 3.0.4
Earth file:
<map name="Mercury" type="geocentric" version="2">
<options>
<profile>
<srs>+proj=latlong +a=2439700 +b=2439700</srs>
</profile>
<terrain driver="rex"
lighting="false"
cluster_culling="true"
tile_pixel_size="135"
range_mode="PIXEL_SIZE_ON_SCREEN"
morph_imagery="true"
morph_terrain="true"
normal_maps="true"
high_resolution_first="false"
first_lod="2"
skirt_ratio="0.1"
tile_size="17"
progressive="true"/>
</options>
</map>
gdalinfo:
Driver: GTiff/GeoTIFF
Files: /home/admin/ng/model/mercury-imagery-messenger-color-8k.tif
Size is 8192, 4096
Coordinate System is:
GEOGCRS["unnamed ellipse",
DATUM["unknown",
ELLIPSOID["unnamed",24397000,0,
LENGTHUNIT["metre",1,
ID["EPSG",9001]]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433,
ID["EPSG",9122]]],
CS[ellipsoidal,2],
AXIS["latitude",north,
ORDER[1],
ANGLEUNIT["degree",0.0174532925199433,
ID["EPSG",9122]]],
AXIS["longitude",east,
ORDER[2],
ANGLEUNIT["degree",0.0174532925199433,
ID["EPSG",9122]]]]
Data axis to CRS axis mapping: 2,1
Origin = (-180.000000000000000,90.000000000000000)
Pixel Size = (0.043945312500000,-0.043945312500000)
Metadata:
AREA_OR_POINT=Area
TIFFTAG_DATETIME=2013:05:08 09:56:28
TIFFTAG_DOCUMENTNAME=mercury-cropped.tif
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
TIFFTAG_SOFTWARE=Adobe Photoshop CS6 (Windows)
TIFFTAG_XRESOLUTION=72
TIFFTAG_YRESOLUTION=72
Image Structure Metadata:
COMPRESSION=JPEG
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left (-180.0000000, 90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"N)
Lower Left (-180.0000000, -90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"S)
Upper Right ( 180.0000000, 90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"N)
Lower Right ( 180.0000000, -90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"S)
Center ( 0.0000000, 0.0000000) ( 0d 0' 0.01"E, 0d 0' 0.01"N)
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
Overviews: 4096x2048, 2048x1024, 1024x512, 512x256, 256x128
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
Overviews: 4096x2048, 2048x1024, 1024x512, 512x256, 256x128
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
Overviews: 4096x2048, 2048x1024, 1024x512, 512x256, 256x128
The ellipsoids don't match (the one in the WKT has an extra zero)
Good eye. That resolved the error message.
I still am not seeing imagery, but it could be from #1710.
Are you able to share the GeoTIFF?
My geotiffs are OK, it's just that plain JPEG layers don't load anymore using a GdalLayer. Is there some other way to load these?
Rob, you can convert to georeferenced GeoTIFFs with this command (for example)
gdal_translate -a_srs "+proj=latlong +a=2439700 +b=2439700" -a_ullr -180 90 180 -90 -of GTiff input.jpg output.tif
I know, but that's not easy on our users. Is there no longer a way to load non-geocoded plain images as layers?
You can put the projection (+proj=latlong +a=2439700 +b=2439700) in a .prj file as well (a.g., input.prj necxt to input.jpg).
There was a bug preventing this from working, which I just pushed a fix for to master.
prj files also do not work for me. I just get white bodies with no layers and no errors when I try to use a jpeg layer. Geotiffs load.
Try using gdal_translate to assign georeferencing information to the file.
gdal_translate -of VRT -a_srs epsg:4326 -a_ullr -180 90 180 -90 cloud_combined_2048.jpg cloud_combined_2048.jpg.vrt