Re: [gdal-dev] GPKG to PG single transaction, different schemas

2024-05-15 Thread Matteo Ghetta via gdal-dev
recent call last): File "/home/matteo/import_export/ogr2vrt.py", line 353, in sys.exit(main(sys.argv)) ^^ File "/home/matteo/import_export/ogr2vrt.py", line 329, in main if src_fd.GetComment(): ^ AttributeError: '

[gdal-dev] GPKG to PG single transaction, different schemas

2024-05-14 Thread Matteo Ghetta via gdal-dev
#x27;t find the correct flags combination to specify the destination schema.table_name. With the following command features of first_table are appended to the second_table table: ogr2ogr --debug ON -f PostgreSQL "PG:host=localhost user=matteo password=my_pws dbname=test" -append /h

Re: [gdal-dev] Export PG to GPKG with foreign keys

2024-04-21 Thread Matteo Ghetta via gdal-dev
Hi Even, thanks for the reply! I had this feeling, but now I'm sure Cheers and thanks Matteo On 4/19/24 11:32, Even Rouault wrote: Le 19/04/2024 à 10:25, Matteo Ghetta via gdal-dev a écrit : Hi all, I'm trying to export a PG table with several foreign keys to a geopackage. Wh

[gdal-dev] Export PG to GPKG with foreign keys

2024-04-19 Thread Matteo Ghetta via gdal-dev
g ogr2ogr but I cannot see any option to include the export of the foreign keys. Is this option available in order to have a geopackage with the original table with all the other related tables? Cheers and thanks for any suggestion! Matteo ___

Re: [gdal-dev] COPY statement failed with PG_USE_COPY=YES

2023-11-27 Thread Matteo Ghetta via gdal-dev
Hi Even, many thanks for the fix! Cheers Matteo On 11/27/23 16:37, Even Rouault wrote: Hi Matteo, I've pushed a fix in https://github.com/OSGeo/gdal/pull/8840 for that. The null dates were formatted in a unusual way. I assume that file was produced for another dataset where null

Re: [gdal-dev] COPY statement failed with PG_USE_COPY=YES

2023-11-27 Thread Matteo Ghetta via gdal-dev
DIM=4 /path/to/FOG_NODI_PT_GIS.shp FOG_NODI_PT_GIS -lco LAUNDER=NO -overwrite -nlt POINT -lco GEOMETRY_NAME=geom -lco FID=id -nln gis."FOG_NODI_PT_GIS" -s_srs EPSG:23032 -t_srs EPSG:4326 Cheers and thanks! Matteo On 11/21/23 12:24, Even Rouault wrote: Matteo, From a quick test, I can't repro

[gdal-dev] COPY statement failed with PG_USE_COPY=YES

2023-11-21 Thread Matteo Ghetta via gdal-dev
* GDAL 3.2.2, released 2021/03/05 * GDAL 3.7.3, released 2023/10/30 Do you have any ideas about what is causing this? Cheers and thanks Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Statistics of QGIS downloads

2023-01-24 Thread matteo
sorry, wrong mailing list :) On 1/24/23 16:04, matteo wrote: Hi all, if I'm not wrong (Tim?) there was kind of dashboard to see the download statistics of QGIS, but I cannot find it anymore. Is there a link available? Cheers and thanks M

[gdal-dev] Statistics of QGIS downloads

2023-01-24 Thread matteo
Hi all, if I'm not wrong (Tim?) there was kind of dashboard to see the download statistics of QGIS, but I cannot find it anymore. Is there a link available? Cheers and thanks Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org

Re: [gdal-dev] Encoding in single transaction shp to PG

2022-02-10 Thread matteo
Hi Even, right! Exactly what I was missing! Just for reference I used: python3 ogr2vrt.py my_shape.shp my_vrtvrt -oo ENCODING=ISO-8859-1 Thanks! Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal

[gdal-dev] Encoding in single transaction shp to PG

2022-02-10 Thread matteo
ith a list_of_shape.vrt file. Mandatory for my workflow is to load the shapefiles into PG in a single transaction (this is the reason of the vrt file). Thanks for any suggestion! Cheers Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org

Re: [gdal-dev] PGCLIENTENCODING in ogr2ogr (and QGIS)

2021-12-07 Thread matteo
Hi Even, this is also a solution. If I get it correctly I can get the encoding from within QGIS and pass it to the Processing script that calls GDAL. In this way the encoding is taken upstream and ogr2ogr should be able to pass it to the PG database Thanks! Matteo

Re: [gdal-dev] PGCLIENTENCODING in ogr2ogr (and QGIS)

2021-12-03 Thread matteo
shapefile.shp --config PG_USE_COPY YES -append -skipfailures -nlt PROMOTE_TO_MULTI -doo PRELUDE_STATEMENTS="SET client_encoding TO LATIN1" a small file can be found here: https://faunalia.eu/~matteo/shapefile.zip and yes. The database encoding is: HOW SERVER_ENCODING; server_e

