Feature request - loading GDB file in GUI

66 views
Skip to first unread message

Totò Fiandaca

unread,
Nov 20, 2023, 3:00:29 AM11/20/23
to SpatiaLite Users
Good morning Sandro,
By now >= GDAL 3.6 reads and writes without problems the format OpenFIleGDB of the ESRI, I wanted to ask if it was possible to implement the loading of this database in spatialite_gui, as for example for shapefiles.
I currently use the command line

ogr2ogr -f sqlite -dsco SPATIALITE=YES output.sqlite input.gdb

I think it’s very useful to have it available in the gui.

thank you so much for all the work and time you devote to this wonderful tool.

Totò

a.fu...@lqt.it

unread,
Nov 20, 2023, 9:40:06 AM11/20/23
to spatiali...@googlegroups.com
On Mon, 20 Nov 2023 00:00:29 -0800 (PST), Totò Fiandaca wrote:
> Good morning Sandro,
> By now >= GDAL 3.6 [1] reads and writes without problems the format
> OpenFIleGDB of the ESRI, I wanted to ask if it was possible to
> implement the loading of this database in spatialite_gui, as for
> example for shapefiles.
>

Hi Toto,

the GUI is simply a shell as thin as possible that hides the
hard core represented by the libraries that do all the real
work underground.

so, rephrased correctly, you are asking about:
1. First develop a GDB interface inside libspatialite.
2. Then add the wizards based on the library functions
into the GUI.
they are two distinct jobs, not just one, and GUI support
will certainly arrive only a few months after the final
stabilization of the functionalities implemented in the
library.

in theory what you are asking is certainly possible,
considering that ESRI publishes a full documentation
of the file format.

in practice, however, it is absolutely impossible because
it's something that certainly requires a long time and a
lot of hard work.
time and energy that I absolutely do not have in my current
conditions given that the paid job that allows me to live
leaves me very little free time for open source development.

However, you must not lose hope; maybe in two or three years
when I'll finally retire I might even find the time to
develop support for GDB files.
I'm personally interested too (see below).

> I currently use the command line
>
> ogr2ogr -f sqlite -dsco SPATIALITE=YES output.sqlite input.gdb
>
> I think it’s very useful to have it available in the gui.
>

Me too :-D
When I have to read the new digital maps of our Italian
Geographic Institute which are only released as GDB I
also use GDAL.

Being able to use the GUI directly would certainly be
more practical, but unfortunately it is not feasible
at the moment.

bye Sandro

Even Rouault

unread,
Nov 20, 2023, 9:54:32 AM11/20/23
to spatiali...@googlegroups.com, a.fu...@lqt.it

>
> in theory what you are asking is certainly possible,
> considering that ESRI publishes a full documentation
> of the file format.

They don't! This was a multi-year task of the community to reverse
engineer it: https://github.com/rouault/dump_gdbtable/wiki/FGDB-Spec

>
> in practice, however, it is absolutely impossible because
> it's something that certainly requires a long time and a
> lot of hard work.
> time and energy that I absolutely do not have in my current
> conditions given that the paid job that allows me to live
> leaves me very little free time for open source development.

This is indeed a tedious job ! If you'd were willing to do that, I'd
suggest you rely on / port
https://github.com/OSGeo/gdal/tree/master/ogr/ogrsf_frmts/openfilegdb

One possibility to use GDB files from Spatialite-GUI is to load GDAL as
a SQLite extension and to create a virtual table from a OGR layer using
SELECT ogr_datasource_load_layers()

Cf
https://gdal.org/user/sql_sqlite_dialect.html#ogr-datasource-sql-functions

Demo:

$ ogr2ogr poly.gdb poly.shp

$ sqlite3
sqlite> select load_extension('libgdal.so');

sqlite> select ogr_datasource_load_layers('poly.gdb');
1

sqlite> pragma table_info(poly);
0|AREA|FLOAT|0||0
1|EAS_ID|FLOAT|0||0
2|PRFEDEA|VARCHAR(16)|0||0
3|SHAPE|BLOB|0||0

sqlite> select load_extension('mod_spatialite');

sqlite> select *, st_astext(SHAPE) from poly;
215229.266|168.0|35043411||MULTIPOLYGON(((479819.8438 4765180.5,
479690.1875 4765259.5, 479647 4765369.5, 479730.375 4765400.5,
480039.0313 4765539.5, 480035.3438 4765558.5, 480159.7813 4765610.5,
480202.2813 4765482, 480365 4765015.5, 480389.6875 4764950, 480133.9688
4764856.5, 480080.2813 4764979.5, 480082.9688 4765049.5, 480088.8125
4765139.5, 480059.9063 4765239.5, 480019.7188 4765319.5, 479980.2188
4765409.5, 479909.875 4765370, 479859.875 4765270, 479819.8438 4765180.5)))
247328.172|179.0|35043423||MULTIPOLYGON(((480035.3438 4765558.5,
480039.0313 4765539.5, 479730.375 4765400.5, 479647 4765369.5,
479690.1875 4765259.5, 479819.8438 4765180.5, 479779.8438 4765109.5,
479681.7813 4764940, 479468 4764942.5, 479411.4375 4764940.5, 479353
4764939.5, 479208.6563 4764882.5, 479196.8125 4764879, 479123.2813
4765015, 479046.5313 4765117, 479029.7188 4765110.5, 479014.9375
4765147.5, 479149.9375 4765200.5, 479639.625 4765399.5, 480035.3438
4765558.5)))
261752.781|171.0|35043414||MULTIPOLYGON(((479819.8438 4765180.5,
479859.875 4765270, 479909.875 4765370, 479980.2188 4765409.5,
480019.7188 4765319.5, 480059.9063 4765239.5, 480088.8125 4765139.5,
480082.9688 4765049.5, 480000.2813 4765043, 479934.9688 4765020,
479895.125 4765000, 479734.375 4764865, 479680.2813 4764852, 479644.7813
4764827.5, 479637.875 4764803, 479617.2188 4764760, 479587.2813 4764718,
479548.0313 4764693.5, 479504.9063 4764609.5, 479239.8125 4764505,
479117.8125 4764847, 479196.8125 4764879, 479208.6563 4764882.5, 479353
4764939.5, 479411.4375 4764940.5, 479468 4764942.5, 479681.7813 4764940,
479779.8438 4765109.5, 479819.8438 4765180.5)))
547597.188|173.0|35043416||MULTIPOLYGON(((479014.9375 4765147.5,
479029.7188 4765110.5, 479117.8125 4764847, 479239.8125 4764505,
479305.875 4764361, 479256.0313 4764314.5, 479220.9063 4764212.5,
479114.5 4764174, 479018.2813 4764418.5, 478896.9375 4764371,
478748.8125 4764308.5, 478503.0313 4764218, 478461.75 4764337.5,
478443.9375 4764400.5, 478447.8125 4764454, 478448.6875 4764531.5,
478502.1875 4764541.5, 478683 4764730.5, 478621.0313 4764788.5,
478597.3438 4764766.5, 478532.5 4764695.5, 478460.125 4764615,
478408.0625 4764654, 478315.5313 4764876, 478889.25 4765100, 479014.9375
4765147.5)))
15775.758|172.0|35043415||MULTIPOLYGON(((479029.7188 4765110.5,
479046.5313 4765117, 479123.2813 4765015, 479196.8125 4764879,
479117.8125 4764847, 479029.7188 4765110.5)))
101429.977|169.0|35043412||MULTIPOLYGON(((480082.9688 4765049.5,
480080.2813 4764979.5, 480133.9688 4764856.5, 479968.4688 4764788,
479750.6875 4764702, 479735.9063 4764752, 479640.0938 4764721,
479658.5938 4764670, 479504.9063 4764609.5, 479548.0313 4764693.5,
479587.2813 4764718, 479617.2188 4764760, 479637.875 4764803,
479644.7813 4764827.5, 479680.2813 4764852, 479734.375 4764865,
479895.125 4765000, 479934.9688 4765020, 480000.2813 4765043,
480082.9688 4765049.5)))
268597.625|166.0|35043409||MULTIPOLYGON(((480389.6875 4764950,
480537.1563 4765014, 480567.9688 4764918, 480605 4764835, 480701.0625
4764738, 480710.25 4764690.5, 480588.5938 4764740.5, 480540.7188
4764741, 480515.125 4764695, 480731.6563 4764561.5, 480692.1875
4764453.5, 480677.8438 4764439, 480655.3438 4764397.5, 480584.375
4764353, 480500.4063 4764326.5, 480358.5313 4764277, 480192.3125
4764183, 480157.125 4764266.5, 480234.3125 4764304, 480289.125
4764348.5, 480316 4764395, 480343.5625 4764477, 480343.7188 4764532.5,
480258.0313 4764767, 480177.1563 4764742, 480093.75 4764703, 480011
4764674.5, 479985.0625 4764732, 479968.4688 4764788, 480133.9688
4764856.5, 480389.6875 4764950)))
1634833.375|158.0|35043369||MULTIPOLYGON(((480701.0625 4764738,
480761.4688 4764778, 480824.9688 4764820, 480922.0313 4764850.5,
480930.7188 4764852, 480984.25 4764875, 481088.1875 4764936, 481136.8438
4764994.5, 481281.3125 4764876.5, 481291.0938 4764810, 481465.9063
4764872.5, 481457.375 4764937, 481509.6563 4764967, 481538.9063
4764982.5, 481575 4764999.5, 481602.125 4764915.5, 481629.8438
4764829.5, 481645.3125 4764797.5, 481635.9688 4764795.5, 481235.3125
4764650, 481209.8125 4764633.5, 481199.2188 4764623.5, 481185.5 4764607,
481159.9375 4764580, 481140.4688 4764510.5, 481141.625 4764480.5,
481199.8438 4764180, 481143.4375 4764010.5, 481130.3125 4763979.5,
481039.9375 4763889.5, 480882.6875 4763670, 480826.0625 4763650.5,
480745.1875 4763628.5, 480654.4375 4763627.5, 480599.8125 4763660,
480281.9375 4763576.5, 480221.5 4763533.5, 480199.6875 4763509,
480195.0938 4763430, 480273.6875 4763305.5, 480309.6875 4763063.5,
480201.8438 4762962.5, 479855.3125 4762880.5, 479848.5313 4762897,
479728.875 4763217.5, 479492.6875 4763850, 479550.0625 4763919.5,
480120.2188 4764188.5, 480192.3125 4764183, 480358.5313 4764277,
480500.4063 4764326.5, 480584.375 4764353, 480655.3438 4764397.5,
480677.8438 4764439, 480692.1875 4764453.5, 480731.6563 4764561.5,
480515.125 4764695, 480540.7188 4764741, 480588.5938 4764740.5,
480710.25 4764690.5, 480701.0625 4764738)))
-596610.313|165.0|35043408||MULTIPOLYGON(((479750.6875 4764702,
479968.4688 4764788, 479985.0625 4764732, 480011 4764674.5, 480093.75
4764703, 480177.1563 4764742, 480258.0313 4764767, 480343.7188
4764532.5, 480343.5625 4764477, 480316 4764395, 480289.125 4764348.5,
480234.3125 4764304, 480157.125 4764266.5, 480192.3125 4764183,
480120.2188 4764188.5, 479550.0625 4763919.5, 479492.6875 4763850,
479487.75 4763864.5, 479442.75 4763990, 479436 4764023, 479398.9375
4764100, 479349.625 4764230, 479305.875 4764361, 479239.8125 4764505,
479504.9063 4764609.5, 479658.5938 4764670, 479750.6875 4764702)))
5268.813|170.0|35043413||MULTIPOLYGON(((479750.6875 4764702, 479658.5938
4764670, 479640.0938 4764721, 479735.9063 4764752, 479750.6875 4764702)))


