oscarpilote / Ortho4XP

A scenery generator for the X-Plane flight simulator
498 stars 202 forks source link

Error processing custom DEM #102

Closed barf closed 4 years ago

barf commented 4 years ago

Hello, I am trying to build a mesh using a GeoTIFF DEM (LiDAR, 1m) but when I click Triangulate the following error appears in stdout and Ortho4XP gets stuck with the last message being -> Loading of the mesh computed by Triangle4XP.

stdout:


Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "./src/O4_Mesh_Utils.py", line 472, in build_mesh
    vertices=post_process_nodes_altitudes(tile)
  File "./src/O4_Mesh_Utils.py", line 158, in post_process_nodes_altitudes
    vertices[6*i:6*i+6]=[float(x) for x in f_node.readline().split()[1:7]]
ValueError: cannot copy sequence with size 3 to array axis with dimension 6```
d41k4n commented 4 years ago

What's the output of gdalinfo for your DEM?

d41k4n commented 4 years ago

And also please provide all Ortho4XP config settings also the full output messages.

barf commented 4 years ago
$ gdalinfo DEM-outline-4326.tif
Driver: GTiff/GeoTIFF
Files: DEM-outline-4326.tif
Size is 3320, 2855
Coordinate System is:
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    USAGE[
        SCOPE["unknown"],
        AREA["World"],
        BBOX[-90,-180,90,180]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
Origin = (172.517973740999992,-43.468904430999999)
Pixel Size = (0.000011187685241,-0.000011185852539)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( 172.5179737, -43.4689044) (172d31' 4.71"E, 43d28' 8.06"S)
Lower Left  ( 172.5179737, -43.5008400) (172d31' 4.71"E, 43d30' 3.02"S)
Upper Right ( 172.5551169, -43.4689044) (172d33'18.42"E, 43d28' 8.06"S)
Lower Right ( 172.5551169, -43.5008400) (172d33'18.42"E, 43d30' 3.02"S)
Center      ( 172.5365453, -43.4848722) (172d32'11.56"E, 43d29' 5.54"S)
Band 1 Block=3320x1 Type=Float32, ColorInterp=Gray
  NoData Value=-3.4028234663852886e+38
$ cat Ortho4XP_-44+172.cfg
apt_smoothing_pix=1
road_level=3
road_banking_limit=0.5
lane_width=5.0
max_levelled_segs=100000
water_simplification=0.0
min_area=0.001
max_area=200.0
clean_bad_geometries=True
mesh_zl=20
curvature_tol=0.5
apt_curv_tol=0.5
apt_curv_ext=0.5
coast_curv_tol=1.0
coast_curv_ext=0.5
limit_tris=0
hmin=0.0
min_angle=10.0
sea_smoothing_mode=zero
water_smoothing=10
iterate=1
mask_zl=14
masks_width=100
masking_mode=sand
use_masks_for_inland=False
imprint_masks_to_dds=False
masks_use_DEM_too=False
masks_custom_extent=
cover_airports_with_highres=False
cover_extent=1.0
cover_zl=18
ratio_water=0.25
overlay_lod=25000.0
sea_texture_blur=0.0
add_low_res_sea_ovl=False
experimental_water=0
normal_map_strength=1.0
terrain_casts_shadows=True
use_decal_on_terrain=False
custom_dem=/mnt/steam/X-Plane 11/Custom Scenery/NZCH/GIS/DEM-outline-4326.tif
fill_nodata=True
default_website=LINZ
default_zl=16
zone_list=[[[-43.500752435690394, 172.50732421875, -43.500752435690394, 172.518310546875, -43.492782808225, 172.518310546875, -43.492782808225, 172.50732421875, -43.500752435690394, 172.50732421875], 19, 'LINZ'], [[-43.500752435690394, 172.518310546875, -43.500752435690394, 172.529296875, -43.492782808225, 172.529296875, -43.492782808225, 172.518310546875, -43.500752435690394, 172.518310546875], 19, 'LINZ'], [[-43.500752435690394, 172.529296875, -43.500752435690394, 172.540283203125, -43.492782808225, 172.540283203125, -43.492782808225, 172.529296875, -43.500752435690394, 172.529296875], 19, 'LINZ'], [[-43.500752435690394, 172.529296875, -43.500752435690394, 172.540283203125, -43.492782808225, 172.540283203125, -43.492782808225, 172.529296875, -43.500752435690394, 172.529296875], 19, 'LINZ'], [[-43.500752435690394, 172.540283203125, -43.500752435690394, 172.55126953125, -43.492782808225, 172.55126953125, -43.492782808225, 172.540283203125, -43.500752435690394, 172.540283203125], 19, 'LINZ'], [[-43.492782808225, 172.540283203125, -43.492782808225, 172.55126953125, -43.484812128916026, 172.55126953125, -43.484812128916026, 172.540283203125, -43.492782808225, 172.540283203125], 19, 'LINZ'], [[-43.484812128916026, 172.540283203125, -43.484812128916026, 172.55126953125, -43.47684039777892, 172.55126953125, -43.47684039777892, 172.540283203125, -43.484812128916026, 172.540283203125], 19, 'LINZ'], [[-43.47684039777892, 172.540283203125, -43.47684039777892, 172.55126953125, -43.468867614829236, 172.55126953125, -43.468867614829236, 172.540283203125, -43.47684039777892, 172.540283203125], 19, 'LINZ'], [[-43.47684039777892, 172.55126953125, -43.47684039777892, 172.562255859375, -43.468867614829236, 172.562255859375, -43.468867614829236, 172.55126953125, -43.47684039777892, 172.55126953125], 19, 'LINZ'], [[-43.484812128916026, 172.55126953125, -43.484812128916026, 172.562255859375, -43.47684039777892, 172.562255859375, -43.47684039777892, 172.55126953125, -43.484812128916026, 172.55126953125], 19, 'LINZ'], [[-43.492782808225, 172.55126953125, -43.492782808225, 172.562255859375, -43.484812128916026, 172.562255859375, -43.484812128916026, 172.55126953125, -43.492782808225, 172.55126953125], 19, 'LINZ'], [[-43.500752435690394, 172.55126953125, -43.500752435690394, 172.562255859375, -43.492782808225, 172.562255859375, -43.492782808225, 172.55126953125, -43.500752435690394, 172.55126953125], 19, 'LINZ'], [[-43.47684039777892, 172.529296875, -43.47684039777892, 172.540283203125, -43.468867614829236, 172.540283203125, -43.468867614829236, 172.529296875, -43.47684039777892, 172.529296875], 19, 'LINZ'], [[-43.47684039777892, 172.518310546875, -43.47684039777892, 172.529296875, -43.468867614829236, 172.529296875, -43.468867614829236, 172.518310546875, -43.47684039777892, 172.518310546875], 19, 'LINZ'], [[-43.47684039777892, 172.50732421875, -43.47684039777892, 172.518310546875, -43.468867614829236, 172.518310546875, -43.468867614829236, 172.50732421875, -43.47684039777892, 172.50732421875], 19, 'LINZ'], [[-43.484812128916026, 172.50732421875, -43.484812128916026, 172.518310546875, -43.47684039777892, 172.518310546875, -43.47684039777892, 172.50732421875, -43.484812128916026, 172.50732421875], 19, 'LINZ'], [[-43.484812128916026, 172.518310546875, -43.484812128916026, 172.529296875, -43.47684039777892, 172.529296875, -43.47684039777892, 172.518310546875, -43.484812128916026, 172.518310546875], 19, 'LINZ'], [[-43.484812128916026, 172.529296875, -43.484812128916026, 172.540283203125, -43.47684039777892, 172.540283203125, -43.47684039777892, 172.529296875, -43.484812128916026, 172.529296875], 19, 'LINZ'], [[-43.492782808225, 172.529296875, -43.492782808225, 172.540283203125, -43.484812128916026, 172.540283203125, -43.484812128916026, 172.529296875, -43.492782808225, 172.529296875], 19, 'LINZ'], [[-43.492782808225, 172.518310546875, -43.492782808225, 172.529296875, -43.484812128916026, 172.529296875, -43.484812128916026, 172.518310546875, -43.492782808225, 172.518310546875], 19, 'LINZ'], [[-43.492782808225, 172.50732421875, -43.492782808225, 172.518310546875, -43.484812128916026, 172.518310546875, -43.484812128916026, 172.50732421875, -43.492782808225, 172.50732421875], 19, 'LINZ'], [[-43.50872101129685, 172.50732421875, -43.50872101129685, 172.518310546875, -43.500752435690394, 172.518310546875, -43.500752435690394, 172.50732421875, -43.50872101129685, 172.50732421875], 19, 'LINZ'], [[-43.50872101129685, 172.518310546875, -43.50872101129685, 172.529296875, -43.500752435690394, 172.529296875, -43.500752435690394, 172.518310546875, -43.50872101129685, 172.518310546875], 19, 'LINZ'], [[-43.50872101129685, 172.540283203125, -43.50872101129685, 172.55126953125, -43.500752435690394, 172.55126953125, -43.500752435690394, 172.540283203125, -43.50872101129685, 172.540283203125], 19, 'LINZ'], [[-43.50872101129685, 172.55126953125, -43.50872101129685, 172.562255859375, -43.500752435690394, 172.562255859375, -43.500752435690394, 172.55126953125, -43.50872101129685, 172.55126953125], 19, 'LINZ'], [[-43.50872101129685, 172.529296875, -43.50872101129685, 172.540283203125, -43.500752435690394, 172.540283203125, -43.500752435690394, 172.529296875, -43.50872101129685, 172.529296875], 19, 'LINZ']]
barf commented 4 years ago

hrm, I just tried to reproduce this and now it says: ERROR: Could not find /home/barf/X-Plane 11/Custom Scenery/zOrtho4XP_-44+172/Data-44+172.1.node so maybe i need to delete everything and try again :-/

barf commented 4 years ago

OK can reproduce it now, what I'm doing is:

  1. configuring a custom WMS layer and selecting a custom DEM (GeoTIFF)
  2. selecting a few tiles around NZCH
  3. Click Assemble vector data
  4. Click Triangulate 3D mesh

then it fails to Triangulate, due to a missing file:


Step 1 : Building vector data for tile -44+172 : 
--------

-> Dealing with airports
    * Recycling OSM data from ./OSM_data/-50+170/-44+172/-44+172_airports.osm.bz2
      A total of 1748 new node(s), 186 new ways and 2 new relation(s).
WARNING:  A presumably erroneous tag marked aerodrome was found and skipped close to the point (172.382066, -43.041338749999994) .
          You might wish to check and correct it online in OSM.
   NZCH   Christchurch International Airport                           3 runways, lat= -43.49, lon= 172.54
   NZFF   Forest Field Airfield                                        3 runways, lat= -43.38, lon= 172.36
   NZRT   Rangiora Aerodrome                                           3 runways, lat= -43.29, lon= 172.54
   NZWL   West Melton Aerodrome                                        3 runways, lat= -43.48, lon= 172.39
   ****   Fernside Fields                                              2 runways, lat= -43.32, lon= 172.51
   ****   Kings (Ladbrooks)                                            1 runway , lat= -43.64, lon= 172.53
   ****   Loburn Abbey Airfield                                        2 runways, lat= -43.23, lon= 172.49
   ****   ****                                                         1 runway , lat= -43.68, lon= 172.15
   ****   ****                                                         2 runways, lat= -43.37, lon= 172.51
   ****   ****                                                         1 runway , lat= -43.67, lon= 172.78
   ****   ****                                                         1 runway , lat= -43.74, lon= 172.91
   Loading elevation data and smoothing it over airports.
   INFO: Dataset contains too much no_data to be filled.
   INFO: Replacing nodata nodes with zero altitude.
    * Min altitude: 0.0 , Max altitude: 38.66 , Mean: 10.647105
   Auto-patched 22 runways and 40 pieces of taxiway.
   Flattened 10 helipads.
   Number of edges at this point: 6679
-> Dealing with roads
    * Recycling OSM data from ./OSM_data/-50+170/-44+172/-44+172_big_roads.osm.bz2
      A total of 25152 new node(s), 3145 new ways and 0 new relation(s).
    * Checking which large roads need levelling.
      Number of filtered segs : 1754
    * Recycling OSM data from ./OSM_data/-50+170/-44+172/-44+172_small_roads.osm.bz2
      A total of 107236 new node(s), 10598 new ways and 0 new relation(s).
    * Checking which smaller roads need levelling.
      Number of filtered segs : 7172
Time for check : 3.9808928966522217
    * Buffering banked road network as multipolygon.
Time for improved buffering: 0.3296480178833008
      Encoding it.
    * Encoding the remaining primary road network as linestrings.
   Number of edges at this point: 37493
-> Dealing with coastline
    * Recycling OSM data from ./OSM_data/-50+170/-44+172/-44+172_coastline.osm.bz2
      A total of 11100 new node(s), 69 new ways and 0 new relation(s).
    * Encoding coastline.
...done.
    * Reconstructing its topology.
Linemerge...
...done.
bdcoords= [0.030026228335301063, 2.067978678676144, 2.656994549036125, 2.665941855698599, 2.6740792036772216, 2.8872792059649988]
inits= [2.8872792059649988, 2.665941855698599, 2.067978678676144]
ends= [0.030026228335301063, 2.6740792036772216, 2.656994549036125]
new loop
Computing next  coord for 0.030026228335301063
    This is an init one
    End one is 2.8872792059649988
2.8872792059649988
Computing next  coord for 2.8872792059649988
    This is and end one
Interp coord [(1.0, 0.0)]
Interp coord [(0.0, 0.0)]
new loop
Computing next  coord for 2.067978678676144
    This is and end one
    The following one is 2.656994549036125
2.656994549036125
Computing next  coord for 2.656994549036125
    This is an init one
    End one is 2.067978678676144
new loop
Computing next  coord for 2.665941855698599
    This is and end one
    The following one is 2.6740792036772216
2.6740792036772216
Computing next  coord for 2.6740792036772216
    This is an init one
    End one is 2.665941855698599
      Found  3 contiguous patch(es).
   Number of edges at this point: 48115
-> Dealing with inland water
    * Recycling OSM data from ./OSM_data/-50+170/-44+172/-44+172_water.osm.bz2
      A total of 30473 new node(s), 442 new ways and 34 new relation(s).
    * Building water multipolygon.
    Total number of geometries: 478 0
      Cleaning it.
      Number of water Multipolygons : 466
      Encoding it.
   Number of edges at this point: 74152
-> Inserting edges related to the orthophotos grid
-> Inserting additional boundary edges for gluing
-> Transcription to the files  /home/barf/X-Plane 11/Custom Scenery/zOrtho4XP_-44+172/Data-44+172.poly and .node
Simplified  38 duplicate nodes and 38 zero length edges.

Final number of constrained edges : 196253

Completed in 1m4sec.
_________________________________________________________________________________________________

Step 2 : Building mesh for tile -44+172 : 
--------

ERROR: Could not find  /home/barf/X-Plane 11/Custom Scenery/zOrtho4XP_-44+172/Data-44+172.1.node
_________________________________________________________________________________________________

Have I missed any steps configuring perhaps?

d41k4n commented 4 years ago

Make sure to set cleaning_level=0 in the app config:

https://forums.x-plane.org/index.php?/forums/topic/139847-v130-bugs/&do=findComment&comment=1446776

barf commented 4 years ago

Same result with cleaning_level=0 or anything else actually

d41k4n commented 4 years ago

First you need to set iterate=0 and select your base DEM (covering the whole tile) and run steps 1 + 2. Then you set iterate=1 and select your local DEM and do step 2 followed by the rest. Remember to hit "Apply" after each config change.

barf commented 4 years ago

I think that was the secret, thank you daikan you're a champion! The rest of my problems are now between chair and keyboard, but that's OK :-)