exported terrain (elevation) from CE is shifted by 25cm compared to original (possible bug)

950
3
Jump to solution
06-06-2017 02:43 AM
MarekDekys
New Contributor III

Hi,

I'm having problem exporting terrain elevation as an image/heightmap (tif 32bit) - the exported image from cityengine is shifted by approx 25cm to the left and to the top compared to the original heightmap as shown on the picture below (screenshot from globalmapper)

How to reproduce:

Let's say I have:

  • a 32bit tif (geotiff) crop of 1x1km terrain (heighmap)
  • in WGS84 UTM 32N
  • with nicely rounded bounds: (300 000,5 000 000 - 301 000,5 001 000)
  • with 0.5m sample spacing (so that its resolution is 2000px x 2000px)

I import this tif into cityengine an coordinates looks correct:

                              (original terrain properties)

then I changed terrain resolution from 1024x1024 to 2000x2000px and exported this terrain from CE to 32bit tif and load it alongside the original terrain an I get this difference (as shown on the first image)

to double-check this problem, I also loaded the newly-exported terrain into cityengine and I can confirm that this terrain has different coordinates then the orignal one

                            (ce-exported terrain properties)

I can also visually confirm in CE that the original and exported terran don't match:

Am I doing something wrong? or can anybody confirm that this is a bug?

I checked the following things and none of them has an effect on this bug - the result is still exactly the same:  shifted by  25cm:

  • changing terrain resolution
  • changing bit depth of tif during export
  • terrain smooth/none toggle
  • exporting non edited/edited terrain
  • exporting edited/non edited terrain with elevation delta file

for somebody it might look as if 25cm is not a big deal but for my workflow it is: I'm using tiled terrain in very-detailed city and I get a gap between the terrain boundaries and I need to export terrain from CE correctly because I'm doing heightmap adjustments to it

I'm attaching the original and the exported terrain so that you can try to replicate this bug

any help appreciated

thanks,

Mark

0 Kudos
1 Solution

Accepted Solutions
ThomasFuchs
Esri Regular Contributor

Seems like CityEngine writes out a wrong world file not taking into account the center of the first pixel.
Reference: World files for raster datasets—ArcGIS Pro | ArcGIS Desktop 
I've filed a bug report.

As a workaround the offset to the pixel center needs to be corrected manually:
CityEngine world file:

0.500000000000000
0.000000000000000
0.000000000000000
-0.500000000000000
300000.000000000000000
5001000.000000000000000

Corrected:

0.500000000000000
0.000000000000000
0.000000000000000
-0.500000000000000
300000.250000000000000
5000999.750000000000000

View solution in original post

3 Replies
ThomasFuchs
Esri Regular Contributor

Seems like CityEngine writes out a wrong world file not taking into account the center of the first pixel.
Reference: World files for raster datasets—ArcGIS Pro | ArcGIS Desktop 
I've filed a bug report.

As a workaround the offset to the pixel center needs to be corrected manually:
CityEngine world file:

0.500000000000000
0.000000000000000
0.000000000000000
-0.500000000000000
300000.000000000000000
5001000.000000000000000

Corrected:

0.500000000000000
0.000000000000000
0.000000000000000
-0.500000000000000
300000.250000000000000
5000999.750000000000000
MarekDekys
New Contributor III

Hi Thomas,

thanks for bug confirmation

I tested your workaround and it solves this problem

thank you very much

any estimation on when it will be fixed? maybe in next release?

Mark

0 Kudos
ThomasFuchs
Esri Regular Contributor

The issue has been fixed in CityEngine 2017.1:
CityEngine 2017.1 release notes—Esri CityEngine | ArcGIS Desktop 

0 Kudos