Re: [gdal-dev] Warp to GeoTIFF with Transparency?
Thank you very kindly, Even. It works perfectly now. I can't recall exactly what I'd tried previously when adding the additional band, but I think I must have neglected to include the psWarpOptions->nDstAlphaBand = GDALGetRasterCount(hSrcDS) + 1; I thought I'd tried that before, but it certainly fixed it this time. So again... thanks very much for your assistance. It's very much appreciated. Cheers, Nik. On 19/09/2012, at 7:12 AM, Even Rouault wrote: > Le mardi 18 septembre 2012 05:15:03, Nik Sands a écrit : >> I'm very new to GDAL so please be gentle. My searching has found many >> references to this problem, but no complete solutions that are explained >> clearly enough for me to work through. > > The Warp API is powerful, and thus admitedly complex to master. > >> >> I'm using the GDAL API to read in a source image (could be from a variety >> of formats), warp it to Spherical Mercator, and then write out the >> reprojected image as a GeoTIFF. I would like the parts of the warped TIFF >> that are not included in the original image to be represented by fully >> transparent pixels instead of the black pixels that are being generated. >> >> I've set "ALPHA" to "YES" in the warp options but this has not helped. >> I've also tried adding an extra transparent band, but this made the entire >> output image transparent. > > Strange, perhaps you should retry. > > To have a transparency band added in the output of the warping, you need to > set the band number in the GDALCreate() call to 1 + > GDALGetRasterCount(hSrcDS), and also set psWarpOptions->nDstAlphaBand = 1 + > GDALGetRasterCount(hSrcDS) > > This should be equivalent to the -dstalpha option of gdalwarp. By the way, if > I were you, I would try to find the gdalwarp command line that fits my need, > and > then study its code source to extract what is needed for your use case. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Perl Binding Documentation for previous releases -->404
Thanks! Indeed to get to the perl bindings I always start at: http://trac.osgeo.org/gdal/wiki/GdalOgrInPerl and follow the link: http://geoinformatics.aalto.fi/doc/Geo-GDAL/html/ that page has the bad link. -Original Message- From: gdal-dev-boun...@lists.osgeo.org [mailto:gdal-dev-boun...@lists.osgeo.org] On Behalf Of Even Rouault Sent: Wednesday, September 19, 2012 1:15 PM To: gdal-dev@lists.osgeo.org; Ari Jolma Subject: Re: [gdal-dev] Perl Binding Documentation for previous releases -->404 Le mercredi 19 septembre 2012 20:43:39, Ethan Alpert a écrit : > Getting page not found for: > > > > http://geoinformatics.tkk.fi/doc/Geo-GDAL-1.8/html/index.html I guess you reached that link from http://geoinformatics.aalto.fi/doc/Geo- GDAL/html/ that is linked from http://trac.osgeo.org/gdal/wiki/GdalOgrInPerl ? So, I tried the following http://geoinformatics.aalto.fi/doc/Geo- GDAL-1.8/html/index.html and it seems to work I believe that Ari maintains that site. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev This electronic communication and any attachments may contain confidential and proprietary information of DigitalGlobe, Inc. If you are not the intended recipient, or an agent or employee responsible for delivering this communication to the intended recipient, or if you have received this communication in error, please do not print, copy, retransmit, disseminate or otherwise use the information. Please indicate to the sender that you have received this communication in error, and delete the copy you received. DigitalGlobe reserves the right to monitor any electronic communication sent or received by its employees, agents or representatives. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Perl Binding Documentation for previous releases --> 404
Le mercredi 19 septembre 2012 20:43:39, Ethan Alpert a écrit : > Getting page not found for: > > > > http://geoinformatics.tkk.fi/doc/Geo-GDAL-1.8/html/index.html I guess you reached that link from http://geoinformatics.aalto.fi/doc/Geo- GDAL/html/ that is linked from http://trac.osgeo.org/gdal/wiki/GdalOgrInPerl ? So, I tried the following http://geoinformatics.aalto.fi/doc/Geo- GDAL-1.8/html/index.html and it seems to work I believe that Ari maintains that site. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Perl Binding Documentation for previous releases --> 404
Getting page not found for: http://geoinformatics.tkk.fi/doc/Geo-GDAL-1.8/html/index.html This electronic communication and any attachments may contain confidential and proprietary information of DigitalGlobe, Inc. If you are not the intended recipient, or an agent or employee responsible for delivering this communication to the intended recipient, or if you have received this communication in error, please do not print, copy, retransmit, disseminate or otherwise use the information. Please indicate to the sender that you have received this communication in error, and delete the copy you received. DigitalGlobe reserves the right to monitor any electronic communication sent or received by its employees, agents or representatives. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Reading an IntegerList from file
Selon Bruno Belarte : > Hi, > > I am currently working on exporting some data (an adjacency graph with > nodes described by an id (integer), an OGRGeometry and some other fields > (string and real) into a file. I choose to export the adjacency relation > as an IntegerList field (for each node, the list contains the id of all > the adjacent nodes). It works for several file type (KML, GML, SQLite, > but not shapefile as it doesn't support IntegerList field type). > Everything works fine and the output files contains all the data that I > want. Because KML, GML and SQLite driver have a default case where they will create a field of String type when encountering an unhandled field type such as IntegerList, whereas the Shapefile driver will refuse it directly. For those drivers that consider an IntegerList as a String, they will serialize it's content as "{N:v1,v2,...,vn}", and potentially truncated if that serialized content goes above 80 characters. > > The problem comes when I want to do the opposite. When I open a file > that I precedently wrote, the IntegerList give me some trouble. The > field description is actually in the OGRFeatureDefn but the > feature->GetFieldAsIntegerList ("name", &size) method returns a NULL > pointer. Yes, when reading back those files, the field is presumably of String type, so GetFieldAsIntegerList() returns NULL. But GetFieldAsString() should return the serialized content in the "{N:v1,v2,...,vn}" format. You can confirm that easily by using ogrinfo. > > Is there a specific procedure to handle IntegerLists ? Or is it an > unsupported feature ? Very few drivers fully support round-tripping of IntegerList, RealList of StringList types. AFAIR, PostgreSQL is one of them, but that must be about it. The GML driver supports it in read mode, but not in write mode (although that could probably be improved) > > Thanks, > > Bruno Belarte > > PS : I work with C++ and gdal 1.9.0 on ubuntu 12.04 64bits > ___ > gdal-dev mailing list > gdal-dev@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/gdal-dev > ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Reading an IntegerList from file
Hi, I am currently working on exporting some data (an adjacency graph with nodes described by an id (integer), an OGRGeometry and some other fields (string and real) into a file. I choose to export the adjacency relation as an IntegerList field (for each node, the list contains the id of all the adjacent nodes). It works for several file type (KML, GML, SQLite, but not shapefile as it doesn't support IntegerList field type). Everything works fine and the output files contains all the data that I want. The problem comes when I want to do the opposite. When I open a file that I precedently wrote, the IntegerList give me some trouble. The field description is actually in the OGRFeatureDefn but the feature->GetFieldAsIntegerList ("name", &size) method returns a NULL pointer. Is there a specific procedure to handle IntegerLists ? Or is it an unsupported feature ? Thanks, Bruno Belarte PS : I work with C++ and gdal 1.9.0 on ubuntu 12.04 64bits ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] OCI driver and setting the client encoding
Hi, I spent some nice hours trying to get the Finnish characters to appear right in Oracle. Now it looks like I have found a working solution but I would like to know if it is correct and reliable. I am on Windows, Finnins-Finland and chcp shows me code 850. Our Oracle is using UTF-8 encoding. I tried to transfer data from Spatialite (UTF-8) into Oracle but non-ASCII characters were not transferred right. I converted data from Spatialite into GML and tried what happens with native UTF-8. Not good so I converted GML into ISO-8859-1 with iconv. Bad luck even this way. Then I converted data into shapefiles and had some trials with setting the SHAPE_ENCODING environment and still the characters were wrong in Oracle side. I continued and read a few documents about Oracle NLS_LANG settings and tried to set NLS_LANG to correspond with what I thought to suit my console settings. This made difference; I got still wrong results but they were different and I started to believe that I may be able to win the beast. Finally I set environment as SET NLS_LANG=american.america.UTF8 Now I seem to get right characters into Oracle from Spatialite, GML, and shapefiles. Is this the right thing to do? If yes, will it work also for other locales and could it thus be worth mentioning in the OCI documentation http://www.gdal.org/ogr/drv_oci.html? Could it even be initialized automatically by the OCI driver? -Jukka Rahkonen- ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev