[postgis-users] Excel connecting and inputting into PostGIS

Bruce Rindahl bruce.rindahl at gmail.com
Sat Aug 15 12:26:28 PDT 2020


By far the easiest way is through a foreign data wrapper.  Here are step by
step directions:
https://github.com/pramsey/pgsql-ogr-fdw
I have used this to directly connect to an Excel table, no importing
required.  If you add data to the excel  table and don't change the
structure,  postgresql picks up the changes.
If you need to use gis data, put lat/long data in separate columns.  Then
use a view to create a point from the two columns.
To give you an example, I download earthquake data from the USGS every 5
minutes in CSV format and link to a PostgreSQL database via the above
method.  Queries then compute the distance to selected locations and notify
me if any one of the locations might be effected.  All automatic.
The method above handles every format that ogr can handle.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20200815/4393e83d/attachment.html>


More information about the postgis-users mailing list