Re: [gdal-dev] Where to fins my own files

2024-01-18 Thread Abel Pau via gdal-dev
Even, you are absolutely right.
I just realized it now.
Thanks, It works now!


De: Even Rouault 
Enviado el: dijous, 18 de gener de 2024 21:21
Para: Abel Pau 
CC: gdal-dev@lists.osgeo.org
Asunto: Re: [gdal-dev] Where to fins my own files



Le 18/01/2024 à 21:16, Abel Pau a écrit :
After all that process if I search for the file in all gdal it appears twice:
d:\GitHub-repository\gdal\ogr\ogrsf_frmts\miramon\data\MM_m_idofic.csv <-- OK; 
where it is...
Yes, this is the location of the source file, as stored in the git repository 
and in release source tarballs.


And here, with all other data files. It is correct?
d:\GitHub-repository\gdal\build\data\MM_m_idofic.csv

Yes, build artifact copied from source location by the logic at 
https://github.com/OSGeo/gdal/blob/a090314330026333eba534d50f74499ffee76d63/gdal.cmake#L671

As I mentioned yesterday, for development builds, you should change your 
GDAL_DATA env var now to point to d:\GitHub-repository\gdal\build\data

Even

De: gdal-dev 
<mailto:gdal-dev-boun...@lists.osgeo.org> En 
nombre de Abel Pau via gdal-dev
Enviado el: dijous, 18 de gener de 2024 21:13
Para: Even Rouault 
<mailto:even.roua...@spatialys.com>; 
gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org>
Asunto: Re: [gdal-dev] Where to fins my own files

Even,
thanks a lot.

I moved the file to {my 
GitHubDir}\GDAL\ogr\ogrsf_frmts\miramon\data\MM_m_idofic.csv
I changed my CMakeLists.txt  (see it below) as you indicated. And I deleted 
from gdal.cmake than now has only 5 files in there)
I rebased, deleted my gdal\build directory created the project again and built 
this.

An when I debug it seems that CPLFindFile("gdal", "MM_m_idofic.csv"); returns 
NULL. If I see inside it has only one locator and it seems that should be more, 
now...

I am missing something?

The CMakeLists
add_gdal_driver(
  TARGET ogr_MiraMon
  SOURCES ogrmiramondatasource.cpp ogrmiramondriver.cpp ogrmiramonlayer.cpp 
mm_wrlayr.c mm_gdal_functions.c mmrdlayr.c
  BUILTIN)
gdal_standard_includes(ogr_MiraMon)
target_include_directories(ogr_MiraMon PRIVATE 
$)

set(GDAL_DATA_FILES
${CMAKE_CURRENT_SOURCE_DIR}/data/MM_m_idofic.csv
)
set_property(
  TARGET ${GDAL_LIB_TARGET_NAME}
  APPEND
  PROPERTY RESOURCE "${GDAL_DATA_FILES}")

Thanks again


De: Even Rouault mailto:even.roua...@spatialys.com>>
Enviado el: dimecres, 17 de gener de 2024 17:13
Para: Abel Pau mailto:a@creaf.uab.cat>>; 
gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org>
Asunto: Re: [gdal-dev] Where to fins my own files


Abel,
Le 17/01/2024 à 15:50, Abel Pau a écrit :
Hi,
ok Even,

so, as my driver is not already online I have to do some changes at this part 
of the code, don’t I?

At this moment I have the file in the folder GDAL\data (my GDAL_DATA 
environment variable).
I call it like that.
aMMIDDBFFile=CPLFindFile("gdal", "MM_m_idofic.csv");

Do I have to move the file to somewhere? where?

I've merged the PR, so you can rebase on top of latest master

No change required in your .cpp file

The only change is to move the resource file into a data/ subdirectory within 
your ogr/ogrsf_frmts/ driver directory

and add in ogr/ogrsf_frmts/XXX/CMakeLists.txt

set(GDAL_DATA_FILES
${CMAKE_CURRENT_SOURCE_DIR}/data/MM_m_idofic.csv
)
set_property(
  TARGET ${GDAL_LIB_TARGET_NAME}
  APPEND
  PROPERTY RESOURCE "${GDAL_DATA_FILES}")

Even


--

http://www.spatialys.com

My software is free, but my time generally not.

--

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] Where to fins my own files

2024-01-18 Thread Even Rouault via gdal-dev


Le 18/01/2024 à 21:16, Abel Pau a écrit :


After all that process if I search for the file in all gdal it appears 
twice:


