Git Product home page Git Product logo

gdal-grass's Introduction

The Open Source Geospatial Foundation

The Open Source Geospatial Foundation is a not-for-profit organization to empower everyone with open source geospatial. The software foundation directly supports projects serving as an outreach and advocacy organization providing financial, organizational and legal support for the open-source geospatial community. OSGeo works with our sponsors and partners to foster an open approach to software, standards, data, and education.

OSGeo has US 501(c)(4) legal status as a not-for-profit organization

This repository contains official branding, documents, and correspondence. Access is limited to volunteers working with our foundation committees.

OSGeo

License

All work here is copyright The Open Source Geospatial Foundation. Unless otherwise stated this content is made available to you under an appropriate Creative Commons license.

Document licenses for software developers:

  • CCBY - permissive license similar to MIT or BSD allowing content to be remixed by other authors, as long as they give us a credit somewhere. This is a great choice for outreach and increases our brand awareness.

  • CCBYSA - protective license similar to GPL allows content to be remixed by other authors, as long as what they are writing is also using a share-alike license.

  • CC0 - Creative Commons public domain tools are used for outreach where we want the information to have as far a reach as possible. When using this approach we do not even ask for attribution! We have to be careful using this license to avoid including any content or photos that we did not create ourselves.

Not all of our content is licensed for modification:

  • CCBYND - some documents are not useful to share in a modified form: our organization charter, memorandums of understanding with partners, official legal documents, letters of recommendation, letters of support. In these cases we allow free distribution, but not modification, of said content. Authors may still quote or cite these materials, and this GitHub repository provides a stable URL. Be sure to include the revision when citing as these documents change over time.

Copyright

The Open Source Geospatial Foundation maintains copyright on all materials in the repository (except otherwise noted). This material was produced by our volunteers on behalf of our organization or donated via a pull request to our foundation in accordance with our contributor license agreement.

What does "except otherwise noted" mean? Some CCBYSA photos are used in our presentation templates and branding guide. We have included these photos in our repository, appropriately crediting the original authors in the initial commit message and in the directory README.md file.

gdal-grass's People

Contributors

alexamici avatar blazek avatar huidaecho avatar metzm avatar mloskot avatar neteler avatar nilason avatar renovate[bot] avatar rouault avatar rouault-bot avatar sebastic avatar strezen avatar warmerdam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gdal-grass's Issues

Fails to build with GDAL 3.6.0

gdal-grass fails to build with GDAL 3.6.0-rc1:

g++ -Wall -fPIC -DUSE_CPL -DGRASS_GISBASE=\"/usr/lib/grass82\" -I/usr/include/gdal -I/usr/lib/grass82/include -I/usr/include/postgresql -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/build/libgdal-grass-1.0.1=. -fstack-protector-strong -Wformat -Werror=format-security -c -o grass.o grass.cpp
g++ -Wall -fPIC -DUSE_CPL -DGRASS_GISBASE=\"/usr/lib/grass82\" -I/usr/include/gdal -I/usr/lib/grass82/include -I/usr/include/postgresql -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/build/libgdal-grass-1.0.1=. -fstack-protector-strong -Wformat -Werror=format-security -c -o ogrgrassdriver.o ogrgrassdriver.cpp
g++ -Wall -fPIC -DUSE_CPL -DGRASS_GISBASE=\"/usr/lib/grass82\" -I/usr/include/gdal -I/usr/lib/grass82/include -I/usr/include/postgresql -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/build/libgdal-grass-1.0.1=. -fstack-protector-strong -Wformat -Werror=format-security -c -o ogrgrassdatasource.o ogrgrassdatasource.cpp
grass.cpp:106:17: error: 'const char* GRASSDataset::_GetProjectionRef()' marked 'override', but does not override
  106 |     const char *_GetProjectionRef(void) override;
      |                 ^~~~~~~~~~~~~~~~~
grass.cpp: In member function 'virtual const OGRSpatialReference* GRASSDataset::GetSpatialRef() const':
grass.cpp:108:16: error: 'GetSpatialRefFromOldGetProjectionRef' was not declared in this scope
  108 |         return GetSpatialRefFromOldGetProjectionRef();
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ogrgrassdriver.cpp: In function 'void RegisterOGRGRASS()':
ogrgrassdriver.cpp:99:39: warning: 'static OGRSFDriverRegistrar* OGRSFDriverRegistrar::GetRegistrar()' is deprecated [-Wdeprecated-declarations]
   99 |     OGRSFDriverRegistrar::GetRegistrar()->RegisterDriver( poDriver );
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from ogrgrass.h:33,
                 from ogrgrassdriver.cpp:29:
/usr/include/gdal/ogrsf_frmts.h:491:34: note: declared here
  491 |     static OGRSFDriverRegistrar *GetRegistrar() OGR_DEPRECATED("Use GDALDriverManager class instead");
      |                                  ^~~~~~~~~~~~
ogrgrassdriver.cpp:99:57: warning: 'void OGRSFDriverRegistrar::RegisterDriver(OGRSFDriver*)' is deprecated [-Wdeprecated-declarations]
   99 |     OGRSFDriverRegistrar::GetRegistrar()->RegisterDriver( poDriver );
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/gdal/ogrsf_frmts.h:494:17: note: declared here
  494 |     void        RegisterDriver( OGRSFDriver * poDriver ) OGR_DEPRECATED("Use GDALDriverManager class instead");
      |                 ^~~~~~~~~~~~~~

Full buildlog: libgdal-grass_1.0.1-2_amd64.txt

undefined GDAL symbols in ogr/gdal_GRASS.so

GDAL-GRASS 1.0.0 (from release tarball)
GDAL 3.5.0 (from git release branch)
GRASS 8.2.0 (from release tarball)
QGIS 3.24.3 (from git release branch)

gdalinfo --formats outputs:

ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegister_GRASS
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: RegisterOGRGRASS

QGIS outputs:

ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegister_GRASS
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: RegisterOGRGRASS
ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegister_GRASS
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: RegisterOGRGRASS

GRASS outputs:

ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/gdal_GRASS.so: undefined symbol: GDALRegister_GRASS
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: GDALRegisterMe
ERROR 1: /usr/lib/gdalplugins/ogr_GRASS.so: undefined symbol: RegisterOGRGRASS

CRS: Provide access to USAGE and ID for raster and vector data

I observe that the USAGE and ID elements are missing in the WKT2:2019 strings retrieved using the GDAL-GRASS drivers. Also the names of PROJCRS, BASEGEOGCRS and CONVERSION are missing or inaccurate, and the CS element is encoded differently than with another driver.

The examples below use data sources in the GRASS GIS 'North Carolina basic dataset', downloaded from https://grass.osgeo.org/download/data/.