Even

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

a.fu...@lqt.it

unread,
Nov 20, 2023, 10:27:07 AM11/20/23
to Even Rouault, spatiali...@googlegroups.com
On Mon, 20 Nov 2023 15:54:27 +0100, Even Rouault wrote:
> One possibility to use GDB files from Spatialite-GUI is to load GDAL
> as a SQLite extension and to create a virtual table from a OGR layer
> using SELECT ogr_datasource_load_layers()
>

Even,

thank you for this very valuable suggestion.

it actually makes the development of specific support for GDB
completely
useless given that it is ultimately a very simple mechanism that does
not create any difficulties whatsoever.

I imagine that Toto will also be fully satisfied now that he has
discovered that there is a simple and direct way to feed a SpatiaLite
DB starting from GDB datasets.

bye Sandro

Totò Fiandaca

unread,
Nov 21, 2023, 11:12:16 AM11/21/23
to spatiali...@googlegroups.com, Even Rouault
Hi,
I did a test using the GUI on win 10 but it does not work, need to compile something under windows?


saluti

--
You received this message because you are subscribed to the Google Groups "SpatiaLite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spatialite-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/spatialite-users/4c6a5ef078afc38e9309b66fb7bf9aaa%40lqt.it.


--
Ing. Salvatore Fiandaca
mobile.:+39 327.493.8955 
m: pigrecoin...@gmail.com
C.F.: FNDSVT71E29Z103G
P.IVA: 06597870820
membro QGIS Italia - http://qgis.it/
socio GFOSS.it - http://gfoss.it/

43°51'0.54"N  10°34'27.62"E - EPSG:4326

“Se la conoscenza deve essere aperta a tutti,
perchè mai limitarne l’accesso?” 
R. Stallman

Questo documento, allegati inclusi, contiene informazioni di proprietà di FIANDACA SALVATORE e deve essere utilizzato esclusivamente dal destinatario in relazione alle finalità per le quali è stato ricevuto. E' vietata qualsiasi forma di riproduzione o divulgazione senza l'esplicito consenso di FIANDACA SALVATORE. Qualora fosse stato ricevuto per errore si prega di informare tempestivamente il mittente e distruggere la copia in proprio possesso.


Dane christian Neilson

unread,
Nov 27, 2023, 11:58:47 AM11/27/23
to SpatiaLite Users

DIRECT SENDER IS HERE LETS DEAL.

Dane Christian Neilson




MT103/202 DIRECT WIRE TRANSFER
PAYPAL TRANSFER
CASHAPP TRANSFER
ZELLE TRANSFER
TRANSFER WISE
WESTERN UNION TRANSFER
BITCOIN FLASHING
BANK ACCOUNT LOADING/FLASHING
IBAN TO IBAN TRANSFER
MONEYGRAM TRANSFER
SLBC PROVIDER
CREDIT CARD TOP UP
SEPA TRANSFER
WIRE TRANSFER
GLOBALPAY INC US

Thanks.


NOTE; ONLY SERIOUS / RELIABLE RECEIVERS CAN CONTACT.

DM ME ON WHATSAPP FOR A SERIOUS DEAL.

+14234753476
Reply all
Reply to author
Forward
0 new messages