d:\GitHub-repository\gdal\ogr\ogrsf_frmts\miramon\data\MM_m_idofic.csv 
<-- OK; where it is...


Yes, this is the location of the source file, as stored in the git 
repository and in release source tarballs.


And here, with all other data files. It is correct?

d:\GitHub-repository\gdal\build\data\MM_m_idofic.csv

Yes, build artifact copied from source location by the logic at 
https://github.com/OSGeo/gdal/blob/a090314330026333eba534d50f74499ffee76d63/gdal.cmake#L671


As I mentioned yesterday, for development builds, you should change your 
GDAL_DATA env var now to point to d:\GitHub-repository\gdal\build\data


Even

*De:*gdal-dev  *En nombre de *Abel 
Pau via gdal-dev

*Enviado el:* dijous, 18 de gener de 2024 21:13
*Para:* Even Rouault ; 
gdal-dev@lists.osgeo.org

*Asunto:* Re: [gdal-dev] Where to fins my own files

Even,

thanks a lot.

I moved the file to {my 
GitHubDir}\GDAL\ogr\ogrsf_frmts\miramon\data\MM_m_idofic.csv


I changed my CMakeLists.txt  (see it below) as you indicated. And I 
deleted from gdal.cmake than now has only 5 files in there)


I rebased, deleted my gdal\build directory created the project again 
and built this.


An when I debug it seems that CPLFindFile("gdal", 
"MM_m_idofic.csv");returns NULL. If I see inside it has only one 
locator and it seems that should be more, now...


I am missing something?

The CMakeLists

add_gdal_driver(

TARGETogr_MiraMon

SOURCESogrmiramondatasource.cpp ogrmiramondriver.cpp 
ogrmiramonlayer.cpp mm_wrlayr.c mm_gdal_functions.c mmrdlayr.c


BUILTIN)

gdal_standard_includes(ogr_MiraMon)

target_include_directories(ogr_MiraMon 
PRIVATE$)


set(GDAL_DATA_FILES

*${CMAKE_CURRENT_SOURCE_DIR}*/data/MM_m_idofic.csv

)

set_property(

TARGET*${GDAL_LIB_TARGET_NAME}*

APPEND

PROPERTY RESOURCE"*${GDAL_DATA_FILES}*")

Thanks again

*De:*Even Rouault 
*Enviado el:* dimecres, 17 de gener de 2024 17:13
*Para:* Abel Pau ; gdal-dev@lists.osgeo.org
*Asunto:* Re: [gdal-dev] Where to fins my own files

Abel,

Le 17/01/2024 à 15:50, Abel Pau a écrit :

Hi,

ok Even,

so, as my driver is not already online I have to do some changes
at this part of the code, don’t I?

At this moment I have the file in the folder GDAL\data (my
GDAL_DATA environment variable).

I call it like that.

aMMIDDBFFile=CPLFindFile("gdal", "MM_m_idofic.csv");

Do I have to move the file to somewhere? where?

I've merged the PR, so you can rebase on top of latest master

No change required in your .cpp file

The only change is to move the resource file into a data/ subdirectory 
within your ogr/ogrsf_frmts/ driver directory


and add in ogr/ogrsf_frmts/XXX/CMakeLists.txt


set(GDAL_DATA_FILES
    ${CMAKE_CURRENT_SOURCE_DIR}/data/MM_m_idofic.csv
)
set_property(
  TARGET ${GDAL_LIB_TARGET_NAME}
  APPEND
  PROPERTY RESOURCE "${GDAL_DATA_FILES}")

Even

--
http://www.spatialys.com
My software is free, but my time generally not.


--
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] Where to fins my own files

2024-01-18 Thread Abel Pau via gdal-dev
After all that process if I search for the file in all gdal it appears twice:
d:\GitHub-repository\gdal\ogr\ogrsf_frmts\miramon\data\MM_m_idofic.csv <-- OK; 
where it is...

And here, with all other data files. It is correct?
d:\GitHub-repository\gdal\build\data\MM_m_idofic.csv

De: gdal-dev  En nombre de Abel Pau via 
gdal-dev
Enviado el: dijous, 18 de gener de 2024 21:13
Para: Even Rouault ; gdal-dev@lists.osgeo.org
Asunto: Re: [gdal-dev] Where to fins my own files

Even,
thanks a lot.

I moved the file to {my 
GitHubDir}\GDAL\ogr\ogrsf_frmts\miramon\data\MM_m_idofic.csv
I changed my CMakeLists.txt  (see it below) as you indicated. And I deleted 
from gdal.cmake than now has only 5 files in there)
I rebased, deleted my gdal\build directory created the project again and built 
this.