Raster example (using GDAL-GRASS driver)
$ gdalsrsinfo /home/floris/grassdata/nc_basic_spm_grass7/PERMANENT/cellhd/landuse

PROJ.4 : +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +ellps=GRS80 +units=m +no_defs

OGC WKT2:2019 :
PROJCRS["unknown",
    BASEGEOGCRS["grs80",
        DATUM["NAD83 (High Accuracy Reference Network)",
            ELLIPSOID["Geodetic_Reference_System_1980",6378137,298.257222101,
                LENGTHUNIT["metre",1]],
            ID["EPSG",6152]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8901]]],
    CONVERSION["unnamed",
        METHOD["Lambert Conic Conformal (2SP)",
            ID["EPSG",9802]],
        PARAMETER["Latitude of false origin",33.75,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8821]],
        PARAMETER["Longitude of false origin",-79,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8822]],
        PARAMETER["Latitude of 1st standard parallel",36.1666666666667,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8823]],
        PARAMETER["Latitude of 2nd standard parallel",34.3333333333333,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8824]],
        PARAMETER["Easting at false origin",609601.22,
            LENGTHUNIT["metre",1],
            ID["EPSG",8826]],
        PARAMETER["Northing at false origin",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8827]]],
    CS[Cartesian,2],
        AXIS["easting",east,
            ORDER[1],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]],
        AXIS["northing",north,
            ORDER[2],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]]]
Raster WKT is OK for a file written with `r.out.gdal` from GRASS (using the RRASTER driver)
$ gdalsrsinfo /tmp/RtmpLbnKgE/file1c4047a79ec84.grd

PROJ.4 : +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +ellps=GRS80 +units=m +no_defs

OGC WKT2:2019 :
PROJCRS["NAD83(HARN) / North Carolina",
    BASEGEOGCRS["NAD83(HARN)",
        DATUM["NAD83 (High Accuracy Reference Network)",
            ELLIPSOID["GRS 1980",6378137,298.257222101,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4152]],
    CONVERSION["SPCS83 North Carolina zone (meter)",
        METHOD["Lambert Conic Conformal (2SP)",
            ID["EPSG",9802]],
        PARAMETER["Latitude of false origin",33.75,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8821]],
        PARAMETER["Longitude of false origin",-79,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8822]],
        PARAMETER["Latitude of 1st standard parallel",36.1666666666667,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8823]],
        PARAMETER["Latitude of 2nd standard parallel",34.3333333333333,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8824]],
        PARAMETER["Easting at false origin",609601.22,
            LENGTHUNIT["metre",1],
            ID["EPSG",8826]],
        PARAMETER["Northing at false origin",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8827]]],
    CS[Cartesian,2],
        AXIS["easting (X)",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["northing (Y)",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    USAGE[
        SCOPE["Engineering survey, topographic mapping."],
        AREA["United States (USA) - North Carolina - counties of Alamance; Alexander; Alleghany; Anson; Ashe; Avery; Beaufort; Bertie; Bladen; Brunswick; Buncombe; Burke; Cabarrus; Caldwell; Camden; Carteret; Caswell; Catawba; Chatham; Cherokee; Chowan; Clay; Cleveland; Columbus; Craven; Cumberland; Currituck; Dare; Davidson; Davie; Duplin; Durham; Edgecombe; Forsyth; Franklin; Gaston; Gates; Graham; Granville; Greene; Guilford; Halifax; Harnett; Haywood; Henderson; Hertford; Hoke; Hyde; Iredell; Jackson; Johnston; Jones; Lee; Lenoir; Lincoln; Macon; Madison; Martin; McDowell; Mecklenburg; Mitchell; Montgomery; Moore; Nash; New Hanover; Northampton; Onslow; Orange; Pamlico; Pasquotank; Pender; Perquimans; Person; Pitt; Polk; Randolph; Richmond; Robeson; Rockingham; Rowan; Rutherford; Sampson; Scotland; Stanly; Stokes; Surry; Swain; Transylvania; Tyrrell; Union; Vance; Wake; Warren; Washington; Watauga; Wayne; Wilkes; Wilson; Yadkin; Yancey."],
        BBOX[33.83,-84.33,36.59,-75.38]],
    ID["EPSG",3358]]
Vector example (using GDAL-GRASS driver)
$ gdalsrsinfo /home/floris/grassdata/nc_basic_spm_grass7/PERMANENT/vector/zipcodes/head

PROJ.4 : +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +datum=NAD83 +units=m +no_defs

OGC WKT2:2019 :
PROJCRS["unknown",
    BASEGEOGCRS["grs80",
        DATUM["North American Datum 1983",
            ELLIPSOID["Geodetic_Reference_System_1980",6378137,298.257222101,
                LENGTHUNIT["metre",1]],
            ID["EPSG",6269]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8901]]],
    CONVERSION["unnamed",
        METHOD["Lambert Conic Conformal (2SP)",
            ID["EPSG",9802]],
        PARAMETER["Latitude of false origin",33.75,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8821]],
        PARAMETER["Longitude of false origin",-79,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8822]],
        PARAMETER["Latitude of 1st standard parallel",36.1666666666667,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8823]],
        PARAMETER["Latitude of 2nd standard parallel",34.3333333333333,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8824]],
        PARAMETER["Easting at false origin",609601.22,
            LENGTHUNIT["metre",1],
            ID["EPSG",8826]],
        PARAMETER["Northing at false origin",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8827]]],
    CS[Cartesian,2],
        AXIS["easting",east,
            ORDER[1],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]],
        AXIS["northing",north,
            ORDER[2],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]]]
Vector WKT is OK for a file written with `v.out.ogr` from GRASS (using the GPKG driver)
$ gdalsrsinfo /tmp/Rtmpa0iHev/file6eca4a06501.gpkg

PROJ.4 : +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +ellps=GRS80 +units=m +no_defs

