Hot answers tagged

14

I've written a python log handler that I'm more than happy to share. The idea being that you can use the standard Python logging framework and also have the messages reflected back to ArcGIS through the arcpy messages. import logging import logging.handlers import arcpy class ArcPyLogHandler(logging.handlers.RotatingFileHandler): """ Custom ...


12

This problem was already fixed in the source code, see the reported issue. You have mainly 3 solutions: Mid term solution According to the road map, QGIS 2.18.1 will be released in 25.11.2016, you'll get the fix with such version. Simply wait 22 days for it, OK? BUT This is free software, so you can get the fix instantly! Short term solutions Install ...


11

Set the scaling and offset when reprojecting to WGS84, e.g.: las2las --a_srs EPSG:26911 --t_srs EPSG:4326 -i file1.las -o output.las --scaling 1e-7 1e-7 0.01 --offset <something close to your data's longitudes>,<something close to your data's latitudes>,0 Explanation You've been caught by a limitation/feature of the las file format. Internally,...


9

The problem was that I had run out of space to write to disk, and the map algebra commands I was using were attempting to generate and write large temporary raster files.


9

Sometimes it is possible that some files from older installations aren't correctly replaced/deleted when updating to the newest QGIS version and you may get an error like the one that you reported. For these cases, an option is trying to delete the .qgis2 folder, which should be placed (in Windows) at this location: C:\Users\account_name where ...


8

I use QGIS 2.2 so what I post may differ in certain areas. You can install the Processing plugin via: Plugins > Manage and Install Plugins... Once installed, you should see the Processing menu in your toolbar. Select Options and Configuration: Select the Providers list, find R scripts, check the Activate box and set the path of the R folders: Next select ...


8

Unzip files and then open them in your preferred text editor. Remove all header lines before NCOLS. Then you can plot them on EPSG:31467 projection.


7

I have faced the same problem: "Internal Server Error with Ubuntu 12.04". Everything looked OK to me (I even run successfully a perl fcgi script to test FCGI in my apache server). I continually got an Internal Server Error when I run a get Capabilities request. The apache log file said "Premature end of script headers: qgis_mapserv.fcgi". The problem was ...


7

If the OpenLayers plugin fails with an error in 'getProxy', verify that the proxy settings in the options menu are correct.


7

This is indeed an effect of using the print statement and having the python console open. And using the logging module as proposed is a very good approach to solving this issue. Here follow some insights into what exactly happens. It boils down to print() internally calling QCoreApplication::processEvents() and processEvents() is evil and dangerous. The ...


6

Your source coordinate system is most likely not defined in the CVS file that GDAL searches for proj4 strings. It looks like you might be able to pass the source EPSG as 3031 (from spatialreference.org) Note that it looks like your input is in a local projection. Is this clipped from a larger raster? To explicitly define the source you could just provide ...


6

I also receive the same when opening .shp files directly and selecting qgis-bin as the program to use. But I always load QGIS via the Desktop icon. I'm not exactly sure why but my guess is that the Desktop icon simultaneously runs the following 2 files in order to load QGIS (this is the Target which you can see in the icon's properties): "C:\Program Files\...


6

It took me a bit to get this too. # shapefile path example: # C:/Users/User/GIS/MyShapefile.shp # OGR command: library(rgdal) readOGR("C:/Users/User/GIS", "MyShapefile") You have to leave off the ".shp" extension as well as the last forward slash on the path.


6

Related to my comment, the minimum files to make up a shapefile are the .dbf, .shx, and .shp (.prj is nice to have too). You are missing the glpv1.dbf file.


6

In QGIS each attribute field has a fixed data type. Common data types are integer number and text but there are more. If field is defined as an integer you cannot store free text strings into it. You can see the full list of data types which are supported by QGIS if you open a layer for editing and start adding a new field. The error you got can for ...


6

Describes use of MMQGIS, a set of Python vector map layer plugins for Quantum GIS MMQGIS assumes that input and output shapefiles and CSV files are encoded in the UTF-8 character set. MMQGIS uses the standard Python CSV file interface functions, which do not handle Unicode or other multi-byte encodings. While files that use the lower 7-bits of ...


5

Woohoo! Figured it out. This thread had the solution to change the CSS rather than the JS. .olImageLoadError { /* when OL encounters a 404, don't display the pink image */ display: none !important; } This help article was helpful too, but I have not idea how to tell TileMill/MapBox to generate blank tiles rather than missing tiles. I'll get there ...


5

I'm not sure the QGIS portion of the problem, but I can see a couple of problems right away. First, if you are using geometry types (as opposed to geography types) then the unit of measurement for the distance is the unit of the coordinate system (i.e. degrees). Remember, geometry types work on planar geometries, not spheroids. In short, you're asking for ...


5

Add the legend on map load, the onLayersAddResult is firing multiple times which means it is trying to create more than one legend of the same name. Connect to the onLoad event dojo.connect(map, 'onLoad', function (results) {


5

As the error says, you have problems with the network dataset itself not the Route layer or solving the model. I'd try several things: 1) Add a network dataset to ArcMap and when prompted do not add any source features. Does it draw correctly and has edges? If yes, then the network dataset has been built properly. Try running a simple test of routing ...


5

You have to distinguish between the project CRS and the layer CRS. Your data is in lat/lon degrees, so the layer CRS should be EPSG:4326, WGS84. Your project CRS can be anything else. In most cases a projected CRS, where units are metres or feet. On-the-fly projection should always be activated. Just to be sure: the coordinates should have decimal points ...


5

Here is the solution that I found. My Table's names contained capital letters. Once I used a table with the name in all small letters, I got no error message, and could use the Query layer. Aside How did if find out this is the cause, you ask? I was searching for Postgresql and Query layers, and I found this post on the ArcGIS Forums, which says that ...


5

The problem is in the python code. The following line of the error message highlights the problem: "C:/Users/Gidi/.qgis//python/plugins\layers_by_field\layers_by_field_dialog.py", line 146, in split self.vlayer = QgsVectorLayer(vProvider.dataSourceUri(), str(layer.name()) + "_" + str(uValues[j]), "ogr") UnicodeEncodeError: 'ascii' codec can't encode ...


5

The wildcard to use with LIKE depends on the data source. You are using square brackets as field name delimiters. So I suppose you are using a Personal Geodatabase. The wildcards you have to use to query a personal geodatabases are asterisk (*) for any number of characters and question mark (?) for one character. If you use SDE or file based geodatabase ...


5

You must use a geoJSON file (The GeoJSON Format Specification) and not a simple JSON file. Your example is not a GeoJSON file (no 'geometry' tag for example) As example, GitHub announced that you can now automatically view any GeoJSON files that may be in a repository inside an interactive map driven by MapBox technology (see my example AAC.geojson) And ...


5

You have two solutions: 1) from the GRASS plugin: you are working in GRASS GIS, not in QGIS, so you need to know GRASS GIS you need to first open a LOCATION/MAPSET of GRASS (from the plugin) or create a new LOCATION/MAPSET you will then have access to the GRASS Tools to: import the shapefile in the MAPSET (v.in.ogr.qgis) transform the shapefile in a ...


5

Another method which I don't think you mentioned is to first create a new polygon shapefile: Layer > New > New Shapefile Layer... Then select Polygon in the options and click OK. Toggle the Edit button for both the new layer and the layer you want to copy the polygons from. Copy your polygons and paste them into the new shapefile. If there are no errors ...


5

With booleans, you need to repeat the query with the name of the field : ("Pop_CL"=8) or ("Pop_CL"=9) or ("Pop_CL"=10) but in your case you could use "Pop_CL" in (8,9,10)


5

It seems you are reading an old version of the PyQGIS Cookbook. Try with the addAttributes method of the layer provider, as indicated in the latest PyQGIS Cookbook. Specifically: if caps & QgsVectorDataProvider.AddFeatures: res = layer.dataProvider().addAttributes([QgsField("id", QVariant.Int), QgsField("mytext", QVariant.String)]) feat = ...


5

There's a few little problems here.. expanding on my comment you must release your cursor before using it again I have edited your code with the appropriate del statements and comments: import arcpy, math, sys, traceback # Condense onto one line from arcpy import env # you're not using this, why import it? class test: def __init__(self, workSpace): ...


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