An when I debug it seems that CPLFindFile("gdal", "MM_m_idofic.csv"); returns 
NULL. If I see inside it has only one locator and it seems that should be more, 
now...

I am missing something?

The CMakeLists
add_gdal_driver(
  TARGET ogr_MiraMon
  SOURCES ogrmiramondatasource.cpp ogrmiramondriver.cpp ogrmiramonlayer.cpp 
mm_wrlayr.c mm_gdal_functions.c mmrdlayr.c
  BUILTIN)
gdal_standard_includes(ogr_MiraMon)
target_include_directories(ogr_MiraMon PRIVATE 
$)

set(GDAL_DATA_FILES
${CMAKE_CURRENT_SOURCE_DIR}/data/MM_m_idofic.csv
)
set_property(
  TARGET ${GDAL_LIB_TARGET_NAME}
  APPEND
  PROPERTY RESOURCE "${GDAL_DATA_FILES}")

Thanks again


De: Even Rouault mailto:even.roua...@spatialys.com>>
Enviado el: dimecres, 17 de gener de 2024 17:13
Para: Abel Pau mailto:a@creaf.uab.cat>>; 
gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org>
Asunto: Re: [gdal-dev] Where to fins my own files


Abel,
Le 17/01/2024 à 15:50, Abel Pau a écrit :
Hi,
ok Even,

so, as my driver is not already online I have to do some changes at this part 
of the code, don’t I?

At this moment I have the file in the folder GDAL\data (my GDAL_DATA 
environment variable).
I call it like that.
aMMIDDBFFile=CPLFindFile("gdal", "MM_m_idofic.csv");

Do I have to move the file to somewhere? where?

I've merged the PR, so you can rebase on top of latest master

No change required in your .cpp file

The only change is to move the resource file into a data/ subdirectory within 
your ogr/ogrsf_frmts/ driver directory

and add in ogr/ogrsf_frmts/XXX/CMakeLists.txt

set(GDAL_DATA_FILES
${CMAKE_CURRENT_SOURCE_DIR}/data/MM_m_idofic.csv
)
set_property(
  TARGET ${GDAL_LIB_TARGET_NAME}
  APPEND
  PROPERTY RESOURCE "${GDAL_DATA_FILES}")

Even


--

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] Where to fins my own files

2024-01-18 Thread Abel Pau via gdal-dev
Even,
thanks a lot.

I moved the file to {my 
GitHubDir}\GDAL\ogr\ogrsf_frmts\miramon\data\MM_m_idofic.csv
I changed my CMakeLists.txt  (see it below) as you indicated. And I deleted 
from gdal.cmake than now has only 5 files in there)
I rebased, deleted my gdal\build directory created the project again and built 
this.

An when I debug it seems that CPLFindFile("gdal", "MM_m_idofic.csv"); returns 
NULL. If I see inside it has only one locator and it seems that should be more, 
now...

I am missing something?

The CMakeLists
add_gdal_driver(
  TARGET ogr_MiraMon
  SOURCES ogrmiramondatasource.cpp ogrmiramondriver.cpp ogrmiramonlayer.cpp 
mm_wrlayr.c mm_gdal_functions.c mmrdlayr.c
  BUILTIN)
gdal_standard_includes(ogr_MiraMon)
target_include_directories(ogr_MiraMon PRIVATE 
$)

set(GDAL_DATA_FILES
${CMAKE_CURRENT_SOURCE_DIR}/data/MM_m_idofic.csv
)
set_property(
  TARGET ${GDAL_LIB_TARGET_NAME}
  APPEND
  PROPERTY RESOURCE "${GDAL_DATA_FILES}")

Thanks again


De: Even Rouault 
Enviado el: dimecres, 17 de gener de 2024 17:13
Para: Abel Pau ; gdal-dev@lists.osgeo.org
Asunto: Re: [gdal-dev] Where to fins my own files


Abel,
Le 17/01/2024 à 15:50, Abel Pau a écrit :
Hi,
ok Even,

so, as my driver is not already online I have to do some changes at this part 
of the code, don’t I?

At this moment I have the file in the folder GDAL\data (my GDAL_DATA 
environment variable).
I call it like that.
aMMIDDBFFile=CPLFindFile("gdal", "MM_m_idofic.csv");

Do I have to move the file to somewhere? where?

I've merged the PR, so you can rebase on top of latest master

No change required in your .cpp file

