Skip to content

The values in the ground heightmap are incorrect when loading a DTM from a GeoTIFF file. #191

Description

@naulan-chrzaszcz

(I haven't tested the generator's behavior with DTMs from other sources.)

DTM used :

**Parametrage 1 utilisé : **

format: minetest

worldName: Parc - Albania
verticalScale: 1.0
horizontalScale: 1.0
area:
  center:
    latitude: 42.067834
    longitude: 19.513717
  extentX: 250
  extentY: 250

crs: EPSG:6870
heightmaps:
  ground:
    default: 0
  water:
    default: 0

forEachTile:
  altitude:
    type: sequence
    do:
    - type: fetchData
      modelType: altitude
      provider:
        type: geotiff
        filePath: data/dtm.tif
    - type: populateHeightmap
      models:
        type: altitude
      heightmap: ground
    - type: setSpawn
      heightmap:
        sum: [ground, 1]
      x: 0
      y: 0
    - type: renderHeightmap
      at: ground
      place:
        structure:
          - put: *voxel-grass
            at: [0, 0, 0]
          - put: *voxel-dirt
            at: [0, 0, -3..-1]
          - put: *voxel-stone
            at: [0, 0, -20..-4]

Generation result :
Image

**In this screenshot, you can see that the heightmap does not reach its expected limits : **
Image

