Re: [gdal-dev] Working with NTF files [SEC=UNCLASSIFIED]

2013-07-31 Thread Pinner, Luke
2013 10:25 PM To: gdal-dev@lists.osgeo.org Cc: Pinner, Luke Subject: Re: [gdal-dev] Working with NTF files lpinner wrote: A workaround to your 2nd question is to set the GDAL_PAM_PROXY_DIR environment variable, either permanently or on the commandline before you call gdalinfo. set

[gdal-dev] GDAL_API_PROXY and deregistering drivers (python/win32) [SEC=UNCLASSIFIED]

2013-05-23 Thread Pinner, Luke
Greetings, Following on from the GDAL 1.10 JP2000 Problem/Crash thread (http://osgeo-org.1560.x6.nabble.com/gdal-dev-GDAL-1-10-JP2000-Problem-Crash-td5054876.html), I'm trying to use the GDAL API Proxy and deregister the JP2ECW driver at runtime to avoid crashes with those Pleiades JP2s. I'm

Re: [gdal-dev] GDAL_API_PROXY and deregistering drivers (python/win32) [SEC=UNCLASSIFIED]

2013-05-23 Thread Pinner, Luke
-Original Message- From: Even Rouault [mailto:even.roua...@mines-paris.org] On which OS did you run the above test ? On Linux (and provided that GDAL_API_PROXY_SERVER is not set to YES or gdalserver) , I get JP2OpenJPEG on both cases. However on Windows, I would get the same result

Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector [SEC=UNCLASSIFIED]

2012-10-17 Thread Pinner, Luke
Try gdalwarp (http://www.gdal.org/gdalwarp.html) with the -cutline argument. gdalwarp -of envi -cutline shapefile.shp multibandenvi.dat croppedoutput.dat Luke -Original Message- From: gdal-dev-boun...@lists.osgeo.org [mailto:gdal-dev-boun...@lists.osgeo.org] On Behalf Of Peter Willis

Re: [gdal-dev] Using gdal_rasterize to mask ENVI file Using ESRI SHP format Vector [SEC=UNCLASSIFIED]

2012-10-17 Thread Pinner, Luke
Perhaps something like for i in {1..49}; do gdal_rasterize -burn -999 -b $i mask.shp 49bandenvi.dat; done Luke From: gdal-dev-boun...@lists.osgeo.org [mailto:gdal-dev-boun...@lists.osgeo.org] On Behalf Of Peter Willis Sent: Thursday, 18 October 2012 9:43 AM To: gdal-dev@lists.osgeo.org

Re: [gdal-dev] Batch conversion ECW to TIFF [SEC=UNCLASSIFIED]

2012-07-24 Thread Pinner, Luke
See below for Ubuntu instructions (for other distros you could probably grab the libgdal-ecw-src deb unpack manually and compile). #Get libecwj 3.3 (the old SDK), it's available from a number of sources. # If the link below doesn't work, google for libecwj2-3.3 wget -nd

RE: [gdal-dev] adf to ascii X,Y,Z [SEC=UNCLASSIFIED]

2012-04-04 Thread Pinner, Luke
Something like: gdal_translate –of xyz ingrid outfile.txt I don’t think MapInfo grids (*.mig) are supported, I couldn’t see that format listed in http://www.gdal.org/formats_list.html Luke From: gdal-dev-boun...@lists.osgeo.org [mailto:gdal-dev-boun...@lists.osgeo.org] On Behalf Of

RE: [gdal-dev] Trouble with python+gdal+sqlite+utf-8 [SEC=UNCLASSIFIED]

2011-04-17 Thread Pinner, Luke
newFeature.SetField('name', uCalle Garbí, 2.encode('utf-8')) Luke -Original Message- From: gdal-dev-boun...@lists.osgeo.org [mailto:gdal-dev-boun...@lists.osgeo.org] On Behalf Of Iván Sánchez Ortega Sent: Monday, 18 April 2011 9:17 AM To: gdal-dev@lists.osgeo.org Subject: [gdal-dev]

RE: [gdal-dev] Unable to use geom.ExportToWkt() in Python ? [SEC=UNCLASSIFIED]

2010-11-23 Thread Pinner, Luke
You are running into a python gotcha - http://trac.osgeo.org/gdal/wiki/PythonGotchas Your reference to the feature is going out of scope when you use the firstgeom = layer.GetFeature(0).GetGeometryRef() syntax. The following works syntax fine: feat = layer.GetFeature(0) firstgeom =

RE: [gdal-dev] ogr.UseExceptions() doesn't raise an exception ona non-existant dataset [SEC=UNCLASSIFIED]

2010-10-21 Thread Pinner, Luke
To: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] ogr.UseExceptions() doesn't raise an exception ona non-existant dataset On 10/21/2010 04:58 AM, Pinner, Luke wrote: OGR doesn't raise an exception on attempting to open a non-existant dataset even if ogr.UseExceptions() has been called, GDAL

[gdal-dev] ogr.UseExceptions() doesn't raise an exception on a non-existant dataset [SEC=UNCLASSIFIED]

2010-10-20 Thread Pinner, Luke
OGR doesn't raise an exception on attempting to open a non-existant dataset even if ogr.UseExceptions() has been called, GDAL does though. Is this intentional or a bug? GDAL version = 1.7.2 from osgeo import gdal,ogr gdal.UseExceptions() ogr.UseExceptions() ds=ogr.Open('foo') #No exception

RE: [gdal-dev] python bindings: strange behavior with layer

2010-07-21 Thread Pinner, Luke
The datasource ds is still going out of scope as it is local to your getLayer2 function. Lots of ways to avoid this. Try not wrapping it up in a function, or return a tuple of datasource and layer e.g. def getDSandLayer(shape_fullname): ds = ogr.Open(shape_fullname, 0) layer =

RE: [gdal-dev] Modify an image color table?

2010-06-28 Thread Pinner, Luke
Well elevation, particularly bathymetry, is an obvious application for colourmaps for negative data. Marco, I deal with colourmaps with negative values using the LUT vrt element instead of the ColorTable element. See below, (note the data is a single band raster, but the VRT exands this to 3

RE: [gdal-dev] ESRI text format?

2010-05-30 Thread Pinner, Luke
It's the output from the ArcGIS Write Features to Text File (Samples) tool. The format is documented here: http://help.arcgis.com/EN/ArcGISDesktop/10.0/help/index.html#//00pv0 00z00.htm Even ESRI use Python to read/write it :) Apparently it's deprecated though... Luke -Original

[gdal-dev] NetCDF geotransform - pixel centre/upper-left issue

2010-04-05 Thread Pinner, Luke
The NetCDF driver computes the pixel centre from lat/lon variables (see http://trac.osgeo.org/gdal/ticket/1506). Is this correct or should it compute pixel upper-left? Using the example NetCDF dataset attached to the above ticket (http://trac.osgeo.org/gdal/attachment/ticket/1506/out.nc),

RE: [gdal-dev] Real and raster coordinates

2010-03-24 Thread Pinner, Luke
The following module might help, use the mapToPixel() function. #---Imports try: from osgeo import gdal except ImportError: import gdal def mapToPixel(mx,my,gt): ''' Convert map to pixel coordinates @param mxInput map x coordinate (double) @param myInput map

[gdal-dev] ECW/JPEG2000 on Windows Vista/7

2010-02-15 Thread Pinner, Luke
Hi all, Not strictly a GDAL issue as such, I'm just posting this to publish a workaround (as I couldn't find much info about this issue) so apologies in advance. Using GDAL 1.6.3 (OSGeo4W). The standard ERDAS ECW/JPEG2000 SDK redistributables (NCSEcw.dll etc...) crash when opening ECW/JP2

RE: [gdal-dev] Convert raster from [0,360] to [-180,180]

2010-01-20 Thread Pinner, Luke
Something like the following perhaps? gdal_translate -projwin 0 90 180 -90 g0-360.tif g0-180.tif gdal_translate -projwin 180 90 360 -90 -a_ullr -180 90 0 -90 g0-360.tif g-180-0.tif gdal_merge[.py] -o g-180-180.tif g0-180.tif g-180-0.tif Regards Luke From:

RE: [gdal-dev] GDAL DataType class

2009-10-28 Thread Pinner, Luke
You could easily roll your own. from osgeo import gdal class GdalDataType(object): def __init__(self, nbits, Float, Complex): for i in range(0,gdal.GDT_TypeCount): self.DataType=None DataType=i DataTypeName=gdal.GetDataTypeName(i)

RE: [gdal-dev] GDAL DataType class

2009-10-28 Thread Pinner, Luke
if self.DataType is None: raise TypeError, 'No matching DataType found' gdt=GdalDataType(nbits=32, Float=True, Complex=False) print gdt.DataTypeName -Original Message- From: Pinner, Luke Sent: Thursday, 29 October 2009 10:21 AM To: 'Luca Fasano'; gdal-dev@lists.osgeo.org Subject: RE: [gdal-dev

[gdal-dev] CEOS issues on WinXP

2009-09-21 Thread Pinner, Luke
Hi all, Opening ALOS AVNIR-2 PRISM (CEOS format) images using GDAL is really slow and uses loads of memory on Windows XP. This includes things like gdalinfo and opening via the python bindings (gdal.Open()). I've tried (on WinXP) with various gdal installs (fwtools, osgeo4w, basic binaries) and

RE: [gdal-dev] Is it possible to Buffer using ogr2ogr?

2009-04-22 Thread Pinner, Luke
Something like the following might get you started (note: limited testing and I'm no programmer :) #buffer.py import sys,os from osgeo import ogr def buffer(infile,outfile,buffdist): try: ds=ogr.Open(infile) drv=ds.GetDriver() if os.path.exists(outfile):