The only change is to move the resource file into a data/ subdirectory within 
your ogr/ogrsf_frmts/ driver directory

and add in ogr/ogrsf_frmts/XXX/CMakeLists.txt

set(GDAL_DATA_FILES
${CMAKE_CURRENT_SOURCE_DIR}/data/MM_m_idofic.csv
)
set_property(
  TARGET ${GDAL_LIB_TARGET_NAME}
  APPEND
  PROPERTY RESOURCE "${GDAL_DATA_FILES}")

Even



--

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] Where to fins my own files

2024-01-17 Thread Even Rouault via gdal-dev

Abel,

Le 17/01/2024 à 15:50, Abel Pau a écrit :


Hi,

ok Even,

so, as my driver is not already online I have to do some changes at 
this part of the code, don’t I?


At this moment I have the file in the folder GDAL\data (my GDAL_DATA 
environment variable).


I call it like that.

aMMIDDBFFile=CPLFindFile("gdal", "MM_m_idofic.csv");

Do I have to move the file to somewhere? where?


I've merged the PR, so you can rebase on top of latest master

No change required in your .cpp file

The only change is to move the resource file into a data/ subdirectory 
within your ogr/ogrsf_frmts/ driver directory


and add in ogr/ogrsf_frmts/XXX/CMakeLists.txt


set(GDAL_DATA_FILES
    ${CMAKE_CURRENT_SOURCE_DIR}/data/MM_m_idofic.csv
)
set_property(
  TARGET ${GDAL_LIB_TARGET_NAME}
  APPEND
  PROPERTY RESOURCE "${GDAL_DATA_FILES}")

Even


--
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] Where to fins my own files

2024-01-17 Thread Abel Pau via gdal-dev
Hi,
ok Even,

so, as my driver is not already online I have to do some changes at this part 
of the code, don’t I?

At this moment I have the file in the folder GDAL\data (my GDAL_DATA 
environment variable).
I call it like that.
aMMIDDBFFile=CPLFindFile("gdal", "MM_m_idofic.csv");

Do I have to move the file to somewhere? where?
Sorry cause it’s difficult for me imagine what to do.

Thanks




De: Even Rouault 
Enviado el: dimarts, 16 de gener de 2024 16:38
Para: Abel Pau ; gdal-dev@lists.osgeo.org
Asunto: Re: [gdal-dev] Where to fins my own files


Hi,

actually the below question made me reconsider the current monolithic approach 
how data files are store in the source tree, to a cleaner one where each driver 
stores its potential data files in a specifc subdirectory and is responsible to 
install them (still in $prefix/share/gdal) :  
https://github.com/OSGeo/gdal/pull/9087 . This improves relating data files to 
the driver that need them.

This has no impact on the installed artifacts. Note that when working with a 
development build, GDAL_DATA should now point to ${top_build_dir}/data, and no 
longer to ${top_source_dir}/data.

Even
Le 06/01/2024 à 22:32, Abel Pau via gdal-dev a écrit :
Hi,
Happy New 2024 to everyone who celebrates it!

I am programming a driver and in some point I need to read a file that contains 
some information (and it’s better to keep this in a file than in c code) about 
the Horizontal Reference System.
I have this file here: “GDAL\ogr\ogrsf_frmts\miramon”, but when coding I don’t 
know how to get to this folder.

There is any method to open a file (using VSIFOpenL(), for instance) in THIS 
specific directory? Can I use “GDAL\ogr\ogrsd_frmts\miramon” like that?

If not, where can I put this file to be found when executing the code? And how 
to write this path in the code?

Thanks in advance!!



