Re: [gdal-dev] Questions on working with HYCOM data in netcdf format

2016-06-06 Thread Stephen Woodbridge
Kurt, Even, Progress! Check this out: http://imaptools.com:8080/demo/tiger-hycom.html?zoom=8&lat=31.42299&lon=-79.78765&layers=BTT I tweaked your script, to copy both the water_u and water_v as separate bands (so back to 80 bands), I actually only need a few depths so eventually I'll cut that

Re: [gdal-dev] Discover whether a GDALDataset is raster or vector?

2016-06-06 Thread Even Rouault
On Monday 06 June 2016 13:14:44 jramm wrote: > Hi > Given a GDALDataset pointer, which has been opened using GDALOpenEx(...), > what is the best way to discover whether the dataset is raster or vector? GetRasterCount() != 0 for raster GetLayerCount() != 0 for vector > > I have thought of checkin

[gdal-dev] Discover whether a GDALDataset is raster or vector?

2016-06-06 Thread jramm
Hi Given a GDALDataset pointer, which has been opened using GDALOpenEx(...), what is the best way to discover whether the dataset is raster or vector? I have thought of checking the drivers' metadata for GDAL_DCAP_OF_RASTER or VECTOR, but this could potentially return YES for both if it is e.g the

Re: [gdal-dev] Questions on working with HYCOM data in netcdf format

2016-06-06 Thread Stephen Woodbridge
On 6/6/2016 1:25 PM, Kurt Schwehr wrote: +gdal-dev Some hackish test code I had laying around from last year... https://gist.github.com/schwehr/01f6604afc7757ea0a676f0eb28be582 Thank you! I have it running, so next I'll play with the code. You might also be able to just write 80 layers of

Re: [gdal-dev] Questions on working with HYCOM data in netcdf format

2016-06-06 Thread Kurt Schwehr
+gdal-dev Some hackish test code I had laying around from last year... https://gist.github.com/schwehr/01f6604afc7757ea0a676f0eb28be582 You might also be able to just write 80 layers of u-v, pick out pairs for each depth layer and have the rendering system do the conversion(s). You could use wh

Re: [gdal-dev] Fwd: How to reuse memory pointer of GDAL Memory driver

2016-06-06 Thread Pol Monsó Purtí
Hello Even, The CPLPrintPointer did the trick! Everything is working, excellent! You resolved the issue. And moreover I'm more comfortable with the Create function rather than the CPLOpen. I am very grateful for your help. ___ gdal-dev mailing list gd

Re: [gdal-dev] Fwd: How to reuse memory pointer of GDAL Memory driver

2016-06-06 Thread Pol Monsó Purtí
Thanks Even, the previous message was prematurely sent by error and the corrected version held because it was to big (? probably a mishap with the mail headers) Yeah the numbands are 0. I stripped out irrellevant parts of code and I missed to add that. To be sure I checked with the debugger, the d

Re: [gdal-dev] Fwd: How to reuse memory pointer of GDAL Memory driver

2016-06-06 Thread Even Rouault
See comments inline below > > The code: > > > GDALDriver *poDriver = > GetGDALDriverManager()->GetDriverByName(pszFormat); > > > if(!poDriver) > > { > > std::cerr << "Driver " << pszFormat << " couldn't be loaded." > << std::endl; > > return -4; > > } > >

Re: [gdal-dev] geospatialPDF DPI and EXTRA_IMAGES

2016-06-06 Thread Luca Delucchi
On 26 May 2016 at 17:23, Even Rouault wrote: > > Ah ok, so you create a vector dataset then ? > it could be both > Here's the relevant code in pdfwritabledataset.cpp: > > double dfRatio = (sGlobalExtent.MaxY - sGlobalExtent.MinY) / > (sGlobalExtent.MaxX - sGlobalExtent.MinX); > > int nW

Re: [gdal-dev] Fwd: How to reuse memory pointer of GDAL Memory driver

