Hot answers tagged

34

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 work, you can follow those steps: Create a new/load an existing Geopackage with a fitting CRS Import DWG-file Check 'Expand block references' and 'Use curves' ...


29

You can convert the DWG files to DXF (which QGIS does support) using the Teigha® File Converter. It's a free (not open source unfortunately) cross-platform application provided by the ODA to end users only for the conversion of .dwg and .dxf files to/from different versions. The following platforms are supported: Linux (OpenSUSE 11.2/Ubuntu 10.10 x86) Mac ...


18

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=my_database user=postgres" "source_data.json" -nln destination_table -append (I haven't tested this with your data, add a comment if you have issues.)


16

The ExtendedData does not have correct "name" values. For example <Data><displayName>System</displayName><value>Riverine</value></Data> is not imported by GDAL and Qgis Master, while <Data name="System"><displayName>System</displayName><value>Riverine</value></Data> gets imported. ...


16

My quick fix is to create the first row all with dummy values, and then delete this row/record after bringing into in ArcGIS. This first row contains representative values or often wildly different values (e.g. alphabetic characters even if the column contains numbers that I want to be text data type) and with the largest number of characters needed for ...


15

Use the -nlt option. In this case you want: -nlt MULTILINESTRING There is also PROMOTE_TO_MULTI (GDAL 1.10 and later), which chooses either MULTILINESTRING or MULTIPOLYGON depending on the input layer. The use case for this is "doing a mass conversion of shapefiles that [mix] different types of geometries".


14

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 brought into a target dataset (a PostGREsql table): ogr2ogr -f "PostGreSQL" PG:"host=127.0.0.1 user=YourUser dbname=YourDB password=YourPass" "E:\path\to\...


13

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 the use of geographic files. Install it and your import will work fine.


13

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.gui, even just import qgis is enough, before you import any PyQt stuff. That seems silly. Why? In QGIS 2.0 we switched to using version 2 bindings of SIP ...


13

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 to do is create a WKT string, in the format: POLYGON((X1 Y1, X2 Y2, X3 Y3, X4 Y4, X1 Y1)) You can create new columns in Excel with the below formulas. The ...


12

The reason that you are not able to save Time related information in a shapefile is that the Shapefile format, does not support Time as an attribute. They only support Date fields. This is due to the fact that the shapefile uses an older specification of the dBase file (.dbf) to store the attribute table. If you need to store time data, you are going to ...


12

I've been working with MS Sql Server Spatial since the '07 Katmai betas and I know of no Microsoft tool to do this. I had discussions with MS staff in '07 or '08 and at that point both reprojection and shapefile support were features they had chosen to leave up to third parties to implement.


12

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 are in geographic, which means using WGS84 is suitable for the given coordinates. Here is an image showing the correct location in Google Earth:


11

It depends on what you mean by import. Do you want to import data to actually do something with it, or just to have a background layer for viewing? Also consider this: In GIS, basic building blocks are points, lines and polygons (sometimes called basic topological types), and in CAD, you are working with drawings which can be made of anything, including ...


10

I love open-source but FME easily wins out against the opensource ETL's as best I can tell. It's actually quite cheap for maintenance and support too (at least compared to most other corporate solutions we have for things). If you're looking for translations between formats then OGR may do it (with some piping into GDAL for transformations). Of course, that'...


9

You can direct your .py script or interactive interpreter to the location of your arcpy installation. This would be achieved using the sys library and an append method on your sys.path import sys sys.path.append("path to arcpy") "path to arcpy" is usually: "C:\\Program Files (x86)\\ArcGIS\\Desktop10.0\\arcpy" However, I am not familiar with accessing ...


9

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" and then "Settings". "Project Interpreter" is under the "Default Project" menu on the left. Click the settings gear in the upper-right, and then "Add Local." ...


9

It is possible that there is something wrong with resolution and tolerance in PGDB. Take a look at sections X,y resolution and X,y tolerance in this topic. Try increasing these values. What coordinate system are you using? What values are set for resolution and tolerance?


9

I often recieve cad files but I don't have AutoCAD, so I break them down with DoubleCAD XT which is a free download. I export each layer or set of data by selecting it then SAVE AS (toggle the selected option) type = DXF-2004-2006. These seem to import fine into QGIS, when you open it up as a vector layer. FME server might be worth a try as well, http://...


9

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 read it just fine.


9

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 very similar, so I gave it a try on http://projfinder.com with success.


8

You can use Layer > Add delimited text layer For more about this, you can read: Visualising WKT geometry string in QGIS


8

I did call ESRI support about this and their answer wasn't encouraging, but it did explain the problem. Paraphrasing ESRI: The problem is that ArcGIS Desktop, being 32-bit software, is limited to using 4GB of RAM at the most. The text file has to be processed in RAM before being stored as a table, so at some poing during processing ArcGIS was hitting the RAM ...


8

I converted one of the wetlandfiles with globalmapper to shape: enclosed two screenshots from converted dbf-files (areas and lines): hopefully this is what you want ..


8

A slight departure from the traditional CSV->ArcGIS layer could be to use ogr2ogr to create your shapefile from CSV BEFORE loading it into ArcMap. When using OGR, you can manually create a CSVT file that describes your column types, similar to what ArcGIS attempts to do with the schema.ini file. This post by @underdark on How to Specify Data Types of CSV ...


8

You will need to do some formatting of your data to make them into polygons. Merely labeling a field as WKT will not help. If you have a lot of files (which it sounds like you do), the most effective way will be to automate your solution by writing a script. I was going to explain how when I decided that the simplest way would be to write an example script ...


8

You can open directly the asc file in QGIS (Add Raster File): After that the asc file appears gray: But if you choose pseudo-colors in the styles (properties of the layer) The result is


8

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 available but at least most other alternatives are pure java. There is also one more alternative in OpenJUMP called "Sextante raster" which is also pure java. Different ...


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