Abel Pau Garcia
GIS developer
[https://www.creaf.cat/sites/default/files/creaf-signature.png]
a@creaf.uab.cat<mailto:a@creaf.uab.cat>
Let's chat on 
Teams!<https://teams.microsoft.com/l/chat/0/0?users=a@creaf.uab.cat>
Tel. +34 934814277
[https://www.creaf.cat/sites/default/files/so-en-signature.png]
[https://www.creaf.cat/sites/default/files/twitter-icon-signature.png]<https://twitter.com/CREAF_ecologia>[https://www.creaf.cat/sites/default/files/linkedin-icon-signature.png]<https://www.linkedin.com/company/1363052?trk=tyah=clickedVertical:company,clickedEntityId:1363052,idx:2-1-2,tarId:1465807877789,tas:creaf>[https://www.creaf.cat/sites/default/files/youtube-icon-signature.png]<https://www.youtube.com/c/creafecologia>[https://www.creaf.cat/sites/default/files/instagram-icon-signature.png]<https://www.instagram.com/CREAF_ecologia/>
www.creaf.cat<http://www.creaf.cat> | http://blog.creaf.cat
[https://www.creaf.cat/sites/default/files/uab_logo_signatura.png]
CREAF. Campus UAB. Edifici C. 08193 Bellaterra (Barcelona)

Before printing this electronic message, think about the environment.






___

gdal-dev mailing list

gdal-dev@lists.osgeo.org<mailto: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] Where to fins my own files

2024-01-16 Thread Even Rouault via gdal-dev

Hi,

actually the below question made me reconsider the current monolithic 
approach how data files are store in the source tree, to a cleaner one 
where each driver stores its potential data files in a specifc 
subdirectory and is responsible to install them (still in 
$prefix/share/gdal) : https://github.com/OSGeo/gdal/pull/9087 . This 
improves relating data files to the driver that need them.


This has no impact on the installed artifacts. Note that when working 
with a development build, GDAL_DATA should now point to 
${top_build_dir}/data, and no longer to ${top_source_dir}/data.


Even

Le 06/01/2024 à 22:32, Abel Pau via gdal-dev a écrit :


Hi,

Happy New 2024 to everyone who celebrates it!

I am programming a driver and in some point I need to read a file that 
contains some information (and it’s better to keep this in a file than 
in c code) about the Horizontal Reference System.


I have this file here: “GDAL\ogr\ogrsf_frmts\miramon”, but when coding 
I don’t know how to get to this folder.


There is any method to open a file (using VSIFOpenL(), for instance) 
in THIS specific directory? Can I use “GDAL\ogr\ogrsd_frmts\miramon” 
like that?


If not, where can I put this file to be found when executing the code? 
And how to write this path in the code?


Thanks in advance!!

*Abel Pau Garcia*

*GIS developer*



https://www.creaf.cat/sites/default/files/creaf-signature.png

*a@creaf.uab.cat* 

*Let's chat on Teams!* 



*Tel. +34 934814277*



https://www.creaf.cat/sites/default/files/so-en-signature.png

https://www.creaf.cat/sites/default/files/twitter-icon-signature.png 
https://www.creaf.cat/sites/default/files/linkedin-icon-signature.png 
https://www.creaf.cat/sites/default/files/youtube-icon-signature.png 
https://www.creaf.cat/sites/default/files/instagram-icon-signature.png 



*www.creaf.cat* *| **http://blog.creaf.cat* 





https://www.creaf.cat/sites/default/files/uab_logo_signatura.png

CREAF. Campus UAB. Edifici C. 08193 Bellaterra (Barcelona)


Before printing this electronic message, think about the environment.

http://www.creaf.uab.cat/_signatura/line.gif


___
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] Where to fins my own files

2024-01-09 Thread Even Rouault via gdal-dev
We are in the final stages of developing the vector driver, and 
afterward, we will start work on the raster driver. I believe the 
optimal approach is to submit the vector driver first. This way, we 
can learn from any potential mistakes in the vector part and apply the 
necessary corrections directly to the raster part. What are your thoughts?



Yes, starting with one driver first is a good idea

Even

--
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] Where to fins my own files

2024-01-09 Thread Abel Pau via gdal-dev
Hi Even,

sure, as you need. We are used to the DBF format; our structure comprises one 
file for the geographic component, another for metadata, and a DBF for 
non-geographic attribute data. We have the capability to edit it using a 
dedicated editor. However, I acknowledge that it might be more beneficial for 
everyone not to use this format for a file that may require editing if 
necessary. Given that our objective is to integrate the Vector MiraMon driver 
(we are finalizing details and more details), we are open to making this change.

Thank you for bringing that to my attention.

By the way, we not only have the vector format I mentioned but also a raster 
format.

We are in the final stages of developing the vector driver, and afterward, we 
will start work on the raster driver. I believe the optimal approach is to 
submit the vector driver first. This way, we can learn from any potential 
mistakes in the vector part and apply the necessary corrections directly to the 
raster part. What are your thoughts?

Best regards,
Abel



De: Even Rouault 
Enviado el: dimarts, 9 de gener de 2024 13:13
Para: Abel Pau 
CC: gdal dev 
Asunto: Re: [gdal-dev] Where to fins my own files


Actually thinking that if your intent is to upstream the driver at some point, 
a CSV resource file would be better than a DBF one, because CSV is text 
(whereas DBF is somehow binary, or at least not directly editable), which makes 
it more appropriate for review & editing.
Le 07/01/2024 à 22:06, Abel Pau a écrit :
Yes, it’s just what I found now!!
Thanks a lot Even! It works now!!

De: Even Rouault <mailto:even.roua...@spatialys.com>
Enviado el: diumenge, 7 de gener de 2024 22:06
Para: Abel Pau <mailto:a@creaf.uab.cat>; Sean Gillies 
<mailto:sean.gill...@gmail.com>
CC: gdal dev <mailto:gdal-dev@lists.osgeo.org>
Asunto: Re: [gdal-dev] Where to fins my own files



Le 07/01/2024 à 21:59, Abel Pau a écrit :
Thanks for your answers.

When I call aMMIDDBFFile=CPLFindFile("gdal", "MM_m_idofic.dbf");
NULL pointer is obtained and I think I know why. When debuging there are 2 
FinderLocations:
The first one is “D:\GitHub-repository\GDAL\data;” (note thar there is a “;” at 
the end).

Is the GDAL_DATA environment variable set in your environment ? If so, just 
remove the trailing ';' . GDAL_DATA doesn't support multiple paths

--

http://www.spatialys.com

My software is free, but my time generally not.

--

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] Where to fins my own files

