Hot answers tagged

43 votes

Importing DWG into QGIS project?

In the newer versions of QGIS (2.18+) there was a feature implemented to import .dwg-files into geopackages (.gpkg). This feature can be found under: Project >> DWG/DXF-import In order to make it ...
user avatar
37 votes
Accepted

Loading .osm.pbf file in QGIS

QGIS is now able to read .pbf files with Add vector layer, but the data size will most probably kill QGIS with most of the available files. Try ogr2ogr -f SQLite my.sqlite some.pbf in the OSGEO4W ...
user avatar
  • 74.9k
32 votes
Accepted

Importing shapefile to PostGIS using Python and ogr

In pure Python, without using the subprocess module (os.system is deprecated) to call ogr2ogr or shp2pgsql, for example): 1) with ogr Append a shapefile to a postgis table using the GDAL/OGR Python ...
user avatar
  • 50.7k
27 votes

Import GeoJSON into PostGIS

You can use PostGIS's ST_GeomFromGeoJSON to bring in just the geometry part of the GeoJSON. Better yet, you can use ogr2ogr to import the entire JSON document: ogr2ogr -f "PostgreSQL" PG:"dbname=...
user avatar
25 votes

Opening ESRI Personal GeoDatabase (*.mdb) in QGIS

If you have installed a 64-bit version of QGIS on Windows and you find that Personal GeoDatabases (*.mdb) no longer work for you, then this solution might apply; I'm on QGIS 2.8.1 rather than 2.6, but ...
user avatar
  • 11.8k
16 votes
Accepted

How to rename PostgreSQL/PostGIS columns while importing Shapefiles?

To expand on David Bitner's answer, here's an example ogr2ogr instruction demonstrating an optional OGR SQL clause to rename fields from a source dataset (shapefile in this case) before they are ...
user avatar
  • 6,112
15 votes
Accepted

Why the order of imports matters in a standalone PyQGIS processing script?

tl;dr import qgis import PyQt4 etc is the correct way Long version Yes the import order can matter and in the case of QGIS 2.0 and above it does matter. You should always import qgis.core or qgis....
user avatar
  • 33.8k
14 votes

Importing .shp to PostgreSQL?

ERROR: **function addGeometrycolumn**(unknown, unknown, unknown, unknown,unknown, integer) does not exist It seems that PostGIS is not yet installed. PostGIS is an extension of Postgres which allows ...
user avatar
  • 1,126
14 votes
Accepted

Add an Excel file with a list of coordinates to QGIS as a layer?

You can often make a WKT (Well Known Text) column in Excel without too much fiddling, which effectively creates a spatial definition for points, lines or polygons within a single field. What you want ...
user avatar
  • 14.3k
13 votes

Opening ESRI Personal GeoDatabase (*.mdb) in QGIS

Provided you have successfully installed Microsoft Access Database Engine 64 bit, you can: Method 1 (works with QGIS 3) In QGIS Settings panel -> Options | System | Environment add the following ...
user avatar
13 votes
Accepted

Loading multiple CSV files into QGIS 2.10

You could use the following code in the Python Console to locate your csv files in a specified folder and load them as point shapefiles using their longitude/latitude fields. The code assumes: The ...
user avatar
  • 72.2k
13 votes

Importing coordinates as CSV file, but points are not displayed

You are putting the x and y coordinates in wrong order. -8.183973 is latitude (Y) and 111.845623 is longitude (X). You need to adjust the column of X and Y to be Y and X, respectively. The coordinates ...
user avatar
  • 36.2k
12 votes
Accepted

Adding CSV layer to QGIS when X and Y fields are the same

You can add the CSV file, structured as below, as a layer using the following script: import numpy as np c = np.genfromtxt('C:/path/to/file.csv', delimiter=',') # check delimiter lats = c[:,0][1:] ...
user avatar
11 votes
Accepted

Importing Composer Template into QGIS Print Composer

You can add items from a template by creating a new print composer and selecting the option shown in the image: Then select your template and it should load up all the items you created.
user avatar
  • 72.2k
11 votes

Change default data source encoding in QGIS to utf8