OGC WKT2:2019 :
PROJCRS["NAD83(HARN) / North Carolina",
    BASEGEOGCRS["NAD83(HARN)",
        DATUM["NAD83 (High Accuracy Reference Network)",
            ELLIPSOID["GRS 1980",6378137,298.257222101,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4152]],
    CONVERSION["SPCS83 North Carolina zone (meter)",
        METHOD["Lambert Conic Conformal (2SP)",
            ID["EPSG",9802]],
        PARAMETER["Latitude of false origin",33.75,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8821]],
        PARAMETER["Longitude of false origin",-79,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8822]],
        PARAMETER["Latitude of 1st standard parallel",36.1666666666667,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8823]],
        PARAMETER["Latitude of 2nd standard parallel",34.3333333333333,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8824]],
        PARAMETER["Easting at false origin",609601.22,
            LENGTHUNIT["metre",1],
            ID["EPSG",8826]],
        PARAMETER["Northing at false origin",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8827]]],
    CS[Cartesian,2],
        AXIS["easting (X)",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["northing (Y)",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    USAGE[
        SCOPE["Engineering survey, topographic mapping."],
        AREA["United States (USA) - North Carolina - counties of Alamance; Alexander; Alleghany; Anson; Ashe; Avery; Beaufort; Bertie; Bladen; Brunswick; Buncombe; Burke; Cabarrus; Caldwell; Camden; Carteret; Caswell; Catawba; Chatham; Cherokee; Chowan; Clay; Cleveland; Columbus; Craven; Cumberland; Currituck; Dare; Davidson; Davie; Duplin; Durham; Edgecombe; Forsyth; Franklin; Gaston; Gates; Graham; Granville; Greene; Guilford; Halifax; Harnett; Haywood; Henderson; Hertford; Hoke; Hyde; Iredell; Jackson; Johnston; Jones; Lee; Lenoir; Lincoln; Macon; Madison; Martin; McDowell; Mecklenburg; Mitchell; Montgomery; Moore; Nash; New Hanover; Northampton; Onslow; Orange; Pamlico; Pasquotank; Pender; Perquimans; Person; Pitt; Polk; Randolph; Richmond; Robeson; Rockingham; Rowan; Rutherford; Sampson; Scotland; Stanly; Stokes; Surry; Swain; Transylvania; Tyrrell; Union; Vance; Wake; Warren; Washington; Watauga; Wayne; Wilkes; Wilson; Yadkin; Yancey."],
        BBOX[33.83,-84.33,36.59,-75.38]],
    ID["EPSG",3358]]

Motivation:

Getting access to this extra information will be useful in R, where the GRASS GIS interface is provided by package {rgrass} (@rsbivand), which in turn uses the {terra} package for reading & writing with GDAL. In the {rgrass} package we intend to (re-)implement the GDAL-GRASS driver to access layers in order to avoid the extra r.out.gdal or v.out.ogr steps that cause extra writing & reading overhead. (rsbivand/rgrass#75)

System specs:

$ ogrinfo --version
GDAL 3.8.4, released 2024/02/08
$ 
$ apt policy libgdal-grass
libgdal-grass:
  Installed: 1:1.0.2-7+jammy3
  Candidate: 1:1.0.2-7+jammy3
  Version table:
 *** 1:1.0.2-7+jammy3 500
        500 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status
     3.4.1-3 500
        500 http://ftp.belnet.be/ubuntu jammy/universe amd64 Packages
$ 
$ inxi -Sxxx
System:
  Host: xxx Kernel: 5.15.0-112-generic x86_64 bits: 64 compiler: gcc
    v: 11.4.0 Desktop: Cinnamon 6.0.4 tk: GTK 3.24.33 wm: muffin vt: 7
    dm: LightDM 1.30.0 Distro: Linux Mint 21.3 Virginia
    base: Ubuntu 22.04 jammy

Time for new release?

A neat change log has accumulated since the 1.0.2 release: 1.0.2...main
Perhaps the biggest change is the added support of CMake.
Maybe it is time for a new release: 1.0.3?

There is a pending pull request #37, which I'm not sure if it should go to a patch release or rather to 1.1.0?

A future 1.1.0 release could possibly also be a the first release with CMake only (ie. dropping Autotools configure) โ€“ to simplify maintenance. If this proposition is agreed upon, I'd suggest we deprecate Autotools configure with the 1.0.3 release and then create a 1.0 release branch.

raster: feature request: allow a GRASS GIS region to be taken into account

It seems that exporting a raster layer from the GRASS GIS database disregards the mapset's region (see example below). Accessing this important GRASS GIS feature would be very convenient, e.g. in aligning multiple raster layers that were accessed with the GDAL driver.

Would it be possible to add a 'dataset open' option that sets a GRASS GIS region? Various options of g.region might be used for this purpose; the most useful probably being region (sufficient to use a GRASS GIS region) and the manual settings n, s, e, w and res.

Example of mismatching region settings between r.out.gdal and gdalwarp
$ grass
Starting GRASS GIS...

          __________  ___   __________    _______________
         / ____/ __ \/   | / ___/ ___/   / ____/  _/ ___/
        / / __/ /_/ / /| | \__ \\_  \   / / __ / / \__ \
       / /_/ / _, _/ ___ |___/ /__/ /  / /_/ // / ___/ /
       \____/_/ |_/_/  |_/____/____/   \____/___//____/

Welcome to GRASS GIS 8.3.2
GRASS GIS homepage:                      https://grass.osgeo.org
This version running through:            Bash Shell (/bin/bash)
Help is available with the command:      g.manual -i
See the licence terms with:              g.version -c
See citation options with:               g.version -x
Start the GUI with:                      g.gui wxpython
When ready to quit enter:                exit

GRASS nc_basic_spm_grass7/PERMANENT:~ > g.region region=state_500m
GRASS nc_basic_spm_grass7/PERMANENT:~ > 
GRASS nc_basic_spm_grass7/PERMANENT:~ > g.region -p
projection: 99 (Lambert Conformal Conic)
zone:       0
datum:      nad83
ellipsoid:  a=6378137 es=0.006694380022900787
north:      320000
south:      8000
west:       120000
east:       934000
nsres:      500
ewres:      500
rows:       624
cols:       1628
cells:      1015872
GRASS nc_basic_spm_grass7/PERMANENT:~ > 
GRASS nc_basic_spm_grass7/PERMANENT:~ > r.out.gdal input=elevation output=elevation_grass.tif 2> /dev/null
GRASS nc_basic_spm_grass7/PERMANENT:~ > 
GRASS nc_basic_spm_grass7/PERMANENT:~ > gdalwarp /home/floris/grassdata/nc_basic_spm_grass7/PERMANENT/cellhd/elevation elevation_gdal.tif 2> /dev/null
Copying color table from /home/floris/grassdata/nc_basic_spm_grass7/PERMANENT/cellhd/elevation to new file.
Creating output file that is 1500P x 1350L.
Processing /home/floris/grassdata/nc_basic_spm_grass7/PERMANENT/cellhd/elevation [1/1] : 0Using internal nodata values (e.g. nan) for image /home/floris/grassdata/nc_basic_spm_grass7/PERMANENT/cellhd/elevation.
Copying nodata values from source /home/floris/grassdata/nc_basic_spm_grass7/PERMANENT/cellhd/elevation to destination elevation_gdal.tif.
...10...20...30...40...50...60...70...80...90...100 - done.
GRASS nc_basic_spm_grass7/PERMANENT:~ > 
GRASS nc_basic_spm_grass7/PERMANENT:~ > 
GRASS nc_basic_spm_grass7/PERMANENT:~ > gdalinfo -nomd elevation_grass.tif | tail -11
Origin = (120000.000000000000000,320000.000000000000000)
Pixel Size = (500.000000000000000,-500.000000000000000)
Corner Coordinates:
Upper Left  (  120000.000,  320000.000) ( 84d28' 4.38"W, 36d30'46.34"N)
Lower Left  (  120000.000,    8000.000) ( 84d16'57.51"W, 33d42'16.78"N)
Upper Right (  934000.000,  320000.000) ( 75d22'30.17"W, 36d34'51.69"N)
Lower Right (  934000.000,    8000.000) ( 75d29'52.75"W, 33d46'13.90"N)
Center      (  527000.000,  164000.000) ( 79d54'26.85"W, 35d13'30.03"N)
Band 1 Block=1628x1 Type=Float32, ColorInterp=Gray
  Description = elevation
  NoData Value=nan
GRASS nc_basic_spm_grass7/PERMANENT:~ > 
GRASS nc_basic_spm_grass7/PERMANENT:~ > 
GRASS nc_basic_spm_grass7/PERMANENT:~ > gdalinfo -nomd elevation_gdal.tif | tail -11
Data axis to CRS axis mapping: 1,2
Origin = (630000.000000000000000,228500.000000000000000)
Pixel Size = (10.000000000000000,-10.000000000000000)
Corner Coordinates:
Upper Left  (  630000.000,  228500.000) ( 78d46'27.41"W, 35d48'34.59"N)
Lower Left  (  630000.000,  215000.000) ( 78d46'28.63"W, 35d41'16.54"N)
Upper Right (  645000.000,  228500.000) ( 78d36'29.89"W, 35d48'33.08"N)
Lower Right (  645000.000,  215000.000) ( 78d36'32.01"W, 35d41'15.03"N)
Center      (  637500.000,  221750.000) ( 78d41'29.49"W, 35d44'54.91"N)
Band 1 Block=1500x1 Type=Float32, ColorInterp=Palette
  NoData Value=nan
GRASS nc_basic_spm_grass7/PERMANENT:~ > 
exit
Done.

Goodbye from GRASS GIS

Motivation:

In R the GRASS GIS interface is provided by package {rgrass}, which in turn uses the {terra} package for reading & writing with GDAL. In the {rgrass} package we intend to (re-)implement the GDAL-GRASS driver to access layers in order to avoid the extra r.out.gdal or v.out.ogr steps that cause extra overhead. (rsbivand/rgrass#75)

System specs:

$ ogrinfo --version
GDAL 3.8.4, released 2024/02/08
$ 
$ apt policy libgdal-grass
libgdal-grass:
  Installed: 1:1.0.2-7+jammy3
  Candidate: 1:1.0.2-7+jammy3
  Version table:
 *** 1:1.0.2-7+jammy3 500
        500 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status
     3.4.1-3 500
        500 http://ftp.belnet.be/ubuntu jammy/universe amd64 Packages
$ 
$ inxi -Sxxx
System:
  Host: xxx Kernel: 5.15.0-112-generic x86_64 bits: 64 compiler: gcc
    v: 11.4.0 Desktop: Cinnamon 6.0.4 tk: GTK 3.24.33 wm: muffin vt: 7
    dm: LightDM 1.30.0 Distro: Linux Mint 21.3 Virginia
    base: Ubuntu 22.04 jammy

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/publish.yml
  • actions/checkout v4
  • softprops/action-gh-release v2
.github/workflows/ubuntu.yml
  • actions/checkout v4
  • actions/setup-python v5

  • Check this box to trigger a request for Renovate to run again on this repository

configure should detect if GRASS is compiled with Postgres

If GRASS is compiled with PG, then it is necessary to provide PG includes and linking parameters also for gdal-grass as include/grass/config.h then has #define HAVE_POSTGRES 1 affecting include/grass/vect/dig_structs.h

Symptom for a reference:
include/grass/vect/dig_structs.h:31:10: fatal error: libpq-fe.h: No such file or directory

vector: standard error messages when importing from GRASS GIS in R

This usecase is for R where we are using package {terra}. It uses GDAL for reading & writing any supported data source format. With the GDAL-GRASS standalone driver installed this works fine for raster, but throws standard error messages when reading a vector layer.

The examples below use vector data sources in the GRASS GIS 'North Carolina basic dataset', downloaded from https://grass.osgeo.org/download/data/.

Example 1: point data
library(terra)
#> terra 1.7.78
result_1 <- vect(
  x = "/home/floris/grassdata/nc_basic_spm_grass7/PERMANENT/vector/schools/head",
  layer = "schools"
)
#> Warning: Cannot reset cursor. (GDAL error 1)
#> Warning: Attributes not found. (GDAL error 1)
result_1
#>  class       : SpatVector 
#>  geometry    : points 
#>  dimensions  : 167, 29  (geometries, attributes)
#>  extent      : 619215.1, 671714.6, 203559, 248159.8  (xmin, xmax, ymin, ymax)
#>  source      : head (schools)
#>  coord. ref. : +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +datum=NAD83 +units=m +no_defs 
#>  names       :   cat   TAG        NAMESHORT        NAMELONG CORECAPACI
#>  type        : <int> <chr>            <chr>           <chr>      <num>
#>  values      :     1   568      SWIFT CREEK SWIFT CREEK EL~        448
#>                    2   340       BRIARCLIFF BRIARCLIFF ELE~        540
#>                    3   414 FARMINGTON WOODS FARMINGTON WOO~        523
#>  MOBILEUNIT MOBILECAPA GLEVEL LOGRADE HIGRADE (and 19 more)
#>       <num>      <num>  <chr>   <chr>   <chr>              
#>           2        NaN      E      NA      NA              
#>           0        NaN      E      NA      NA              
#>           7        NaN      E      NA      NA

Created on 2024-06-15 with reprex v2.1.0

Collected standard output and standard error

DBMI-SQLite driver error:
DB_PREVIOUS is not supported

DBMI-SQLite driver error:
DB_PREVIOUS is not supported

DB_PREVIOUS is defined in GRASS GIS in include/grass/dbmi.h.

Example 2: polygon data
library(terra)
#> terra 1.7.78
result_2 <- vect(
  x = "/home/floris/grassdata/nc_basic_spm_grass7/PERMANENT/vector/zipcodes/head",
  layer = "zipcodes"
)
#> Warning: Cannot reset cursor. (GDAL error 1)
#> Warning: Attributes not found. (GDAL error 1)
result_2
#>  class       : SpatVector 
#>  geometry    : polygons 
#>  dimensions  : 48, 12  (geometries, attributes)
#>  extent      : 610047.9, 677060.7, 196327.5, 258102.6  (xmin, xmax, ymin, ymax)
#>  source      : head (zipcodes)
#>  coord. ref. : +proj=lcc +lat_0=33.75 +lon_0=-79 +lat_1=36.1666666666667 +lat_2=34.3333333333333 +x_0=609601.22 +y_0=0 +datum=NAD83 +units=m +no_defs 
#>  names       :   cat OBJECTID WAKE_ZIPCO PERIMETER ZIPCODE_ ZIPCODE_ID
#>  type        : <int>    <int>      <num>     <num>    <num>      <num>
#>  values      :     1        1  2.625e+08 8.075e+04        2         27
#>                    2        2  3.163e+07 3.106e+04        7         25
#>                    3        3   5.44e+08 1.153e+05        8         20
#>      ZIPNAME    ZIPNUM           ZIPCODE        NAME SHAPE_Leng SHAPE_Area
#>        <chr>     <num>             <chr>       <chr>      <num>      <num>
#>    CREEDMOOR 2.752e+04   CREEDMOOR 27522   CREEDMOOR  8.078e+04  2.624e+08
#>  YOUNGSVILLE  2.76e+04 YOUNGSVILLE 27596 YOUNGSVILLE  3.106e+04  3.163e+07
#>      RALEIGH 2.762e+04     RALEIGH 27615     RALEIGH  1.153e+05   5.44e+08

Created on 2024-06-15 with reprex v2.1.0

Collected standard output and standard error

DBMI-SQLite driver error:
DB_PREVIOUS is not supported

DBMI-SQLite driver error:
DB_PREVIOUS is not supported

DB_PREVIOUS is defined in GRASS GIS in include/grass/dbmi.h.

R session info
sessioninfo::session_info()
#> โ”€ Session info โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
#>  setting  value
#>  version  R version 4.4.0 (2024-04-24)
#>  os       Linux Mint 21.3
#>  system   x86_64, linux-gnu
#>  ui       X11
#>  language nl_BE:nl
#>  collate  nl_BE.UTF-8
#>  ctype    nl_BE.UTF-8
#>  tz       Europe/Brussels
#>  date     2024-06-15
#>  pandoc   3.1.11 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/x86_64/ (via rmarkdown)
#> 
#> โ”€ Packages โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
#>  package     * version date (UTC) lib source
#>  cli           3.6.2   2023-12-11 [3] RSPM (R 4.3.0)
#>  codetools     0.2-20  2024-03-31 [3] RSPM (R 4.3.0)
#>  digest        0.6.35  2024-03-11 [3] RSPM (R 4.3.0)
#>  evaluate      0.24.0  2024-06-10 [3] RSPM (R 4.4.0)
#>  fastmap       1.2.0   2024-05-15 [3] RSPM (R 4.4.0)
#>  fs            1.6.4   2024-04-25 [3] RSPM (R 4.3.0)
#>  glue          1.7.0   2024-01-09 [3] RSPM (R 4.3.0)
#>  htmltools     0.5.8.1 2024-04-04 [3] RSPM (R 4.3.0)
#>  knitr         1.47.2  2024-06-04 [1] Github (yihui/knitr@f50b75b)
#>  lifecycle     1.0.4   2023-11-07 [3] RSPM (R 4.3.0)
#>  magrittr      2.0.3   2022-03-30 [3] RSPM (R 4.2.0)
#>  purrr         1.0.2   2023-08-10 [3] RSPM (R 4.2.0)
#>  R.cache       0.16.0  2022-07-21 [3] RSPM (R 4.2.0)
#>  R.methodsS3   1.8.2   2022-06-13 [3] RSPM (R 4.2.0)
#>  R.oo          1.26.0  2024-01-24 [3] RSPM (R 4.3.0)
#>  R.utils       2.12.3  2023-11-18 [3] RSPM (R 4.3.0)
#>  Rcpp          1.0.12  2024-01-09 [3] RSPM (R 4.3.0)
#>  reprex        2.1.0   2024-01-11 [3] RSPM (R 4.3.0)
#>  rlang         1.1.4   2024-06-04 [3] RSPM (R 4.4.0)
#>  rmarkdown     2.27    2024-05-17 [3] RSPM (R 4.4.0)
#>  rstudioapi    0.16.0  2024-03-24 [3] RSPM (R 4.3.0)
#>  sessioninfo   1.2.2   2021-12-06 [3] RSPM (R 4.2.0)
#>  styler        1.10.3  2024-04-07 [3] RSPM (R 4.3.0)
#>  terra       * 1.7-78  2024-05-22 [1] RSPM (R 4.4.0)
#>  vctrs         0.6.5   2023-12-01 [3] RSPM (R 4.3.0)
#>  withr         3.0.0   2024-01-16 [3] RSPM (R 4.3.2)
#>  xfun          0.44    2024-05-15 [3] RSPM (R 4.4.0)
#>  yaml          2.3.8   2023-12-11 [3] RSPM (R 4.3.0)
#> 
#>  [1] /home/floris/lib/R/library
#>  [2] /usr/local/lib/R/site-library
#>  [3] /usr/lib/R/site-library
#>  [4] /usr/lib/R/library
#> 
#> โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

Motivation:

In R the GRASS GIS interface is provided by package {rgrass} (@rsbivand), which in turn uses the {terra} package (@rhijmans) for reading & writing with GDAL. In the {rgrass} package we intend to (re-)implement the GDAL-GRASS driver to access layers in order to avoid the extra r.out.gdal or v.out.ogr steps that cause extra writing & reading overhead. (rsbivand/rgrass#75)

System specs:

$ ogrinfo --version
GDAL 3.8.4, released 2024/02/08
$ 
$ apt policy libgdal-grass
libgdal-grass:
  Installed: 1:1.0.2-7+jammy3
  Candidate: 1:1.0.2-7+jammy3
  Version table:
 *** 1:1.0.2-7+jammy3 500
        500 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status
     3.4.1-3 500
        500 http://ftp.belnet.be/ubuntu jammy/universe amd64 Packages
$ 
$ inxi -Sxxx
System:
  Host: xxx Kernel: 5.15.0-112-generic x86_64 bits: 64 compiler: gcc
    v: 11.4.0 Desktop: Cinnamon 6.0.4 tk: GTK 3.24.33 wm: muffin vt: 7
    dm: LightDM 1.30.0 Distro: Linux Mint 21.3 Virginia
    base: Ubuntu 22.04 jammy

Fails to build with GDAL 3.8.0

As reported in Debian Bug #1055602:

Your package FTBFS with GDAL 3.8.0 from experimental:

g++ -Wall -fPIC -DUSE_CPL -DGRASS_GISBASE=\"/usr/lib/grass83\" -I/usr/include/gdal -I/usr/lib/grass83/include -I/usr/include/postgresql -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/build/libgdal-grass-1.0.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -c -o ogrgrasslayer.o ogrgrasslayer.cpp
In file included from /usr/include/gdal/ogr_geometry.h:36,
                 from /usr/include/gdal/ogr_feature.h:36,
                 from /usr/include/gdal/ogrsf_frmts.h:35,
                 from ogrgrass.h:33,
                 from ogrgrassdriver.cpp:29:
/usr/include/gdal/cpl_json.h:97:36: error: expected ')' before 'nVal'
   97 |     explicit CPLJSONObject(uint64_t nVal);
      |                           ~        ^~~~~
      |                                    )
/usr/include/gdal/cpl_json.h:119:41: error: 'uint64_t' has not been declared
  119 |     void Add(const std::string &osName, uint64_t nValue);
      |                                         ^~~~~~~~
/usr/include/gdal/cpl_json.h:119:10: error: 'void CPLJSONObject::Add(const std::string&, int)' cannot be overloaded with 'void CPLJSONObject::Add(const std::string&, int)'
  119 |     void Add(const std::string &osName, uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:117:10: note: previous declaration 'void CPLJSONObject::Add(const std::string&, int)'
  117 |     void Add(const std::string &osName, int nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:131:41: error: 'uint64_t' has not been declared
  131 |     void Set(const std::string &osName, uint64_t nValue);
      |                                         ^~~~~~~~
/usr/include/gdal/cpl_json.h:131:10: error: 'void CPLJSONObject::Set(const std::string&, int)' cannot be overloaded with 'void CPLJSONObject::Set(const std::string&, int)'
  131 |     void Set(const std::string &osName, uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:129:10: note: previous declaration 'void CPLJSONObject::Set(const std::string&, int)'
  129 |     void Set(const std::string &osName, int nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:245:14: error: 'uint64_t' has not been declared
  245 |     void Add(uint64_t nValue);
      |              ^~~~~~~~
/usr/include/gdal/cpl_json.h:245:10: error: 'void CPLJSONArray::Add(int)' cannot be overloaded with 'void CPLJSONArray::Add(int)'
  245 |     void Add(uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:243:10: note: previous declaration 'void CPLJSONArray::Add(int)'
  243 |     void Add(int nValue);
      |          ^~~
In file included from /usr/include/gdal/ogr_geometry.h:36,
                 from /usr/include/gdal/ogr_feature.h:36,
                 from /usr/include/gdal/ogrsf_frmts.h:35,
                 from ogrgrass.h:33,
                 from ogrgrassdatasource.cpp:30:
/usr/include/gdal/cpl_json.h:97:36: error: expected ')' before 'nVal'
   97 |     explicit CPLJSONObject(uint64_t nVal);
      |                           ~        ^~~~~
      |                                    )
/usr/include/gdal/cpl_json.h:119:41: error: 'uint64_t' has not been declared
  119 |     void Add(const std::string &osName, uint64_t nValue);
      |                                         ^~~~~~~~
/usr/include/gdal/cpl_json.h:119:10: error: 'void CPLJSONObject::Add(const std::string&, int)' cannot be overloaded with 'void CPLJSONObject::Add(const std::string&, int)'
  119 |     void Add(const std::string &osName, uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:117:10: note: previous declaration 'void CPLJSONObject::Add(const std::string&, int)'
  117 |     void Add(const std::string &osName, int nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:131:41: error: 'uint64_t' has not been declared
  131 |     void Set(const std::string &osName, uint64_t nValue);
      |                                         ^~~~~~~~ 
/usr/include/gdal/cpl_json.h:131:10: error: 'void CPLJSONObject::Set(const std::string&, int)' cannot be overloaded with 'void CPLJSONObject::Set(const std::string&, int)'
  131 |     void Set(const std::string &osName, uint64_t nValue);
      |          ^~~                        
/usr/include/gdal/cpl_json.h:129:10: note: previous declaration 'void CPLJSONObject::Set(const std::string&, int)'
  129 |     void Set(const std::string &osName, int nValue);
      |          ^~~                             
/usr/include/gdal/cpl_json.h:245:14: error: 'uint64_t' has not been declared
  245 |     void Add(uint64_t nValue);
      |              ^~~~~~~~
/usr/include/gdal/cpl_json.h:245:10: error: 'void CPLJSONArray::Add(int)' cannot be overloaded with 'void CPLJSONArray::Add(int)'
  245 |     void Add(uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:243:10: note: previous declaration 'void CPLJSONArray::Add(int)'
  243 |     void Add(int nValue);
      |          ^~~
In file included from /usr/include/gdal/ogr_geometry.h:36,
                 from /usr/include/gdal/ogr_feature.h:36,
                 from /usr/include/gdal/ogrsf_frmts.h:35,
                 from ogrgrass.h:33,
                 from ogrgrasslayer.cpp:31:
/usr/include/gdal/cpl_json.h:97:36: error: expected ')' before 'nVal'
   97 |     explicit CPLJSONObject(uint64_t nVal);
      |                           ~        ^~~~~
      |                                    )
/usr/include/gdal/cpl_json.h:119:41: error: 'uint64_t' has not been declared
  119 |     void Add(const std::string &osName, uint64_t nValue);
      |                                         ^~~~~~~~
/usr/include/gdal/cpl_json.h:119:10: error: 'void CPLJSONObject::Add(const std::string&, int)' cannot be overloaded with 'void CPLJSONObject::Add(const std::string&, int)'
  119 |     void Add(const std::string &osName, uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:117:10: note: previous declaration 'void CPLJSONObject::Add(const std::string&, int)'
  117 |     void Add(const std::string &osName, int nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:131:41: error: 'uint64_t' has not been declared
  131 |     void Set(const std::string &osName, uint64_t nValue);
      |                                         ^~~~~~~~
/usr/include/gdal/cpl_json.h:131:10: error: 'void CPLJSONObject::Set(const std::string&, int)' cannot be overloaded with 'void CPLJSONObject::Set(const std::string&, int)'
  131 |     void Set(const std::string &osName, uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:129:10: note: previous declaration 'void CPLJSONObject::Set(const std::string&, int)'
  129 |     void Set(const std::string &osName, int nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:245:14: error: 'uint64_t' has not been declared
  245 |     void Add(uint64_t nValue);
      |              ^~~~~~~~
/usr/include/gdal/cpl_json.h:245:10: error: 'void CPLJSONArray::Add(int)' cannot be overloaded with 'void CPLJSONArray::Add(int)'
  245 |     void Add(uint64_t nValue);
      |          ^~~
/usr/include/gdal/cpl_json.h:243:10: note: previous declaration 'void CPLJSONArray::Add(int)'
  243 |     void Add(int nValue);
      |          ^~~
ogrgrassdriver.cpp: In function 'void RegisterOGRGRASS()':
ogrgrassdriver.cpp:99:39: warning: 'static OGRSFDriverRegistrar* OGRSFDriverRegistrar::GetRegistrar()' is deprecated [-Wdeprecated-declarations]
   99 |     OGRSFDriverRegistrar::GetRegistrar()->RegisterDriver( poDriver );
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/usr/include/gdal/ogrsf_frmts.h:592:34: note: declared here
  592 |     static OGRSFDriverRegistrar *GetRegistrar()
      |                                  ^~~~~~~~~~~~
ogrgrassdriver.cpp:99:57: warning: 'void OGRSFDriverRegistrar::RegisterDriver(OGRSFDriver*)' is deprecated [-Wdeprecated-declarations]
   99 |     OGRSFDriverRegistrar::GetRegistrar()->RegisterDriver( poDriver );
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/gdal/ogrsf_frmts.h:596:10: note: declared here
  596 |     void RegisterDriver(OGRSFDriver *poDriver)
      |          ^~~~~~~~~~~~~~

The full buildlog is attached.

libgdal-grass_1.0.2-7_amd64.build

cmake build issue on Fedora 38: Could NOT find PROJ (missing: PROJINC)

I have tried to compile the current driver version on my Fedora 38 box:

cmake .. -DAUTOLOAD_DIR=/usr/lib64/gdalplugin \
        -DGDAL_CONFIG_PREFER_PATH=/usr/bin/   -DGRASS_BIN_PREFER_PATH=$HOME/bin/
-- Found GDAL: /usr/lib64/libgdal.so (3.6.4)
-- Found GRASS_GISBASE: /home/mneteler/software/grass83/dist.x86_64-pc-linux-gnu (8.3.2dev)
-- Could NOT find PROJ (missing: PROJINC) 
-- Using /usr/lib64/gdalplugin as GDAL shared library autoload directory
-- Configuring done (0.5s)
-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    GDAL_CONFIG_PREFER_PATH

-- Build files have been written to: /home/mneteler/software/gdal-grass/build

Since I can successfully compile GRASS GIS on the same machine (start script in $HOME/bin/) I am a bit lost...

cd ~/software/gdal-grass
ag PROJINC
CMakeLists.txt
57:                     ${GRASS_INCLUDE} ${PROJINC})
66:                    ${GRASS_INCLUDE} ${PROJINC})

cmake/FindPROJ.cmake
10:set(PROJINC "")
12:get_grass_platform_var("${GRASS_GISBASE}/include/Make/Platform.make" "PROJINC"
13:                       PROJINC)
15:if(NOT "${PROJINC}" STREQUAL "")
16:  string(REGEX REPLACE "-I(.*)" "\\1" PROJINC "${PROJINC}")
20:find_package_handle_standard_args(PROJ REQUIRED_VARS PROJINC)

... seems to fail on my system.

Here my setup:

which grass 
~/bin/grass

grass --config
x86_64-pc-linux-gnu
./configure --with-cxx --enable-largefile --with-proj-share=/usr/share/proj --with-gdal=/usr/bin/gdal-config --with-geos --with-sqlite --with-nls --with-zstd --with-pdal --with-cairo --with-cairo-ldflags=-lfontconfig --with-freetype --with-freetype-includes=/usr/include/freetype2 --with-fftw --with-postgres --with-postgres-includes=/usr/include/pgsql --with-blas --with-blas-includes=/usr/include/atlas-x86_64-base/ --with-lapack --with-lapack-includes=/usr/include/atlas-x86_64-base/ --with-openmp --with-netcdf --without-bzlib --without-mysql --without-odbc CFLAGS=-g -Wall -Wstringop-truncation -Wshadow -Wlogical-op -Werror-implicit-function-declaration -fPIC -fno-common -fno-omit-frame-pointer -fexceptions -Wextra -Wunused -Wreturn-type -Wfatal-errors -march=native -std=gnu99 -fexceptions -fstack-protector -m64 -fdiagnostics-color LDFLAGS=-Wl,--no-undefined -Wl,-z,now CXXFLAGS=-g -Wall
gcc
/home/mneteler/software/grass83/dist.x86_64-pc-linux-gnu
/home/mneteler/software/grass83/dist.x86_64-pc-linux-gnu/etc/python
08018e34b2
8.3.2dev
2023-10-25T07:54:00+00:00

Ideas welcome :-)

vector: superfluous layer 0 reported for a polygon layer

Contrary to a point vector layer, for a polygon vector layer an extra layer "0" is reported as the first layer, containing linestrings and no attributes.

The examples below use vector data sources in the GRASS GIS 'North Carolina basic dataset', downloaded from https://grass.osgeo.org/download/data/.

ogrinfo polygons example (has the problem)
$ ogrinfo -so -al /home/floris/grassdata/nc_basic_spm_grass7/PERMANENT/vector/zipcodes/head
Warning 1: GRASS warning: GISBASE environment variable was not set, using:
/usr/lib/grass83
INFO: Open of `/home/floris/grassdata/nc_basic_spm_grass7/PERMANENT/vector/zipcodes/head'
      using driver `OGR_GRASS' successful.

Layer name: 0
Geometry: Line String
Feature Count: 158
Extent: (610047.866451, 196327.520901) - (677060.680666, 258102.572146)
Layer SRS WKT:
PROJCRS["unknown",
    BASEGEOGCRS["grs80",
        DATUM["North American Datum 1983",
            ELLIPSOID["Geodetic_Reference_System_1980",6378137,298.257222101,
                LENGTHUNIT["metre",1]],
            ID["EPSG",6269]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8901]]],
    CONVERSION["unnamed",
        METHOD["Lambert Conic Conformal (2SP)",
            ID["EPSG",9802]],
        PARAMETER["Latitude of false origin",33.75,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8821]],
        PARAMETER["Longitude of false origin",-79,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8822]],
        PARAMETER["Latitude of 1st standard parallel",36.1666666666667,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8823]],
        PARAMETER["Latitude of 2nd standard parallel",34.3333333333333,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8824]],
        PARAMETER["Easting at false origin",609601.22,
            LENGTHUNIT["metre",1],
            ID["EPSG",8826]],
        PARAMETER["Northing at false origin",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8827]]],
    CS[Cartesian,2],
        AXIS["easting",east,
            ORDER[1],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]],
        AXIS["northing",north,
            ORDER[2],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]]]
Data axis to CRS axis mapping: 1,2

Layer name: zipcodes
Geometry: Polygon
Feature Count: 48
Extent: (610047.866451, 196327.520901) - (677060.680666, 258102.572146)
Layer SRS WKT:
PROJCRS["unknown",
    BASEGEOGCRS["grs80",
        DATUM["North American Datum 1983",
            ELLIPSOID["Geodetic_Reference_System_1980",6378137,298.257222101,
                LENGTHUNIT["metre",1]],
            ID["EPSG",6269]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8901]]],
    CONVERSION["unnamed",
        METHOD["Lambert Conic Conformal (2SP)",
            ID["EPSG",9802]],
        PARAMETER["Latitude of false origin",33.75,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8821]],
        PARAMETER["Longitude of false origin",-79,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8822]],
        PARAMETER["Latitude of 1st standard parallel",36.1666666666667,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8823]],
        PARAMETER["Latitude of 2nd standard parallel",34.3333333333333,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8824]],
        PARAMETER["Easting at false origin",609601.22,
            LENGTHUNIT["metre",1],
            ID["EPSG",8826]],
        PARAMETER["Northing at false origin",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8827]]],
    CS[Cartesian,2],
        AXIS["easting",east,
            ORDER[1],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]],
        AXIS["northing",north,
            ORDER[2],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]]]
Data axis to CRS axis mapping: 1,2
cat: Integer (0.0)
OBJECTID: Integer (0.0)
WAKE_ZIPCO: Real (0.0)
PERIMETER: Real (0.0)
ZIPCODE_: Real (0.0)
ZIPCODE_ID: Real (0.0)
ZIPNAME: String (0.0)
ZIPNUM: Real (0.0)
ZIPCODE: String (0.0)
NAME: String (0.0)
SHAPE_Leng: Real (0.0)
SHAPE_Area: Real (0.0)
ogrinfo points example (is OK)
$ ogrinfo -so -al /home/floris/grassdata/nc_basic_spm_grass7/PERMANENT/vector/schools/head
Warning 1: GRASS warning: GISBASE environment variable was not set, using:
/usr/lib/grass83
INFO: Open of `/home/floris/grassdata/nc_basic_spm_grass7/PERMANENT/vector/schools/head'
      using driver `OGR_GRASS' successful.

Layer name: schools
Geometry: Point
Feature Count: 167
Extent: (619215.133883, 203559.011362) - (671714.551108, 248159.844411)
Layer SRS WKT:
PROJCRS["unknown",
    BASEGEOGCRS["grs80",
        DATUM["North American Datum 1983",
            ELLIPSOID["Geodetic_Reference_System_1980",6378137,298.257222101,
                LENGTHUNIT["metre",1]],
            ID["EPSG",6269]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8901]]],
    CONVERSION["unnamed",
        METHOD["Lambert Conic Conformal (2SP)",
            ID["EPSG",9802]],
        PARAMETER["Latitude of false origin",33.75,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8821]],
        PARAMETER["Longitude of false origin",-79,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8822]],
        PARAMETER["Latitude of 1st standard parallel",36.1666666666667,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8823]],
        PARAMETER["Latitude of 2nd standard parallel",34.3333333333333,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8824]],
        PARAMETER["Easting at false origin",609601.22,
            LENGTHUNIT["metre",1],
            ID["EPSG",8826]],
        PARAMETER["Northing at false origin",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8827]]],
    CS[Cartesian,2],
        AXIS["easting",east,
            ORDER[1],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]],
        AXIS["northing",north,
            ORDER[2],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]]]
Data axis to CRS axis mapping: 1,2
cat: Integer (0.0)
TAG: String (0.0)
NAMESHORT: String (0.0)
NAMELONG: String (0.0)
CORECAPACI: Real (0.0)
MOBILEUNIT: Real (0.0)
MOBILECAPA: Real (0.0)
GLEVEL: String (0.0)
LOGRADE: String (0.0)
HIGRADE: String (0.0)
CALENDAR: String (0.0)
HASBASE: String (0.0)
ISMAGNET: String (0.0)
PHONE: String (0.0)
ADDRNUMBER: String (0.0)
ADDRPREFIX: String (0.0)
ADDRROOT: String (0.0)
ADDRTYPE: String (0.0)
ADDRSUFFIX: String (0.0)
ADDRCITY: String (0.0)
ADDRZIPCOD: String (0.0)
SPED: Real (0.0)
STATUS: String (0.0)
NODEID: String (0.0)
CAPACITYTO: Real (0.0)
ESL: String (0.0)
BOARDDIS2: String (0.0)
PROJ_CAP: Real (0.0)
NOTES: String (0.0)

System specs:

$ ogrinfo --version
GDAL 3.8.4, released 2024/02/08
$ 
$ apt policy libgdal-grass
libgdal-grass:
  Installed: 1:1.0.2-7+jammy3
  Candidate: 1:1.0.2-7+jammy3
  Version table:
 *** 1:1.0.2-7+jammy3 500
        500 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status
     3.4.1-3 500
        500 http://ftp.belnet.be/ubuntu jammy/universe amd64 Packages
