New answers tagged python-2.7
Here's a solution. It uses a trick I recently had to learn, which I posted to System variable PATH overwritten in Qgis It just finds the python that's installed on your computer. I would presume python.exe is in the system path, otherwise I don't know how you would expect to find it on someone else's machine. Anyway, here's the code. I hope it helps. def ...
You will have to copy your python module in the plugin dir. and then you will get the path to your plugin with a small python script import os dirname, filename = os.path.split(os.path.abspath(__file__)) print "running from", dirname print "file is", filename This works with a C library, should be the same with a python module
If you have compiled your Ui file to a .py with pyuic then you setup like this: yourplugin_dialog.py: from PyQt4 import QtCore, QtGui from ui_yourdialog import Ui_YourDialog #create the dialog for zoom to point in yourplugin_dialog.py class YourDialog(QtGui.QDialog): def init(self): QtGui.QDialog.init(self) # Set up the user interface from ...
matplotlib.imshow() can only plot grayscales if they are of dtype float. Your memory error is most likely due to an internal copy, which changes your dtype from uint8 to float32/64. Do you have enough memory to drectly work with img = numpy.ndarray, dtype = float32? If not your best bet is most likely to write the image directly to disc, using for instance ...
Maybe try to open like this: from osgeo import gdal driver = gdal.GetDriverByName( ’DTED’) driver.Register() file = gdal.Open( ’path/to/file’) You may have to register your driver, in this case DTED.
In your first example you have a simple script, where all modules are imported, parameters are created and your function is executed with these parameters. Your vector data are written to dst_layer. There are few ways to execute your script. You can do this in command line (if you have enviromental variables for python with gdal): $ python script_name.py ...
to second what Aaron said, unless you need additional modules beyond the distribution included with ArcGIS, it's likely simpler to stick with one. In either case, i don't see why you can't use sublime - or any text editor for that matter. After you save your script, simply open a command prompt (start -> cmd) and change directories to the location of your ...
Russell Congalton literally wrote the book on the subject: Assessing the Accuracy of Remotely Sensed Data: Principles and Practices, Second Edition (Mapping Science). I highly recommend reading it. The most common way to assess the accuracy of a categorical land cover map is by using a confusion matrix (aka error matrix). The following shows the layout of a ...
I am wondering how I can pass in input argument "-n 0" in the command to be used in subprocess. It seems that numeric values cannot be passed in as it onle take text values.
How are the segments defined? Are they labeled raster? If so you could use GDAL binaries to export each label to a separate binary raster and multiply the binary raster to the source to obtain the result wanted. Say you want to transform label 12 , then you would do something like gdal_calc -A [LabelRasterPath] -B [SourceRasterPath] --calc="(A=12)*B" ...
Here is an older post about "Python script for identifying duplicate records (follow up)", but may it helps: Python script for identifying duplicate records (follow up)
Top 50 recent answers are included