2024-01-09 Thread Even Rouault via gdal-dev
Actually thinking that if your intent is to upstream the driver at some 
point, a CSV resource file would be better than a DBF one, because CSV 
is text (whereas DBF is somehow binary, or at least not directly 
editable), which makes it more appropriate for review & editing.


Le 07/01/2024 à 22:06, Abel Pau a écrit :


Yes, it’s just what I found now!!

Thanks a lot Even! It works now!!

*De:*Even Rouault 
*Enviado el:* diumenge, 7 de gener de 2024 22:06
*Para:* Abel Pau ; Sean Gillies 


*CC:* gdal dev 
*Asunto:* Re: [gdal-dev] Where to fins my own files

Le 07/01/2024 à 21:59, Abel Pau a écrit :

Thanks for your answers.

When I call aMMIDDBFFile=CPLFindFile("gdal", "MM_m_idofic.dbf");

NULL pointer is obtained and I think I know why. When debuging
there are 2 FinderLocations:

The first one is “D:\GitHub-repository\GDAL\data;” (note thar
there is a “;” at the end).

Is the GDAL_DATA environment variable set in your environment ? If so, 
just remove the trailing ';' . GDAL_DATA doesn't support multiple paths


--
http://www.spatialys.com
My software is free, but my time generally not.


--
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] Where to fins my own files

2024-01-07 Thread Abel Pau via gdal-dev
Yes, it’s just what I found now!!
Thanks a lot Even! It works now!!

De: Even Rouault 
Enviado el: diumenge, 7 de gener de 2024 22:06
Para: Abel Pau ; Sean Gillies 
CC: gdal dev 
Asunto: Re: [gdal-dev] Where to fins my own files



Le 07/01/2024 à 21:59, Abel Pau a écrit :
Thanks for your answers.

When I call aMMIDDBFFile=CPLFindFile("gdal", "MM_m_idofic.dbf");
NULL pointer is obtained and I think I know why. When debuging there are 2 
FinderLocations:
The first one is “D:\GitHub-repository\GDAL\data;” (note thar there is a “;” at 
the end).

Is the GDAL_DATA environment variable set in your environment ? If so, just 
remove the trailing ';' . GDAL_DATA doesn't support multiple paths

--

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] Where to fins my own files

2024-01-07 Thread Even Rouault via gdal-dev


Le 07/01/2024 à 21:59, Abel Pau a écrit :


Thanks for your answers.

When I call aMMIDDBFFile=CPLFindFile("gdal", "MM_m_idofic.dbf");

NULL pointer is obtained and I think I know why. When debuging there 
are 2 FinderLocations:


The first one is “D:\GitHub-repository\GDAL\data;” (note thar there is 
a “;” at the end).


Is the GDAL_DATA environment variable set in your environment ? If so, 
just remove the trailing ';' . GDAL_DATA doesn't support multiple paths


--
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] Where to fins my own files

2024-01-07 Thread Abel Pau via gdal-dev
Thanks for your answers.

When I call aMMIDDBFFile=CPLFindFile("gdal", "MM_m_idofic.dbf");
NULL pointer is obtained and I think I know why. When debuging there are 2 
FinderLocations:
The first one is “D:\GitHub-repository\GDAL\data;” (note thar there is a “;” at 
the end).
When tries to compose with MM_m_idofic.dbf (the file copied in “data” folder) I 
obtain: “D:\GitHub-repository\GDAL\data;\MM_m_idofic.dbf”

So, debugging more ERROR_PATH_NOT_FOUND is returned. And I think that “;” is 
the problem, isn’t it?

Has any sense all I am saying? Or I have something wrong anywhere? Thanks!!

Sean,
> For datum files, have you checked whether they already exist in the PROJ 
> project?
This MM_m_idofic.dbf file is a table of synonyms between the internal SRH 
identifiers of MiraMon and the EPSG you all know.
So, it’s only a help to find the EPSG of a MiraMon layer when translatinc a 
MiraMon layer to another.

Thanks you all and I keep waiting for any help about the misterious “;”.



De: Even Rouault 
Enviado el: diumenge, 7 de gener de 2024 12:20
Para: Sean Gillies ; Abel Pau 
CC: gdal dev 
Asunto: Re: [gdal-dev] Where to fins my own files


Yes, the practice for a resource file is:

- put it under data/

- add it to the GDAL_DATA_FILES variable on top level gdal.cmake file

- use CPLFindFile("gdal", "your.file") to get its path
Le 07/01/2024 à 01:59, Sean Gillies via gdal-dev a écrit :
Happy New Year to you too, Abel.

Other drivers, such as PCI and NITF,  include some files in the data directory. 
 See  https://github.com/OSGeo/gdal/tree/master/data. Distributions generally 
copy these to $prefix/share/gdal on unix-like systems. I'm not aware of a 
practice of copying data out of a driver's directory to that same location, 
though it's probably possible with Cmake. Your driver's own directory won't 
necessarily exist on a system where you install GDAL.

For datum files, have you checked whether they already exist in the PROJ 
project?
On Sat, Jan 6, 2024, 2:32 PM Abel Pau via gdal-dev 
mailto:gdal-dev@lists.osgeo.org>> wrote:
Hi,
Happy New 2024 to everyone who celebrates it!

I am programming a driver and in some point I need to read a file that contains 
some information (and it’s better to keep this in a file than in c code) about 
the Horizontal Reference System.
I have this file here: “GDAL\ogr\ogrsf_frmts\miramon”, but when coding I don’t 
know how to get to this folder.

There is any method to open a file (using VSIFOpenL(), for instance) in THIS 
specific directory? Can I use “GDAL\ogr\ogrsd_frmts\miramon” like that?

If not, where can I put this file to be found when executing the code? And how 
to write this path in the code?

Thanks in advance!!



