OpenGeoVis / PVGeo

🌍 Python package of VTK-based algorithms to analyze geoscientific data and models
https://pvgeo.org
BSD 3-Clause "New" or "Revised" License
215 stars 43 forks source link

The map receives from EsriGridReader is upside down ? #67

Closed leminhson closed 4 years ago

leminhson commented 4 years ago

Describe the bug A mesh imported from ArcInfo ASCII grid file using EsriGridReader function of fileio.py is displayed upside down.

Behavior The latitude of an Esri grid map received from EsriGridReader function is in the wrong order.

To Reproduce The ArcInfo ASCII grid files could be downloaded from : _https://ags.aer.ca/publications/MOD_2018_02.html_ (Alberta Geological Survey (2019): 3D provincial geological framework model of Alberta, Version 2 - metadata and methodology)

For example, a data file of bedrock topography top surface is a file: _cmh_02b_Pg_Pa_PHtop.asc

Data format: According to the web page https://desktop.arcgis.com/en/arcmap/10.3/manage-data/raster-and-images/esri-ascii-raster-format.htm:

The data component of the Esri ASCII raster follows the header information. Cell values should be delimited by spaces. No carriage returns are necessary at the end of each row in the raster. The number of columns in the header determines when a new row begins. Row 1 of the data is at the top of the raster, row 2 is just under row 1, and so on.

That means: the first row in data file has the highest latitude (corresponding to the top row on a map); last row in data file has lowest latitude (corresponding to the bottom row on a map)

Therefore, EsriGridReader function should read .asc data file from the bottom to the top, not from the top to bottom.

Screenshots Bedrock topology top: bedrock

A mesh is produced by EsriGridReader function (wrong latitude): upside_down

A mesh should be like this: correct_direction

Desktop:

banesullivan commented 4 years ago

Wow, thank you for the detailed description of this bug and the details on the proper way to read the mesh! I will get to making a patch for this ASAP