Re: [gdal-dev] PGCLIENTENCODING in ogr2ogr (and QGIS)

2021-11-30 Thread matteo
F8 DB some LATIN1 shapefiles. BTW: the shapefiles have been created with ogr2ogr from within QGIS (on a Linux computer), opened and edited on QGIS on Windows machines. Other ideas are more than welcome! Cheers! Matteo ___ gdal-dev mailing lis

[gdal-dev] PGCLIENTENCODING in ogr2ogr (and QGIS)

2021-11-29 Thread matteo
oding also within QGIS (that is basically via the ogr2ogr command). I know that this is a more QGIS question, but QGIS is calling ogr2ogr, so I think if there is a ogr2ogr way to do that then also within QGIS should be possible. Cheers and thanks for any ideas! M

Re: [gdal-dev] ogr2ogr changes field length

2021-10-12 Thread matteo
heers and thanks Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] ogr2ogr changes field length

2021-10-08 Thread matteo
Hi Jukka, works perfectly, thanks! so no default options to impose the field length but it is alterable after Cheers! Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] ogr2ogr changes field length

2021-10-08 Thread matteo
bles are empty so I guess this is the "problem" I have Cheers and thanks Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] ogr2ogr changes field length

2021-10-07 Thread matteo
TEXT in PG (without length definition) the conversion to shapefile is automatically set to 80 and what we can do is to resize the field length only to have less characters? Cheers! Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https

Re: [gdal-dev] ogr2ogr changes field length

2021-10-07 Thread matteo
Even, still a weird issue with the command. I'm using this command ogr2ogr -f "ESRI Shapefile" /home/matteo/myfolder "PG:dbname='mydb' host=myhost port=5432 user='myuser' password='mypws' sslmode=disable schemas='dati'" --config

Re: [gdal-dev] ogr2ogr changes field length

2021-10-07 Thread matteo
Hi Even, thanks for the hint :) it si just an additional step Cheers! Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] ogr2ogr changes field length

2021-10-06 Thread matteo
es to 80. Is there any specific option to keep the original field length? Cheers and thanks Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] Catching many errors of the same record (ogr2ogr)

2021-01-08 Thread matteo
now a person should only read) * is there are 2 errors (e.g. constraints error) BUT in the same record, ogr2ogr shows only the first one and not all of them Cheers and thanks for any hint! Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org

Re: [gdal-dev] List all the (possible) errors of a single transaction

2021-01-07 Thread matteo
PG where I can run the single transaction with -skipfailures and then, if I don't have any errors, I will run a similar job with the same input data but on a "production" database. Maybe not the cleanest solution but still a good one to catch all the errors o

[gdal-dev] List all the (possible) errors of a single transaction

2021-01-07 Thread matteo
? Cheers and thanks for any hint Matteo [0] https://lists.osgeo.org/pipermail/gdal-dev/2020-December/053209.html ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] exporting all tables from PG schema

2020-12-29 Thread matteo
Got it! --config PG_LIST_ALL_TABLES YES :) Thanks Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] exporting all tables from PG schema

2020-12-29 Thread matteo
ress the output is generated but it only contains geometric tables. I couldn't find a parameter to force the export of also non-spatial tables. What I'd like to avoid is to loop on every single layer Cheers and thanks Matteo ___

Re: [gdal-dev] Export multiple tables from GPKG to PG

2020-12-23 Thread matteo
ild a vrt file (if I don't want to create it by myself). - and then use ogr2ogr to convert that VRT to PG, with -gt unlimited to do that in a single transaction so the parameter is literally ì: ogr2ogr .. -gt unlimited ? Thanks! Matteo __

[gdal-dev] Export multiple tables from GPKG to PG

2020-12-23 Thread matteo
first error I need a total rollback without importing anything in PG. The "problem" is that I have to specify some parameter in ogr2ogr (e.g. -nln) for each table to import. I hope I made myself clear Cheers and thanks Matteo ___ gdal-d

Re: [gdal-dev] Exporting triggers/constraints from PG to GPKG

2020-12-22 Thread matteo
ectly understandable given the different dialects of each provider. Thanks Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] Exporting triggers/constraints from PG to GPKG

2020-12-22 Thread matteo
couldn't find any option in the documentation. Cheers and thanks! Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] ogr2ogr question

2020-12-22 Thread matteo
truncated? Cheers and thanks Matteo ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] ogr2ogr question

2020-12-21 Thread matteo
he table names are the same in both input and output, than ogr2ogr was overwriting the output automatically. Just for information: -overwrite is doing a "truncate table" before adding the new features? Is this the reason that FK, CHECKS and other customization w

[gdal-dev] ogr2ogr question

2020-12-21 Thread matteo
I'm trying to create a my_data.gpkg with the same tables of the template.gpkg file, but overwriting some of these tables with the PG view contents. This is the ogr2ogr command I'm using, but nothing is happening (the data.gpkg remains the same of template.gpkg). ogr2ogr -f GPKG /home