2016-06-06 Thread Pol Monsó Purtí
Same result. The code: GDALDriver *poDriver = GetGDALDriverManager()->GetDriverByName(pszFormat); if(!poDriver) { std::cerr << "Driver " << pszFormat << " couldn't be loaded." << std::endl; return -4; } poDstDS = poDriver->Create( auxfilepath.string()

Re: [gdal-dev] Fwd: How to reuse memory pointer of GDAL Memory driver

2016-06-06 Thread Even Rouault
On Monday 06 June 2016 14:53:46 Pol Monsó Purtí wrote: > Let's jump to particulars, at the end, the code. > > If I set the DATAPOINTER to NULL the program crashes at CreateCopy with > access violation. Same if I set it to the datapointer to &abyRaster[0] and > add the remaining two bands. Use the

Re: [gdal-dev] Fwd: How to reuse memory pointer of GDAL Memory driver

2016-06-06 Thread Pol Monsó Purtí
Let's jump to particulars, at the end, the code. If I set the DATAPOINTER to NULL the program crashes at CreateCopy with access violation. Same if I set it to the datapointer to &abyRaster[0] and add the remaining two bands. The abyRasters are initialized to white color with memset. SO this piece

Re: [gdal-dev] Questions on working with HYCOM data in netcdf format

2016-06-06 Thread Kurt Schwehr
Hi Stephen, I sounds like you should be asking on https://groups.google.com/a/hycom.org/forum/#!forum/forum rather than gdal-dev. -kurt On Sun, Jun 5, 2016 at 2:10 PM, Stephen Woodbridge wrote: > Hi Even, Kurt, > > Thank you for the suggestions. > > I'm reading through stuff and searching for

Re: [gdal-dev] Fwd: How to reuse memory pointer of GDAL Memory driver

2016-06-06 Thread Pol Monsó Purtí
Just one more question, If i set the option BAND=0, what should the DATAPOINTER be? Does it become optional? Cheers On Mon, Jun 6, 2016 at 10:55 AM, Even Rouault wrote: > On Monday 06 June 2016 10:45:47 Pol Monsó Purtí wrote: > > THanks Mateusz, > > > > You're right. I'm trying it as we speak.

Re: [gdal-dev] Read data without reading 'null data'

2016-06-06 Thread Even Rouault
On Monday 06 June 2016 02:23:24 jramm wrote: > This is my mistake. > I had not truly created a sparse raster! I keep forgetting that the gdal > tools (gdal_translate) will still write the sparse blocks and the sparse > creation option is just to indicate that FillEmptyBlocks should be skipped. > Cr

[gdal-dev] Give it a try

2016-06-06 Thread Qgis-psc
Hello, I think you have to try this thing, it's so hilarious, take a look at Sent from my iPhone, Qgis-psc ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Read data without reading 'null data'

2016-06-06 Thread jramm
This is my mistake. I had not truly created a sparse raster! I keep forgetting that the gdal tools (gdal_translate) will still write the sparse blocks and the sparse creation option is just to indicate that FillEmptyBlocks should be skipped. Creating the sparse file by hand correctly sets the blo

Re: [gdal-dev] Read data without reading 'null data'

2016-06-06 Thread jramm
Hi I am having a few problems with using this (via python). I have a test dataset with a 16 x 16 blocksize. In the below examples, bnd = ds.GetRasterBand(1) First, I try getting the blocksizes using the metadata: This gives: None of the first 10 blocks are empty - this is strange as it is

[gdal-dev] New list admin

2016-06-06 Thread Ari Jolma
Folks, I've added myself to the list admins, previously it was only w.. at pobox.com. I'll clear the admin requests list, which has got a bit long. Many of those are "message too big". I'll keep the current policy, i.e., won't let them through in the future, so people should use some other me

Re: [gdal-dev] Fwd: How to reuse memory pointer of GDAL Memory driver

2016-06-06 Thread Mateusz Loskot
On 6 June 2016 at 10:57, Pol Monsó Purtí wrote: > On Mon, Jun 6, 2016 at 10:51 AM, Mateusz Loskot wrote: >> >> On 6 June 2016 at 10:45, Pol Monsó Purtí wrote: >> > >> > In my case I have a std::vector of the 3 bands, where the >> > GByte* are >> > allocated in the heap with new GByte[width*heig

Re: [gdal-dev] Fwd: How to reuse memory pointer of GDAL Memory driver

2016-06-06 Thread Pol Monsó Purtí
> > The MEM format is one of the few that supports the AddBand() method. The > AddBand() method supports DATAPOINTER, PIXELOFFSET and LINEOFFSET options > to reference an existing memory array. > Thanks Even, you've cured me from my blindness. That's exactly what I need. Thanks to all of you, this

Re: [gdal-dev] Fwd: How to reuse memory pointer of GDAL Memory driver

2016-06-06 Thread Pol Monsó Purtí
On Mon, Jun 6, 2016 at 10:51 AM, Mateusz Loskot wrote: > On 6 June 2016 at 10:45, Pol Monsó Purtí wrote: > > > > In my case I have a std::vector of the 3 bands, where the > GByte* are > > allocated in the heap with new GByte[width*height]. > > I guess that won't work > > because the three bands

Re: [gdal-dev] Fwd: How to reuse memory pointer of GDAL Memory driver

2016-06-06 Thread Even Rouault
On Monday 06 June 2016 10:45:47 Pol Monsó Purtí wrote: > THanks Mateusz, > > You're right. I'm trying it as we speak. > > In my case I have a std::vector of the 3 bands, where the GByte* > are allocated in the heap with new GByte[width*height]. I guess that won't > work because the three bands ha

Re: [gdal-dev] Fwd: How to reuse memory pointer of GDAL Memory driver

2016-06-06 Thread Mateusz Loskot
On 6 June 2016 at 10:45, Pol Monsó Purtí wrote: > > In my case I have a std::vector of the 3 bands, where the GByte* are > allocated in the heap with new GByte[width*height]. > I guess that won't work > because the three bands have to be one single memory chunk, am I right? vector allocates is s

Re: [gdal-dev] Fwd: How to reuse memory pointer of GDAL Memory driver

2016-06-06 Thread Pol Monsó Purtí
THanks Mateusz, You're right. I'm trying it as we speak. In my case I have a std::vector of the 3 bands, where the GByte* are allocated in the heap with new GByte[width*height]. I guess that won't work because the three bands have to be one single memory chunk, am I right? I guess the only soluti

Re: [gdal-dev] New driver implementation with larger block size

2016-06-06 Thread Even Rouault
On Monday 06 June 2016 08:16:22 Javier Calzado wrote: > Hi guys, > > First of all, congratulations for such a wonderful and useful library. My > team and I are modernising a huge software legacy tool with an important > GIS background. We decided to go with GDAL some time ago and we would like > t

[gdal-dev] New driver implementation with larger block size

2016-06-06 Thread Javier Calzado
Hi guys, First of all, congratulations for such a wonderful and useful library. My team and I are modernising a huge software legacy tool with an important GIS background. We decided to go with GDAL some time ago and we would like to get the most out of it. I have just finished implementing a