From Settings >> Data Sources >> Data source handling, you may try to uncheck the Ignore shapefile encoding declaration option. If you move the mouse cursor over the above option, this ...
user avatar
  • 15.5k
10 votes

Setting up PyCharm to reference ArcPy?

To follow theJones and user5584, PyCharm 4 now stores the setting under "Project Interpreter" rather than "Python Interpreters." With all projects closed, and PyCharm still open, go to "Configure" ...
user avatar
  • 1,531
10 votes

QGIS won't read table columns in CSV import on Mac OS

I had the same problem of QGIS reading a CSV file (saved from MS Excel 2011 on my Mac) as a single row. So, I re-saved the Excel worksheet as "Windows Comma Separated (.csv)" and QGIS was able to ...
user avatar
  • 121
10 votes
Accepted

Descrambling scrambled coordinates?

No idea what happened with the first three lines but the other lines are coordinates in UTM zone 28N. data_lat is X, data_lon is Y. I noticed that simply plotting each pair as X and Y points looked ...
user avatar
  • 8,073
10 votes
Accepted

QGIS 3.2 - Forcing column type when importing csv

QGIS uses OGR in the background, and OGR interprets all columns as strings. The OGR CSV driver returns all attribute columns as string data types if no field type information file (with .csvt ...
user avatar
10 votes
Accepted

Problem finding the right CRS for CSV file

Your data is obviously in decimal degree, hence WGS 84 - EPSG 4326 is the correct CRS. In the import window change from 25832 to 4326 and you're fine.
user avatar
  • 12.4k
10 votes

Imported CSV data is not displayed in QGIS

Try to use EPSG:4326-WGS 84 as "Geometry CRS". And check the points are on the right location. If EPSG:4326 doesn't exist in the drop down list, then click the button near the drop down list ...
user avatar
9 votes

Importing large dataset with osm2psql?

I imported a Planet File on a 24Gb Machine (Ubuntu Trusty) with the following .. bzcat planet-latest.osm.bz2 | osm2pgsql --verbose -U YourUser --flat-nodes flat-nodes --keep-coastlines --cache ...
user avatar
  • 3,804
9 votes

Header row in Excel is not header row when imported into ArcMap?

I had the same problem (Arcmap would not import my csv file with headers, instead it would show Field1, Field2, Field3 etc). When I examined the file headers in Excel, I found...decimals numbers, ...
user avatar
  • 91
9 votes

Importing raster with R from File Geodatabase?

R spatial packages all depend on GDAL for file read/write, and GDAL uses the OpenFileGDB driver, which can only read vector data sources at this time - see https://www.gdal.org/drv_openfilegdb.html. ...
user avatar
  • 3,420
9 votes
Accepted

Importing massive amounts of raster files

You can convert your .img files to .tif using gdal_translate. Here is a shell script to convert all .img in actual folder to .tif #! /bin/bash for i in *.img; do gdal_translate $i ${i%.*}.tif ...
user avatar
  • 6,722
9 votes
Accepted

Loading CSV as point vector using QGIS

You need to tick "la virgola è il separatore decimal" as your fields field_9 and field_12 without this option need point as decimal separator.
user avatar
  • 28.5k
8 votes

Seeking options for Spatial ETL (Extract, Transform, Load)?

I did a comparison of various tools about a year back that also contains most of the options mentioned in this thread. As a more direct answer, I use FME a lot due to its versatility. However, when I ...
8 votes

Looking for an open-source Java based GeoTIFF library

Install OpenJUMP and study what all has been gathered into it I have never really understood what all the alternatives are. ImageIO-ext is probably utilising native GDAL binaries if such are ...
user avatar
  • 51.4k
8 votes
Accepted

Shapefile/vector layer not appearing in QGIS

If there is a .prj file, look into that with a text editor for projection information. Otherwise you have to ask the data creator. It is definitely something projected in meters or foot. That is the ...
user avatar
  • 74.9k
8 votes
Accepted

How to setup a new script, and parameters in ArcMap?

Sounds like you already successfully added your script to the toolbox, so you're close. You just need to set the parameters that are listed in the script within ArcMap if you want to run the script ...
user avatar
  • 986

Only top scored, non community-wiki answers of a minimum length are eligible