[gdal-dev] Looking for a "surefire" way to get valid output formats.

2017-05-16 Thread Vlad
Basically trying to keep users from selecting an invalid -of parameter in translate and warp. Looking at gdalinfo --formats I see this for PNG.. PNG -raster- (rwv): Portable Network Graphics and gdalinfo --format png, I get... Supports: Open() - Open existing dataset. Supports: CreateCopy()

Re: [gdal-dev] Resizing CPLErrorContext?

2017-05-16 Thread Even Rouault
> > A related question... any idea what the '0' char is for? It looks like you > introduced the zero char after \n in > https://trac.osgeo.org/gdal/changeset/14601 and I don't see '0' in > https://trac.osgeo.org/gdal/browser/trunk/gdal/port/cpl_error.cpp? annotate=b > lame=14600 Should have

Re: [gdal-dev] Resizing CPLErrorContext?

2017-05-16 Thread Kurt Schwehr
I would strongly lean towards std::string if possible. I'm not sure how a realloc on the heap is any less safe than a std::string and strings can have memory reserved at construction time (or ::reserve()). Or in crazy cases, a custom allocator can be used that has a preallocated pool of memory

Re: [gdal-dev] Looking for a "surefire" way to get valid output formats.

2017-05-16 Thread Even Rouault
On mardi 16 mai 2017 11:39:03 CEST Vlad wrote: > Basically trying to keep users from selecting an invalid -of parameter in > translate and warp. > > Looking at gdalinfo --formats I see this for PNG.. > > PNG -raster- (rwv): Portable Network Graphics > > and gdalinfo --format png, I get... > >

Re: [gdal-dev] Resizing CPLErrorContext?

2017-05-16 Thread Even Rouault
On mardi 16 mai 2017 10:26:09 CEST Kurt Schwehr wrote: > I now know this is referred to as the "struct hack." > > This really is undefined behavior in the C++11 standard... Well, I don't think the hack is really needed and char szLastErrorMsg[] could be replaces by a char* pszLastErrorMsg

Re: [gdal-dev] Resizing CPLErrorContext?

2017-05-16 Thread Kurt Schwehr
I now know this is referred to as the "struct hack." This really is undefined behavior in the C++11 standard... there was a proposal to make the struct hack valid for C++11: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n791.htm

Re: [gdal-dev] MrSID Color Spaces

2017-05-16 Thread Even Rouault
On mardi 16 mai 2017 10:13:52 CEST Martin Chapman wrote: > Even or Frank or whoever it may concern, > > > > Not a big deal but I was trying to open a JP2 file using the MrSID driver > and noticed that the mrsiddataset.cpp does not identify the color spaces > MRSID_LTI_COLORSPACE_GRAYSCALEA and

[gdal-dev] MrSID Color Spaces

2017-05-16 Thread Martin Chapman
Even or Frank or whoever it may concern, Not a big deal but I was trying to open a JP2 file using the MrSID driver and noticed that the mrsiddataset.cpp does not identify the color spaces MRSID_LTI_COLORSPACE_GRAYSCALEA and MRSID_LTI_COLORSPACE_GRAYSCALEA_PM configurations in the

Re: [gdal-dev] Resizing CPLErrorContext?

2017-05-16 Thread Even Rouault
On mardi 16 mai 2017 07:01:53 CEST Kurt Schwehr wrote: > w.r.t. https://trac.osgeo.org/gdal/changeset/38405 > > Exactly why is it okay to resize this fixed size structure? Well, this is a good old trick of grey-beard C programmers, isn't it ? Not sure what the C/C++ standards says about that,

[gdal-dev] Resizing CPLErrorContext?

2017-05-16 Thread Kurt Schwehr
w.r.t. https://trac.osgeo.org/gdal/changeset/38405 Exactly why is it okay to resize this fixed size structure? typedef struct { CPLErrorNum nLastErrNo; CPLErr eLastErrType; CPLErrorHandlerNode *psHandlerStack; int nLastErrMsgMax; int nFailureIntoWarning; char

Re: [gdal-dev] ogr2ogr PROMOTE_TO_MULTI with linestrings?

2017-05-16 Thread Even Rouault
On mardi 16 mai 2017 09:21:06 CEST Stephen Woodbridge wrote: > I'm just trying to load the census roads data. I think what happened is > that when the table was created using -nlt PROMOTE_TO_MULTI it was > created as polygon geometry. then the subsequent insert failed. I change > the script to

Re: [gdal-dev] ogr2ogr PROMOTE_TO_MULTI with linestrings?

2017-05-16 Thread Stephen Woodbridge
I'm just trying to load the census roads data. I think what happened is that when the table was created using -nlt PROMOTE_TO_MULTI it was created as polygon geometry. then the subsequent insert failed. I change the script to -nlt MULTILINESTRING and it loaded all the data. I found a post from

Re: [gdal-dev] ogr2ogr PROMOTE_TO_MULTI with linestrings?

2017-05-16 Thread Richard Greenwood
You could use -nlt geometry but that won't convert simple objects to multi objects. You could do it in steps: 1. use -where to get lines and -nlt MultiLine 2. use -where to get polys with -nlt MutliPolygon 3. combine the two tables into a single Geometry table Rich On Mon, May 15,

Re: [gdal-dev] mapping of shadows casted by other slopes

2017-05-16 Thread Volker Wichmann
Hi, another, may be simpler option is SAGA GIS, its analytical hillshading tool includes a ray tracing option: http://www.saga-gis.org/saga_tool_doc/4.1.0/ta_lighting_0.html Volker On 05/16/2017 10:22 AM, Newcomb, Doug wrote: Kenlo, Suggest you look at GRASS GIS r.sun ,

Re: [gdal-dev] mapping of shadows casted by other slopes

2017-05-16 Thread Newcomb, Doug
Kenlo, Suggest you look at GRASS GIS r.sun , https://grass.osgeo.org/grass72/manuals/r.sun.html. Doug On Tue, May 16, 2017 at 3:16 AM, NASAHARA Kenlo <24dake...@gmail.com> wrote: > Dear GDAL people: > > Using DSM, I want a "shadow map" not only by the slope > itself but also by the other

Re: [gdal-dev] GDAL build without big tiff support

2017-05-16 Thread Even Rouault
On mardi 16 mai 2017 01:27:15 CEST Dmitry Baryshnikov wrote: > Hi, > > it seem to me there is misprint here: > > https://github.com/OSGeo/gdal/blob/trunk/gdal/frmts/gtiff/geotiff.cpp#L16195 > instead of > > > else if( nCompression == COMPRESSION_JPEG > > should be > > > else if(

[gdal-dev] mapping of shadows casted by other slopes

2017-05-16 Thread NASAHARA Kenlo
Dear GDAL people: Using DSM, I want a "shadow map" not only by the slope itself but also by the other slopes. I mean, if a tall and steep peak exists, and if it is illuminated by the sun from near the horizon, the shadow of the peak falls on a wide area of the foot of the mountain. Such shadow

Re: [gdal-dev] ogr2ogr PROMOTE_TO_MULTI with linestrings?

2017-05-16 Thread jratike80
Stephen Woodbridge wrote > On 5/15/2017 6:15 PM, Stephen Woodbridge wrote: >> Hi, >> >> I'm trying to load both polygons and linestrings and would like >> PROMOTE_TO_MULTI to work for both, but it appears to define Multipolygon >> type and does not work for linestrings/multilinestrings. >> >>