Re: [gdal-dev] Use GitPod for GDAL?

2022-02-18 Thread Even Rouault

Matt,

you need to install the "libproj-dev" package.

Looking at the CI build recipees is a source of good hints in general: 
https://github.com/OSGeo/gdal/blob/6e6aff451dbcde450f051bff2f2e75ce6a4a3e6f/.github/workflows/cmake_builds.yml#L38 
(this one has pretty much all the pre packaged dependencies. you don't 
need all that)


Even

Le 18/02/2022 à 23:34, Matt Wilkie a écrit :

This what I've come up with:

https://gitpod.io

Create new >> search for gdal >> select OSGeo/gdal


On launch:

-- Could NOT find PROJ (missing: PROJ_DIR)

CMake Error at 
/home/linuxbrew/.linuxbrew/Cellar/cmake/3.22.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 
(message):


Could NOT find PROJ (missing: PROJ_LIBRARY PROJ_INCLUDE_DIR) (Required is

at least version "6.0")

Call Stack (most recent call first):

/home/linuxbrew/.linuxbrew/Cellar/cmake/3.22.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 
(_FPHSA_FAILURE_MESSAGE)


cmake/modules/packages/FindPROJ.cmake:57 
(find_package_handle_standard_args)


cmake/helpers/CheckDependentLibraries.cmake:303 (find_package)

gdal.cmake:210 (include)

CMakeLists.txt:206 (include)

Attempted to remedy this with `sudo apt install proj-bin` but same 
error from `cmake .`


-- 



The below adapted from 
https://github.com/maphew/gdal/blob/pr-5281-redux/CONTRIBUTING.md


cd /workspace/gdal

./autogen.sh

./configure --with-python

Fails with "configure: error: PROJ 6 symbols not found".

tried `sudo apt install proj-bin` and repeated above, same error.

Version of proj that's installed with this is 6.3.1.

Try building Proj from source (takes awhile):

cd /workspace

wget https://download.osgeo.org/proj/proj-6.3.1.tar.gz 



tar zxf proj-*.gz

cd proj-6.3.1

./configure

make && sudo make install

Now try again (takes much longer):

cd /workspace/gdal

./autogen.sh

./configure --with-python

make -j8

sudo make install

It works!

. scripts/setdevenv.sh

gdalinfo --version

GDAL 3.5.0dev-39057d7396, released 2022/02/18


uname -a
inux osgeo-gdal-j6a7bhjf0c8 5.13.0-1013-gcp #16-Ubuntu SMP Tue Jan 18 
14:31:35 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux



I'm still unable to successfully install a python wheel of gdal-utils, 
because pip is calling g++ which in turn is not finding libgdal, but 
it still feels like significant progress to get this far! :)


-matt

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


--
http://www.spatialys.com
My software is free, but my time generally not.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Use GitPod for GDAL?

2022-02-18 Thread Matt Wilkie
This what I've come up with:

https://gitpod.io

Create new >> search for gdal >> select OSGeo/gdal


On launch:



-- Could NOT find PROJ (missing: PROJ_DIR)

CMake Error at
/home/linuxbrew/.linuxbrew/Cellar/cmake/3.22.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230
(message):

  Could NOT find PROJ (missing: PROJ_LIBRARY PROJ_INCLUDE_DIR) (Required is

  at least version "6.0")

Call Stack (most recent call first):

  
/home/linuxbrew/.linuxbrew/Cellar/cmake/3.22.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594
(_FPHSA_FAILURE_MESSAGE)

  cmake/modules/packages/FindPROJ.cmake:57
(find_package_handle_standard_args)

  cmake/helpers/CheckDependentLibraries.cmake:303 (find_package)

  gdal.cmake:210 (include)

  CMakeLists.txt:206 (include)



Attempted to remedy this with `sudo apt install proj-bin` but same error
from `cmake .`



--




The below adapted from
https://github.com/maphew/gdal/blob/pr-5281-redux/CONTRIBUTING.md



cd /workspace/gdal

./autogen.sh

./configure --with-python



Fails with "configure: error: PROJ 6 symbols not found".

tried `sudo apt install proj-bin` and repeated above, same error.

Version of proj that's installed with this is 6.3.1.



Try building Proj from source (takes awhile):



cd /workspace

wget https://download.osgeo.org/proj/proj-6.3.1.tar.gz

tar zxf proj-*.gz

cd proj-6.3.1

./configure

make && sudo make install