$ 
$ inxi -Sxxx
System:
  Host: xxx Kernel: 5.15.0-112-generic x86_64 bits: 64 compiler: gcc
    v: 11.4.0 Desktop: Cinnamon 6.0.4 tk: GTK 3.24.33 wm: muffin vt: 7
    dm: LightDM 1.30.0 Distro: Linux Mint 21.3 Virginia
    base: Ubuntu 22.04 jammy

Undefined symbol runtime error w/GDAL 3.5.1

Compiles fine against GDAL 3.5.1, but hitting undefined symbol errors with any kind of execution, which go away if I simply remove the GRASS plugins. My guess is a simple update is req to reflect changes in 3.5.1

  gdalinfo --version
    ERROR 1: /discover/swdev/sacs/sw/base/gcc12-3.5.1/gdal-3.5.1/lib/gdalplugins/ogr_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
    ERROR 1: /discover/swdev/sacs/sw/base/gcc12-3.5.1/gdal-3.5.1/lib/gdalplugins/ogr_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
    ERROR 1: /discover/swdev/sacs/sw/base/gcc12-3.5.1/gdal-3.5.1/lib/gdalplugins/gdal_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
    ERROR 1: /discover/swdev/sacs/sw/base/gcc12-3.5.1/gdal-3.5.1/lib/gdalplugins/gdal_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
    GDAL 3.5.1, released 2022/06/30

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.