Activity

  1. pyrollo commented on Jun 19, 2026

    @pyrollo
    Contributor

    I think we should start making our issues in English now (project will be released in August)

  2. pyrollo commented on Jun 19, 2026

    @pyrollo
    Contributor

    Please provide a minimal reproducible example (or at least a working example).

    (tip: parameter.xml file is much reliable than partial file you sent)

  3. indyteo commented on Jun 19, 2026

    @indyteo
    Member

    Second tip:
    You can create foldable section in GitHub Markdown using the <details> HTML tag:

    <details>
    <summary>This is shown as the title of the foldable section</summary>
    
    This is the (possibly extra long) content that is only displayed if the user clicked on the text to expand it!
    
    Lorem ipsum...
    </details>
    This is shown as the title of the foldable section

    This is the (possibly extra long) content that is only displayed if the user clicked on the text to expand it!

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar ex in risus ultricies posuere. In hac habitasse platea dictumst. Maecenas condimentum nisi diam, quis luctus ex interdum porttitor. Fusce sagittis molestie tincidunt. Maecenas varius ultrices turpis molestie lobortis. Sed scelerisque dolor vel leo auctor, ac ornare mi porttitor. Maecenas a lectus at risus imperdiet vulputate a sit amet mi. Aenean nec mi vulputate, cursus nisi eu, egestas sem. Suspendisse a porta dolor. Nam pellentesque quam in tellus scelerisque aliquet. Aliquam sed lacus in lectus tristique volutpat ut nec leo.

    Nullam a venenatis massa. Nulla neque justo, scelerisque vel nibh sed, euismod blandit metus. Suspendisse tristique sollicitudin urna, ornare egestas tortor efficitur venenatis. Fusce fermentum justo eget quam porttitor, sit amet semper mauris aliquam. Vivamus massa augue, luctus quis tellus eget, sollicitudin sollicitudin diam. Proin sed pulvinar sapien. Aenean eget massa viverra, egestas erat id, porttitor erat. Nam pharetra velit id eros sodales pellentesque. Morbi metus ipsum, feugiat quis mattis et, pretium nec est. Donec faucibus fringilla nibh, vitae maximus eros rhoncus ac. Ut imperdiet tincidunt ligula et consequat. Cras euismod, mauris eget placerat fringilla, dolor neque feugiat lectus, vitae suscipit turpis erat in enim. Etiam a suscipit purus. Cras in leo ex. Aenean ut orci mattis, commodo dui ac, bibendum sem.

    Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam eros tortor, volutpat eget ornare a, ornare et ligula. Sed malesuada erat vel odio porta luctus. Nunc metus nibh, posuere sed tincidunt a, pellentesque et libero. Morbi at ipsum ligula. Nunc lorem dui, rhoncus at sapien ut, rhoncus rutrum neque. Aliquam ut interdum elit, at efficitur odio. Aenean vel enim iaculis, efficitur mi et, molestie enim. In cursus sem dictum elit commodo mollis vel id sem. Fusce non luctus arcu. Praesent quis augue tempor odio dignissim iaculis. Nulla viverra consectetur felis, nec ultricies leo fermentum a. Etiam eu feugiat urna, quis volutpat leo. In sollicitudin viverra ante, egestas ornare lectus euismod eu. Nam non porttitor libero, at pulvinar elit.

    Mauris dui mi, viverra vitae tristique sed, tempor iaculis odio. Maecenas in elementum velit. Proin nisl urna, blandit sed nunc semper, congue efficitur neque. Sed consectetur, enim quis pharetra venenatis, dolor lorem pulvinar magna, eget rutrum nibh lectus id quam. Donec sollicitudin scelerisque accumsan. Nam consectetur dolor vel leo posuere imperdiet. Nulla nibh justo, ultricies nec libero vel, interdum mollis tortor. Fusce maximus nulla ac cursus consectetur. Proin ut arcu facilisis, faucibus felis sed, condimentum augue. Maecenas aliquet magna neque, sed tristique purus ultrices ac. Nunc ac magna porta, auctor ligula non, scelerisque leo. Nunc sit amet cursus arcu. Nunc elementum ipsum nibh, eget dignissim metus lacinia in. Curabitur consequat facilisis quam et lobortis.

    Aenean auctor eget orci eget interdum. Aliquam molestie sodales orci sed hendrerit. Donec mattis tempor mollis. Pellentesque lacinia sed ipsum non convallis. Fusce sed augue ipsum. Donec sit amet ullamcorper ante. Sed sit amet ipsum odio. Quisque convallis interdum mauris a sagittis. Duis et justo vel nisl eleifend suscipit. Donec congue felis et diam consequat luctus.

    This works particularly well to show long files (but don't forget to add a blank line after <summary>...</summary> otherwise the ``` code block may not render properly)

    Example 1 - parameters.yaml
    worldName: Parc - Albania
    verticalScale: 1.0
    horizontalScale: 1.0
    area:
      center:
        latitude: 42.067834
        longitude: 19.513717
      extentX: 250
      extentY: 250
    
    crs: EPSG:6870
    heightmaps:
      ground:
        default: 0
      water:
        default: 0
    
    forEachTile:
      altitude:
        type: sequence
        do:
        - type: fetchData
          modelType: altitude
          provider:
            type: geotiff
            filePath: data/dtm.tif
        - type: populateHeightmap
          models:
            type: altitude
          heightmap: ground
        - type: setSpawn
          heightmap:
            sum: [ground, 1]
          x: 0
          y: 0
        - type: renderHeightmap
          at: ground
          place:
            structure:
              - put: *voxel-grass
                at: [0, 0, 0]
              - put: *voxel-dirt
                at: [0, 0, -3..-1]
              - put: *voxel-stone
                at: [0, 0, -20..-4]
    
      roads:
        after: altitude
        type: sequence
        do:
          #- type: fetchData
          #  modelType: roads
          #  provider:
          #    type: shapefile
          #    filePath: data/infra_total.shp
          - type: fetchData
            modelType: roads
            provider:
              type: shapefile
              filePath: "data/Transporti Rrugor/LinjeRrugor.shp"
          - type: renderLines2d
            models:
              type: roads
            heightmap: ground
            structure:
              axes: [ y ]
              blueprint:
                "██████"
              with:
                "█": default:stone
      
      bridge:
        after: altitude
        type: noOperation
        # idk how i can do that for now, missing tasks for.
    
      footway:
        after: altitude
        type: sequence
        do:
          - type: fetchData
            modelType: footways
            provider:
              type: overpass
              url: https://overpass-api.de/api/interpreter
              query: nwr[highway=footway]
            retry: 3
          - type: renderLines2d
            models:
              type: footways
            heightmap: ground
            structure:
              axes: [ y ]
              blueprint:
                "██"
              with:
                "█": default:sandstone
    
      buildings:
        after: altitude
        type: sequence
        do:
          - type: fetchData
            modelType: buildings
            provider:
              type: overpass
              url: https://overpass-api.de/api/interpreter
              query: nwr[building]
            retry: 3
          - type: computeHeightmapStats
            models:
              type: buildings
            heightmap: ground
            compute:
              minimum: minimum-ground-altitude
              maximum: ground-floor-altitude
          - type: fillBetweenHeightmapAndMetadata
            models:
              type: buildings
            heightmap: ground
            altitudeMetadata: ground-floor-altitude
            placeAbove: default:air
            placeBelow: wool:orange
          - type: renderSurfaces
            models:
              type: buildings
            heightmap: ground
            place: wool:orange
    
      water:
        after: altitude
        type: sequence
        do:
          - type: fetchData
            modelType: water
            provider:
              type: shapefile
              filePath: data/III_Rrjedhe_ujore/III_Rrjedhe_ujore.shp
          - type: copyHeightmap
            models:
              type: water
            from:
              localMin: ground
              range: 9
            to: ground
          - type: copyHeightmap
            models:
              type: water
            from: 1
            to: water
          - type: copyHeightmap
            models:
              type: water
            from:
              remap:
                manhattan: water
                maximumDistance: 12
                targetValue: 0
              mapping:
                0: 0
                1: 1
                2: 8
                3..3: 10
                4..6: 11
                7..12: 12
            to: water
          - type: renderHeightmap
            minimum:
              sum:
                - ground
                - 1
                - product: [ -1, water ]
            maximum: ground
            place:
              structure:
                - put: *voxel-water
                  at: [ 0, 0, 0 ]
                # This a dirt fix to remove vegetation on water
                - put: *voxel-air
                  at: [ 0, 0, 1..12 ]
    
      barrier:
        after: altitude
        type: sequence
        do:
          - type: fetchData
            modelType: barriers
            provider:
              type: overpass
              url: https://overpass-api.de/api/interpreter
              query: nwr[barrier=city_wall]
            retry: 3
          - type: renderLines2d
            models:
              type: barriers
            heightmap: ground
            structure:
              axes: [ y ]
              blueprint:
                "██"
              with:
                "█": wool:grey
    
      tree:
        after: altitude
        type: sequence
        do:
          - type: fetchData
            modelType: trees
            provider:
              type: overpass
              url: https://overpass-api.de/api/interpreter
              query: nwr[natural=tree]
            retry: 3
          - type: renderSurfaces
            models:
              type: trees
            heightmap: 
              sum: 
                - ground
                - 1
            place: 
              structure:
                - put: wool:green
                  at: [ 0, 0, 0..5 ]

    PS: I think @pyrollo is referring to parameters.yaml, unless he created a XML version in secret! 😄

  4. indyteo commented on Jun 20, 2026

    @indyteo
    Member

    Could you please try on the indy/fix-geotiff branch, to see if this was a shadow bug of #187?
    It caused issue with the computed envelope, which defines the limits of the height data, and this might explain your second example (and to some extent, maybe the first one too).
    I have good feelings about this one! :)

  5. changed the title [-]Valeurs de la heightmap incorrect avec un MNT chargé depuis un fichier en format GeoTIFF[/-] [+]The values in the `ground` heightmap are incorrect when loading a DTM from a `GeoTIFF` file.[/+] on Jun 22, 2026
  6. naulan-chrzaszcz commented on Oct 1, 2026

    @naulan-chrzaszcz
    MemberAuthor

    This issue is probably not fixed yet. I'm waiting to finish PR #209 to see if I still have the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    On holdTodo latertype: bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions