Re: [Qgis-user] multiple csv file import

2022-11-16 Thread Ujaval Gandhi via Qgis-user
Another option is to use the tool 'Create Points Layer from Table' tool from QGIS Processing Toolbox. This tool can read a CSV and create a point layer (i.e. shapefile). First test it on a single file and if it works for your use case, you can click the 'Run as a Batch Process' and run it on all

Re: [Qgis-user] multiple csv file import

2022-11-15 Thread Salvatore Mellino via Qgis-user
I found this on line : import glob, os # Define path to directory of your csv files path_to_csv = "C:/File Path/" # Set current directory to path of csv files os.chdir(path_to_csv) # Find each .csv file and load them as vector layers for fname in glob.glob("*.csv"): uri

Re: [Qgis-user] multiple csv file import

2022-11-15 Thread Hugh Kelley via Qgis-user
Awesome thanks very much. glad I asked, you learn something new every day. On Tue, Nov 15, 2022 at 3:19 PM David Strip wrote: > Starting with v2.1, ogr2ogr supports args X_POSSIBLE_NAMES, > Y_POSSIBLE_NAMES which are strings with allowed wildcards (eg, Lon* ), or > you can use field_1, field_2,

Re: [Qgis-user] multiple csv file import

2022-11-15 Thread David Strip via Qgis-user
Starting with v2.1, ogr2ogr supports args X_POSSIBLE_NAMES, Y_POSSIBLE_NAMES which are strings with allowed wildcards (eg, Lon* ), or you can use field_1, field_2, etc to explicitly give the position of lat/lon. It's explained on the driver page.  This

Re: [Qgis-user] multiple csv file import

2022-11-15 Thread Even Rouault via Qgis-user
See the X_POSSIBLE_NAMES and Y_POSSIBLE_NAMES open options of the CSV driver mentioned at https://gdal.org/drivers/vector/csv.html#open-options and the last example of https://gdal.org/drivers/vector/csv.html#examples Even Le 15/11/2022 à 20:58, Hugh Kelley via Qgis-user a écrit : David,

Re: [Qgis-user] multiple csv file import

2022-11-15 Thread Mike Hyslop via Qgis-user
This has been covered in StackExchange: https://gis.stackexchange.com/questions/276590/bulk-csv-to-shapefile-using-ogr2ogr Determine the correct ogr2ogr syntax for processing one of your .csv files. If on Windows, issue the command *ls *.csv > files.txt*This will 'list' all of your csv files

Re: [Qgis-user] multiple csv file import

2022-11-15 Thread Hugh Kelley via Qgis-user
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

Re: [Qgis-user] multiple csv file import

2022-11-15 Thread Salvatore Mellino via Qgis-user
Hello, thank you for your suggestion. I am not comfortable with python, but I know that is possible to use a script in qgis. Is there any script capable to do my issue? > Il giorno 15 nov 2022, alle ore 18:29, David Strip > ha scritto: > >  You might consider ogr2ogr as an alternative

Re: [Qgis-user] multiple csv file import

2022-11-15 Thread David Strip via Qgis-user
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.

Re: [Qgis-user] multiple csv file import

2022-11-15 Thread Salvatore Mellino via Qgis-user
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

Re: [Qgis-user] multiple csv file import

2022-11-15 Thread Nicolas Cadieux via Qgis-user
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.0917800 ). You can do this in Excel using