New answers tagged python-2.7
The spatial reference includes a coordinate system for x-, y-, and z-values as well as tolerance and resolution values for x-, y-, z-, and m-values. So spatial reference is inclusive of coordinate system. In the context of GP tool parameter, It seems they don't make a difference. The GUI doesn't let the user enter the tolerance and resolution! Probably The ...
You may have unicode characters in your layer names or layer descriptions. So replace this line: layerattributes = [mxdpath, lyr.longName, lyr.description, lyr.dataSource] with layerattributes = [mxdpath.encode('utf8'), lyr.longName.encode('utf8'), lyr.description.encode('utf8'), lyr.dataSource.encode('utf8')]
I just tested your script replacing the parameters with the following: mxddirectory = "" mxd_single = r"C:\Scratch\mydoc.mxd" outputcsvlocation = r"C:\scratch\aaa.csv" The code ran without error and generated the expected output. So this leads me to ask are the MXD's you are trawling for data sources MXD's with broken links? I would imagine that would ...
32-bit applications on 64-bit Windows can only utilize up to 2GB of RAM. Switching to 64-bit Python should solve the issue. https://msdn.microsoft.com/en-us/library/aa366778.aspx
If you are looking for an easy way to change specific pixels to NoData (Nan) or -9999 please take a look at this alternative script I wrote: # -*- coding: utf-8 -*- """ Created on Wed Aug 12 21:33:20 2015 @author: rutgerhofste This script will replace values in a raster and save the result in geotiff format """ from osgeo import gdal import numpy as ...
Band band = outAlignedRaster.GetRasterBand(1); band.SetNoDataValue(-9999.9); band.Fill(-9999.9, 0.0); Gdal.ReprojectImage(......); I have used the band fill value exact same as no data value in my .net application and it worked for me.
Here you have a simple python script for reclassification, I wrote it and it works for me: from osgeo import gdal driver = gdal.GetDriverByName( ’ GTiff ’) file = gdal.Open( ’/home/user/workspace/r a s t e r . t i f ’) band = file.GetRasterBand(1) lista = band.ReadAsArray() # reclassification for j in range(file.RasterXSize): for i in ...
The draw.polygon does not accept "width" parameter however, draw.line does. You can create the desired output using draw.line function: draw.line((924, 266, 245, 777, 241, 782, 306, 100, 924, 266), fill="black", width=5)
Top 50 recent answers are included