Abel Pau Garcia
GIS developer
[https://www.creaf.cat/sites/default/files/creaf-signature.png]
a@creaf.uab.cat<mailto:a@creaf.uab.cat>
Let's chat on 
Teams!<https://teams.microsoft.com/l/chat/0/0?users=a@creaf.uab.cat>
Tel. +34 934814277
[https://www.creaf.cat/sites/default/files/so-en-signature.png]
[https://www.creaf.cat/sites/default/files/twitter-icon-signature.png]<https://twitter.com/CREAF_ecologia>[https://www.creaf.cat/sites/default/files/linkedin-icon-signature.png]<https://www.linkedin.com/company/1363052?trk=tyah=clickedVertical:company,clickedEntityId:1363052,idx:2-1-2,tarId:1465807877789,tas:creaf>[https://www.creaf.cat/sites/default/files/youtube-icon-signature.png]<https://www.youtube.com/c/creafecologia>[https://www.creaf.cat/sites/default/files/instagram-icon-signature.png]<https://www.instagram.com/CREAF_ecologia/>
www.creaf.cat<http://www.creaf.cat> | http://blog.creaf.cat
[https://www.creaf.cat/sites/default/files/uab_logo_signatura.png]
CREAF. Campus UAB. Edifici C. 08193 Bellaterra (Barcelona)

Before printing this electronic message, think about the environment.



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



___

gdal-dev mailing list

gdal-dev@lists.osgeo.org<mailto: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] Where to fins my own files

2024-01-07 Thread Even Rouault via gdal-dev

Yes, the practice for a resource file is:

- put it under data/

- add it to the GDAL_DATA_FILES variable on top level gdal.cmake file

- use CPLFindFile("gdal", "your.file") to get its path

Le 07/01/2024 à 01:59, Sean Gillies via gdal-dev a écrit :

Happy New Year to you too, Abel.

Other drivers, such as PCI and NITF,  include some files in the data 
directory.  See https://github.com/OSGeo/gdal/tree/master/data. 
Distributions generally copy these to $prefix/share/gdal on unix-like 
systems. I'm not aware of a practice of copying data out of a driver's 
directory to that same location, though it's probably possible with 
Cmake. Your driver's own directory won't necessarily exist on a system 
where you install GDAL.


For datum files, have you checked whether they already exist in the 
PROJ project?


On Sat, Jan 6, 2024, 2:32 PM Abel Pau via gdal-dev 
 wrote:


Hi,

Happy New 2024 to everyone who celebrates it!

I am programming a driver and in some point I need to read a file
that contains some information (and it’s better to keep this in a
file than in c code) about the Horizontal Reference System.

I have this file here: “GDAL\ogr\ogrsf_frmts\miramon”, but when
coding I don’t know how to get to this folder.

There is any method to open a file (using VSIFOpenL(), for
instance) in THIS specific directory? Can I use
“GDAL\ogr\ogrsd_frmts\miramon” like that?

If not, where can I put this file to be found when executing the
code? And how to write this path in the code?

Thanks in advance!!

*Abel Pau Garcia*

*GIS developer*



https://www.creaf.cat/sites/default/files/creaf-signature.png

*a@creaf.uab.cat* 

*Let's chat on Teams!*


*Tel. +34 934814277*



https://www.creaf.cat/sites/default/files/so-en-signature.png

https://www.creaf.cat/sites/default/files/twitter-icon-signature.png

https://www.creaf.cat/sites/default/files/linkedin-icon-signature.png

https://www.creaf.cat/sites/default/files/youtube-icon-signature.png

https://www.creaf.cat/sites/default/files/instagram-icon-signature.png


*www.creaf.cat* *| **http://blog.creaf.cat*




https://www.creaf.cat/sites/default/files/uab_logo_signatura.png

CREAF. Campus UAB. Edifici C. 08193 Bellaterra (Barcelona)


Before printing this electronic message, think about the environment.

http://www.creaf.uab.cat/_signatura/line.gif

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


___
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] Where to fins my own files

2024-01-06 Thread Sean Gillies via gdal-dev
Happy New Year to you too, Abel.

Other drivers, such as PCI and NITF,  include some files in the data
directory.  See  https://github.com/OSGeo/gdal/tree/master/data.
Distributions generally copy these to $prefix/share/gdal on unix-like
systems. I'm not aware of a practice of copying data out of a driver's
directory to that same location, though it's probably possible with Cmake.
Your driver's own directory won't necessarily exist on a system where you
install GDAL.

For datum files, have you checked whether they already exist in the PROJ
project?

On Sat, Jan 6, 2024, 2:32 PM Abel Pau via gdal-dev 
wrote:

> Hi,
>
> Happy New 2024 to everyone who celebrates it!
>
>
>
> I am programming a driver and in some point I need to read a file that
> contains some information (and it’s better to keep this in a file than in c
> code) about the Horizontal Reference System.
>
> I have this file here: “GDAL\ogr\ogrsf_frmts\miramon”, but when coding I
> don’t know how to get to this folder.
>
>
>
> There is any method to open a file (using VSIFOpenL(), for instance) in
> THIS specific directory? Can I use “GDAL\ogr\ogrsd_frmts\miramon” like that?
>
> If not, where can I put this file to be found when executing the code? And
> how to write this path in the code?
>
> Thanks in advance!!
>
>
>
>
>
>
>
> *Abel Pau Garcia*
>
> *GIS developer*
>
> [image: https://www.creaf.cat/sites/default/files/creaf-signature.png]
>
> *a@creaf.uab.cat* 
>
> *Let's chat on Teams!*
> 
>
> *Tel. +34 934814277*
>
> [image: https://www.creaf.cat/sites/default/files/so-en-signature.png]
>
> [image:
> https://www.creaf.cat/sites/default/files/twitter-icon-signature.png]
> [image:
> https://www.creaf.cat/sites/default/files/linkedin-icon-signature.png]
> [image:
> https://www.creaf.cat/sites/default/files/youtube-icon-signature.png]
> [image:
> https://www.creaf.cat/sites/default/files/instagram-icon-signature.png]
> 
>
> *www.creaf.cat* * | **http://blog.creaf.cat*
> 
>
> [image: https://www.creaf.cat/sites/default/files/uab_logo_signatura.png]
>
> CREAF. Campus UAB. Edifici C. 08193 Bellaterra (Barcelona)
>
>
> Before printing this electronic message, think about the environment.
>
> [image: http://www.creaf.uab.cat/_signatura/line.gif]
>
>
>
>
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev