Skip to content

Commit

Permalink
Merge branch 'main' into gmodeler_actinia_export
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix authored May 14, 2024
2 parents 4e062a9 + 1192011 commit 80cc63e
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 8 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/osgeo4w.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
path-type: inherit
location: D:\
update: true
msystem: MINGW64
install: tar libintl make bison flex diffutils git dos2unix zip mingw-w64-x86_64-toolchain
mingw-w64-x86_64-fftw mingw-w64-x86_64-lapack mingw-w64-x86_64-pkgconf
mingw-w64-x86_64-gcc mingw-w64-x86_64-ccache mingw-w64-x86_64-zlib mingw-w64-x86_64-libiconv
Expand Down Expand Up @@ -65,13 +66,15 @@ jobs:
shell: msys2 {0}

- name: Compile GRASS GIS
run: D:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') (Get-Location)
shell: msys2 {0}
run: .github/workflows/build_osgeo4w.sh

- name: Test executing of the grass command
run: .github/workflows/test_simple.bat 'C:\OSGeo4W\opt\grass\grass84.bat'

- name: Test executing of the grass command in bash
run: D:\msys64\usr\bin\bash.exe .github/workflows/test_simple.sh
shell: msys2 {0}
run: .github/workflows/test_simple.sh

- name: Run tests
run: .github/workflows/test_thorough.bat 'C:\OSGeo4W\opt\grass\grass84.bat' 'C:\OSGeo4W\bin\python3'
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GRASS GIS Repository

[![Build Status](https://travis-ci.com/OSGeo/grass.svg?branch=main)](https://travis-ci.com/OSGeo/grass)
[![Build Status](https://api.travis-ci.com/OSGeo/grass.svg?branch=main)](https://travis-ci.com/OSGeo/grass)
[![GCC C/C++ standards check](https://github.com/OSGeo/grass/workflows/GCC%20C/C++%20standards%20check/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3A%22GCC+C%2FC%2B%2B+standards+check%22)
[![Python code quality check](https://github.com/OSGeo/grass/workflows/Python%20code%20quality%20check/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3A%22Python+code+quality+check%22)
[![General linting](https://github.com/OSGeo/grass/workflows/General%20linting/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3A%22General+linting%22)
Expand All @@ -11,7 +11,7 @@
[![Coverity](https://scan.coverity.com/projects/1038/badge.svg)](https://scan.coverity.com/projects/grass)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5176030.svg)](https://doi.org/10.5281/zenodo.5176030)
[![Join the chat at https://gitter.im/grassgis/community](https://badges.gitter.im/grassgis/community.svg)](https://gitter.im/grassgis/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)

## Description

Expand All @@ -23,7 +23,7 @@ visualization.
Launch this repository in Binder and experiment with GRASS's Python API in
Jupyter Notebooks by clicking the button below:

[![Binder](https://camo.githubusercontent.com/581c077bdbc6ca6899c86d0acc6145ae85e9d80e6f805a1071793dbe48917982/68747470733a2f2f6d7962696e6465722e6f72672f62616467655f6c6f676f2e737667)](https://mybinder.org/v2/gh/OSGeo/grass/main?urlpath=lab%2Ftree%2Fdoc%2Fnotebooks%2Fjupyter_example.ipynb)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/OSGeo/grass/main?labpath=doc%2Fnotebooks%2Fjupyter_example.ipynb)

## Contributing

Expand Down
32 changes: 32 additions & 0 deletions gui/wxpython/gui_core/gselect.py
Original file line number Diff line number Diff line change
Expand Up @@ -2370,6 +2370,17 @@ def getProjMatchCaption(projectionMatch):
)
data.append((layerId, raster, int(projectionMatch), grassName))
layerId += 1
elif self.dbWidgets["format"].GetStringSelection() == "Rasterlite":
rasters = self._getRasterliteDBRasters(dsn)
for raster in rasters:
grassName = GetValidLayerName(raster)
projectionMatch = hasRastSameProjAsLocation(dsn)
projectionMatchCaption = getProjMatchCaption(projectionMatch)
listData.append(
(layerId, raster, projectionMatchCaption, grassName)
)
data.append((layerId, raster, int(projectionMatch), grassName))
layerId += 1

# emit signal
self.reloadDataRequired.emit(listData=listData, data=data)
Expand Down Expand Up @@ -2652,6 +2663,27 @@ def _getPGDBRasters(self, dsn):
Debug.msg(3, f"GdalSelect._getPGDBRasters(): return {rasters}")
return rasters

def _getRasterliteDBRasters(self, dsn):
"""Get Rasterlite DB rasters
:param str dsn: Rasterlite DB data source name
:return list: list of Rasterlite DB rasters
"""
try:
from osgeo import gdal
except ImportError:
GError(
parent=self,
message=_("The Python GDAL package is missing. Please install it."),
)
return []
rasterlite = gdal.Open(dsn)
rasters = rasterlite.GetSubDatasets()
if rasters:
return [r[0].rsplit("table=")[-1] for r in rasters]
return [os.path.basename(rasterlite.GetFileList()[0]).rsplit(".")[0]]


class ProjSelect(wx.ComboBox):
"""Widget for selecting input raster/vector map used by
Expand Down
16 changes: 16 additions & 0 deletions gui/wxpython/modules/import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,24 @@ def OnRun(self, event):
if self.dsnInput.GetType() == "dir":
idsn = os.path.join(dsn, layer)
elif self.dsnInput.GetType() == "db":
idsn = dsn
if "PG:" in dsn:
idsn = f"{dsn} table={layer}"
elif os.path.exists(idsn):
try:
from osgeo import gdal
except ImportError:
GError(
parent=self,
message=_(
"The Python GDAL package is missing."
" Please install it."
),
)
return
dataset = gdal.Open(dsn)
if "Rasterlite" in dataset.GetDriver().ShortName:
idsn = f"RASTERLITE:{dsn},table={layer}"
else:
idsn = dsn

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion raster/r.flow/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <grass/glocale.h>
#include "r.flow.h"
#include "mem.h"
#include "io.h"
#include "flow_io.h"
#include "aspect.h"
#include "precomp.h"

Expand Down
2 changes: 1 addition & 1 deletion raster/r.flow/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <grass/raster.h>
#include <grass/glocale.h>
#include "r.flow.h"
#include "io.h"
#include "flow_io.h"
#include "mem.h"

/************************** MEMORY MGMT/ACCESS **************************/
Expand Down
2 changes: 1 addition & 1 deletion raster/r.flow/precomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <grass/raster.h>
#include <grass/glocale.h>
#include "r.flow.h"
#include "io.h"
#include "flow_io.h"
#include "mem.h"
#include "aspect.h"

Expand Down

0 comments on commit 80cc63e

Please sign in to comment.