Now try again (takes much longer):



cd /workspace/gdal

./autogen.sh

./configure --with-python

make -j8

sudo make install



It works!



. scripts/setdevenv.sh

gdalinfo --version

GDAL 3.5.0dev-39057d7396, released 2022/02/18


uname -a
inux osgeo-gdal-j6a7bhjf0c8 5.13.0-1013-gcp #16-Ubuntu SMP Tue Jan 18
14:31:35 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

I'm still unable to successfully install a python wheel of gdal-utils,
because pip is calling g++ which in turn is not finding libgdal, but it
still feels like significant progress to get this far! :)

-matt
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] Followup to Matching ESRI projection/transformations using GDAL/OSR

2022-02-18 Thread adamgutonski via gdal-dev
Hello,

I recently messaged about matching projection/transformations between GDAL/OSR 
and ESRI (gdal-dev Digest, Vol 213, Issue 35).

I had two follow-up questions regarding transforming from a geographic CRS to a 
projected CRS. When transforming from EPSG:6318 to a projected CRS EPSG:32015, 
the point values I receive are different than in ESRI. My first question is, 
when I am setting the 
osr.SetAxisMappingStrategy(osr.OAMS_TRADITIONAL_GIS_ORDER) parameter for 
EPSG:6318, why would the transformation points be different?

My second question is regarding the compound transformation that ESRI applies. 
In this example ArcPy uses the "WGS_1984_(ITRF00)_To_NAD_1983_2011 + 
NAD_1927_To_WGS_1984_3" transformation to project between EPSG:6318 and 
EPSG:32015. Is there a way to replicate such a transformation using the python 
GDAL/OSR libraries?

ESRI code:

arc_fromsr = arcpy.

SpatialReference

(6318)

arc_tosr = arcpy.

SpatialReference

(32015)

arcpoint = arcpy.

PointGeometry

(

arcpy.

Point

(

*

test_coords)

, arc_fromsr

)

transformers = arcpy.

ListTransformations

(

arc_fromsr, arc_tosr

)
# transformers[0] is WGS_1984_(ITRF00)_To_NAD_1983_2011 + NAD_1927_To_WGS_1984_3

new_arcpoint = arcpoint.

projectAs

(

arc_tosr, transformers

[0])

GDAL\OSR code:

to_nad = osr.

SpatialReference

()

to_nad.

ImportFromEPSG

(6318)

to_nad.

SetAxisMappingStrategy

(

osr.OAMS_TRADITIONAL_GIS_ORDER

)

final = osr.

SpatialReference

()

final.

ImportFromEPSG

(32015)

outpoint = ogr.

Geometry

(

ogr.wkbPoint

)

outpoint.

AddPoint_2D

(

*

test_coords)

outpoint.

AssignSpatialReference

(

to_nad

)

outpoint.

TransformTo

(

final

)

Input test coordinate: -73.964183, 40.785075

GDAL\OSR transformation output: 602119.3891505665, 286201.7616068426

ESRI\ArcPy transformation output: 602115.6116177095, 286190.512887311

Any help is again, greatly appreciated.

Sincerely,
Adam Gutonski

Sent with [ProtonMail](https://protonmail.com/) Secure Email.___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] Use GitPod for GDAL?

2022-02-18 Thread Matt Wilkie
Hi,

Does anyone know how to use https://gitpod.io to set up a gdal development
environment? I'm wondering if that might be an easy path for Windows folk
like myself to test changes against linux (e.g. like this one
https://github.com/OSGeo/gdal/pull/5296#issuecomment-1037141210).

I've tried creating one straight from Github repo using the GitPod browser
extension for Firefox. It appears to work quite well but there are errors
indicating some dependencies are missing.

No PROJ_DIR being the first. I attempted to remedy that with:

sudo apt-get install proj-bin

which worked well enough, but then "Could not find gdal-config. Make sure
you have installed the GDAL native library and development headers." and so
on when attempting to install python wheel.

-matt
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Gdal_translate into HDF4 fails

2022-02-18 Thread Lorenzo Di Giacomo
Cool, i tired and actually works, but just a question, is it normal that
using gdal_translate -of netCDF -co FORMAT=NC4  the resulting image is
rotated by 180° (Upside down)? Thanks

Il giorno ven 18 feb 2022 alle ore 15:39 Even Rouault <
even.roua...@spatialys.com> ha scritto:

> if you gdal_translate -of netCDF -co FORMAT=NC4 , the resulting netCDF
> file will actually be a HDF5 file (with netCDF "decorations"):
>
> - https://gdal.org/drivers/raster/netcdf.html#creation-options
>
> -
> https://www.unidata.ucar.edu/software/netcdf/docs/interoperability_hdf5.html
> Le 18/02/2022 à 15:24, Lorenzo Di Giacomo a écrit :
>
> Hi guys, i was reading the question and i was wondering if it's possibile
> do the same translate operation with HDF5, like:
> gdal_translate -of HDF5Image 3band.tif out.h5, i tried but doesn't work
> and says "
>
> HDF5 driver has no creation capabilities."
>
> Thanks
>
> -- http://www.spatialys.com
> My software is free, but my time generally not.
>
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Gdal_translate into HDF4 fails

2022-02-18 Thread Even Rouault
if you gdal_translate -of netCDF -co FORMAT=NC4 , the resulting netCDF 
file will actually be a HDF5 file (with netCDF "decorations"):


- https://gdal.org/drivers/raster/netcdf.html#creation-options

- 
https://www.unidata.ucar.edu/software/netcdf/docs/interoperability_hdf5.html


Le 18/02/2022 à 15:24, Lorenzo Di Giacomo a écrit :
Hi guys, i was reading the question and i was wondering if it's 
possibile do the same translate operation with HDF5, like:
gdal_translate -of HDF5Image 3band.tif out.h5, i tried but doesn't 
work and says "


HDF5 driver has no creation capabilities."

Thanks


--
http://www.spatialys.com
My software is free, but my time generally not.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Gdal_translate into HDF4 fails

2022-02-18 Thread Rahkonen Jukka (MML)
Hi,

That HDF5 driver is read-only is documented in 
https://gdal.org/drivers/raster/hdf5.html so that the driver capabilities are 
missing Supports CreateCopy() and Supports Create()

Same metadata is available with gdalinfo --format [format_name].

(But metadata is wrong for HDF4 and capabilities are missing, I wonder how to 
fix that)
gdalinfo --format hdf4
Format Details:
  Short Name: HDF4
  Long Name: Hierarchical Data Format Release 4
  Supports: Raster
  Supports: Multidimensional raster
  Extension: hdf
  Help Topic: drivers/raster/hdf4.html
  Supports: Raster subdatasets
  Supports: Open() - Open existing dataset.

-Jukka Rahkonen-

Lähettäjä: Lorenzo Di Giacomo 
Lähetetty: perjantai 18. helmikuuta 2022 16.24
Vastaanottaja: Even Rouault 
Kopio: Rahkonen Jukka (MML) ; 
'gdal-dev@lists.osgeo.org' (gdal-dev@lists.osgeo.org) 
Aihe: Re: [gdal-dev] Gdal_translate into HDF4 fails

Hi guys, i was reading the question and i was wondering if it's possibile do 
the same translate operation with HDF5, like:
gdal_translate -of HDF5Image 3band.tif out.h5, i tried but doesn't work and 
says "

HDF5 driver has no creation capabilities."

Thanks
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Gdal_translate into HDF4 fails

2022-02-18 Thread Lorenzo Di Giacomo
Hi guys, i was reading the question and i was wondering if it's possibile
do the same translate operation with HDF5, like:
gdal_translate -of HDF5Image 3band.tif out.h5, i tried but doesn't work and
says "

HDF5 driver has no creation capabilities."

Thanks
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Gdal_translate into HDF4 fails

2022-02-18 Thread Even Rouault
yes, this is sluggish . I just converted a 18002x22000 byte 3-band 
dataset in 28 minutes.


Le 18/02/2022 à 13:44, Rahkonen Jukka (MML) a écrit :


More information, probably it does not fail but it is extremely slow. 
After 15 minutes I am now at this stage


gdal_translate -of HDF4Image 3band.tif out.h4 --debug on

GDAL: GDALOpen(3band.tif, this=0215A20D36A0) succeeds as GTiff.

Input file size is 12000, 12000

GDAL: QuietDelete(out.h4) invoking Delete()

GDAL: GDALOpen(out.h4, this=0215A20BF880) succeeds as HDF4.

GDALPamDataset: In destructor with dirty metadata.

GDAL: GDALClose(out.h4, this=0215A20BF880)

GTiff: ScanDirectories()

GDAL: GDALDefaultOverviews::OverviewScan()

GDAL: Using default GDALDriver::CreateCopy implementation.

0GDAL: 
GDALDriver::Create(HDF4Image,out.h4,12000,12000,3,Byte,)


GDAL: GDAL_CACHEMAX = 1632 MB

GDAL: GDALDatasetCopyWholeRaster(): 12000*83 swaths, bInterleave=1

...10...20...30...40...50...60...70...80...90...100 - done.

GDAL: Flushing dirty blocks: 
0...10...20...30...40...50...60...70...80...90...100 - done.


GDAL: Flushing dirty blocks: 0...10...20...30.

-Jukka-

*Lähettäjä:*Rahkonen Jukka (MML)
*Lähetetty:* perjantai 18. helmikuuta 2022 14.09
*Vastaanottaja:* 'gdal-dev@lists.osgeo.org' 
*Aihe:* Gdal_translate into HDF4 fails

Hi,

There is a question about HDF4 in 
https://gis.stackexchange.com/questions/424204/convert-geotiff-to-hdf-using-gdal.


I tried the same with GDAL 3.4.0. With a single band image conversion 
from GeoTIFF into HDF4Image succeeds but with a 3 band image not. I am 
not sure if it is even supposed to work and the driver test in 
https://github.com/OSGeo/gdal/blob/master/autotest/gcore/hdf4_write.py 
is rather simplistic.


So, should “gdal_translate -of HDF4Image 3band.tif out3band.h4” work?

-Jukka Rahkonen-


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


--
http://www.spatialys.com
My software is free, but my time generally not.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Gdal_translate into HDF4 fails

2022-02-18 Thread Rahkonen Jukka (MML)
More information, probably it does not fail but it is extremely slow. After 15 
minutes I am now at this stage

gdal_translate -of HDF4Image 3band.tif out.h4 --debug on
GDAL: GDALOpen(3band.tif, this=0215A20D36A0) succeeds as GTiff.
Input file size is 12000, 12000
GDAL: QuietDelete(out.h4) invoking Delete()
GDAL: GDALOpen(out.h4, this=0215A20BF880) succeeds as HDF4.
GDALPamDataset: In destructor with dirty metadata.
GDAL: GDALClose(out.h4, this=0215A20BF880)
GTiff: ScanDirectories()
GDAL: GDALDefaultOverviews::OverviewScan()
GDAL: Using default GDALDriver::CreateCopy implementation.
0GDAL: GDALDriver::Create(HDF4Image,out.h4,12000,12000,3,Byte,)
GDAL: GDAL_CACHEMAX = 1632 MB
GDAL: GDALDatasetCopyWholeRaster(): 12000*83 swaths, bInterleave=1
...10...20...30...40...50...60...70...80...90...100 - done.
GDAL: Flushing dirty blocks: 
0...10...20...30...40...50...60...70...80...90...100 - done.
GDAL: Flushing dirty blocks: 0...10...20...30.


-Jukka-


Lähettäjä: Rahkonen Jukka (MML)
Lähetetty: perjantai 18. helmikuuta 2022 14.09
Vastaanottaja: 'gdal-dev@lists.osgeo.org' 
Aihe: Gdal_translate into HDF4 fails

Hi,

There is a question about HDF4 in 
https://gis.stackexchange.com/questions/424204/convert-geotiff-to-hdf-using-gdal.
I tried the same with GDAL 3.4.0. With a single band image conversion from 
GeoTIFF into HDF4Image succeeds but with a 3 band image not. I am not sure if 
it is even supposed to work and the driver test in 
https://github.com/OSGeo/gdal/blob/master/autotest/gcore/hdf4_write.py is 
rather simplistic.
So, should "gdal_translate -of HDF4Image 3band.tif out3band.h4" work?

-Jukka Rahkonen-

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] Gdal_translate into HDF4 fails

2022-02-18 Thread Rahkonen Jukka (MML)
Hi,

There is a question about HDF4 in 
https://gis.stackexchange.com/questions/424204/convert-geotiff-to-hdf-using-gdal.
I tried the same with GDAL 3.4.0. With a single band image conversion from 
GeoTIFF into HDF4Image succeeds but with a 3 band image not. I am not sure if 
it is even supposed to work and the driver test in 
https://github.com/OSGeo/gdal/blob/master/autotest/gcore/hdf4_write.py is 
rather simplistic.
So, should "gdal_translate -of HDF4Image 3band.tif out3band.h4" work?

-Jukka Rahkonen-

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev