[Qgis-user] multiple csv file import

Hugh Kelley hghklly at gmail.com
Tue Nov 15 11:58:26 PST 2022


David, this was my first thought when i saw this question as well.

however, I didn't look for very long but I haven't seen a way to tell
ogr2ogr to read columns in a csv as the lat/lon and write those as points
to the shapefile.  I generally write a csv to postgres as a non-spatial
table and then process the lat lon columns with postgis.

 Are there arguments for ogr2ogr that can do this?

On Tue, Nov 15, 2022 at 12:30 PM David Strip via Qgis-user <
qgis-user at lists.osgeo.org> wrote:

> You might consider ogr2ogr as an alternative approach. You can run this
> from the command line allowing you to use shell scripts to iterate through
> all your .csv files. There are also python bindings for ogr2ogr if you're
> more comfortable with python than shell scripts.
>
> On 11/15/2022 9:59 AM, Salvatore Mellino via Qgis-user wrote:
>
> Hello,
>
> thank you for your answer. I have many csv (about 100), so I need an
> automatic procedure. Maybe a python script...
>
> Il 15/11/2022 16:55, Nicolas Cadieux ha scritto:
>
> Hi,
>
> Yes, you can do that very easily using QGIS.  Layer/add layer/add
> delimited text layer.  Then just export the layer in the format of your
> choice. You may need to convert the coordinates in decimal degrees (ex 75
> 05 30.4 -> 75.0917777777778000000 ).
>
> You can do this in Excel using =(A6)+(B6/60)+(C6/3600)+(D6/3600) A= Deg,
> B= Min, C=Sec, D= Decimal Sec.  Then export to csv.
>
> Nicolas
>
>
> On 2022-11-15 10:08 a.m., Salvatore Mellino via Qgis-user wrote:
>
> Hello,
>
> I would like to know if it is possible to import multiple csv files
> contained in a folder and to convert them in shapefiles (1 for each csv).
> All csv files are structured as "lat long value" separate by space and
> without any header line.
>
> Thank you for your help! Regards,
>
> Salvatore
>
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>


-- 
Hugh Kelley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20221115/c79360c9/attachment-0001.htm>


More information about the Qgis-user mailing list