Re: [gdal-dev] Convert S57 to image with S52 rendering
Sylvain Duclos, Thanks. And is there is simple way to automaticaly convert s-57 maps to tiled raster images with specified scale? May be not following s-52 specs. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-dev-Convert-S57-to-image-with-S52-rendering-tp4987897p5158977.html Sent from the GDAL - Dev mailing list archive at Nabble.com. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Problem encountered in stitching/merging the raster files
On 29/08/2014 04:09, precy wrote: I have 4(sometimes 5) raster images and projected these using gdalwarp. I've tried stitching these images using these commands gdal_merge.py -n 0 -a_nodata 0 -of GTiff -0 output.tif a.tif b.tif c.tif d.tif e.tif. The first 3 images was stitched and the last 2 images was also stitched, but they were stitched separately but saved in one image.How will I solve this? I want the 5 raster to be stitch(mosaic) properly without spaces in between. I have attached here the output image(as what you will observe there was a space/cut in between the stitched images). Thanks! http://osgeo-org.1560.x6.nabble.com/file/n5158957/output.gif Note: The original image was a tif file, I just converted it in gif because it returned error due to the limit of the message size. You can use gdalwarp to reproject and merge several maps at the same time : gdalwarp -t_srs srs_def a.tif b.tif c.tif d.tif e.tif output.tif ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Problem encountered in stitching/merging the raster files
I've tried your suggestion but then the result was this: Note: I used OpenEV to open the file. http://osgeo-org.1560.x6.nabble.com/file/n5158992/openev.gif -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-encountered-in-stitching-merging-the-raster-files-tp5158957p5158992.html Sent from the GDAL - Dev mailing list archive at Nabble.com. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Try to create a .bat for ogr2ogr
Hi guys, i'm giving the first steps in this kind of programming. So the scenario is: I have a lot of users that dump work shapfiles into a folder, then i need to upload this files to a database into a single table (at this time i'm testing the PostGIS). So I read some snippets code and some tutorials and i try to do the .bat but at this time i have some errors. Note: I put the name of user and password with dummy value :) The error that give me for the 2 test shapefiles that i try to import is: ERROR 1: Unable to write feature 0 from layer Polygon1. ERROR 1: Terminating translation prematurely after failed translation of layer Polygon1 (use -skipfailures to skip errors) ERROR 1: Unable to write feature 0 from layer Polygon2. ERROR 1: Terminating translation prematurely after failed translation of layer Polygon2 (use -skipfailures to skip errors) My actual code of the .bat is: @echo off for %%I in (inputs_pggis\*.shp) do ( echo Import shapefile %%~nxI to schema temp.upload Tabela PostGIS ... ogr2ogr -append -update -f PostgreSQL PG:dbname='temp_gis' user='test_user' password='test_pss' inputs_pggis/%%~nxI -nln temp.upload ) Best Regards, João ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Convert S57 to image with S52 rendering
Storkur, Yes, use the call : S52_dumpS57IDPixels(const char *toFilename, unsigned int S57ID, unsigned int width, unsigned int height); Check https://github.com/sduclos/S52/blob/master/S52.h for details rgds, Sylvain. On Fri, 8/29/14, Storkur sovof...@yandex.ru wrote: Subject: Re: [gdal-dev] Convert S57 to image with S52 rendering To: gdal-dev@lists.osgeo.org Received: Friday, August 29, 2014, 2:10 AM Sylvain Duclos, Thanks. And is there is simple way to automaticaly convert s-57 maps to tiled raster images with specified scale? May be not following s-52 specs. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-dev-Convert-S57-to-image-with-S52-rendering-tp4987897p5158977.html Sent from the GDAL - Dev mailing list archive at Nabble.com. ___ 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
Re: [gdal-dev] Problem encountered in stitching/merging the raster files
Am 29.08.2014 09:04, schrieb user_name: I've tried your suggestion but then the result was this: Note: I used OpenEV to open the file. Perhaps you should switch to QGIS. OpenEV is quite old, and may not work with all output of GDAL. The grey parts between the images should have NODATA value. HTH, André Joost ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] SVG support
Hi, I am using the 1.11 precompiled binaries with with libexpat included in the GDAL_DATA path. I am trying to read an SVG file, which according to the vector format support table should work. But it is failing and saying that it cannot open the file. Any thoughts on how to troubleshoot/resolve this? scott ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] SVG support
Scott, On Fri, Aug 29, 2014 at 9:25 AM, Scott Rowles scott_row...@hotmail.com wrote: Hi, I am using the 1.11 precompiled binaries with with libexpat included in the GDAL_DATA path. I am trying to read an SVG file, which according to the vector format support table should work. But it is failing and saying that it cannot open the file. The svg driver appears to be very limited: http://gdal.org/drv_svg.html Currently, it will only read SVG files that are the output from Cloudmade Vector Stream Server Any thoughts on how to troubleshoot/resolve this? scott ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev -- Kyle ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] SVG support
What is the source of your SVG file? According to the SVG driver page, only files produced with the Cloudmade Vector Stream Server will work. On 8/29/2014 9:25 AM, Scott Rowles wrote: Hi, I am using the 1.11 precompiled binaries with with libexpat included in the GDAL_DATA path. I am trying to read an SVG file, which according to the vector format support table should work. But it is failing and saying that it cannot open the file. Any thoughts on how to troubleshoot/resolve this? scott ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] SVG support
Yep. I don't know the origin of the SVG file. I am going to try an SVG file from the Cloudmade site and verify that it works! Date: Fri, 29 Aug 2014 09:44:43 -0600 From: g...@stripfamily.net To: scott_row...@hotmail.com; gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] SVG support What is the source of your SVG file? According to the SVG driver page, only files produced with the Cloudmade Vector Stream Server will work. On 8/29/2014 9:25 AM, Scott Rowles wrote: Hi, I am using the 1.11 precompiled binaries with with libexpat included in the GDAL_DATA path. I am trying to read an SVG file, which according to the vector format support table should work. But it is failing and saying that it cannot open the file. Any thoughts on how to troubleshoot/resolve this? scott ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] SVG support
Does cloudmade have any import and export tools that I could load in a CSV or shapefile and get a valid SVG returned? From: scott_row...@hotmail.com To: g...@stripfamily.net; gdal-dev@lists.osgeo.org Date: Fri, 29 Aug 2014 11:45:50 -0400 Subject: Re: [gdal-dev] SVG support Yep. I don't know the origin of the SVG file. I am going to try an SVG file from the Cloudmade site and verify that it works! Date: Fri, 29 Aug 2014 09:44:43 -0600 From: g...@stripfamily.net To: scott_row...@hotmail.com; gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] SVG support What is the source of your SVG file? According to the SVG driver page, only files produced with the Cloudmade Vector Stream Server will work. On 8/29/2014 9:25 AM, Scott Rowles wrote: Hi, I am using the 1.11 precompiled binaries with with libexpat included in the GDAL_DATA path. I am trying to read an SVG file, which according to the vector format support table should work. But it is failing and saying that it cannot open the file. Any thoughts on how to troubleshoot/resolve this? scott ___ 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
Re: [gdal-dev] Problem encountered in stitching/merging the raster files
user_name ljvillarin30 at gmail.com writes: I've tried your suggestion but then the result was this: Note: I used OpenEV to open the file. http://osgeo-org.1560.x6.nabble.com/file/n5158992/openev.gif Hi, Result looks like it is because the black slivers which are created by warping are not made transparent. Have a try by adding -dstnodata 0 0 0 to the gdalwarp command. -Jukka Rahkonen- ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] why do I get a floating point nodata value from a byte raster?
Le jeudi 28 août 2014 23:32:38, Richard Sharp a écrit : I have a byte GTiff dataset that has a nodata value of 0 according to QGIS. Well, I've just created such a file, and with QGIS 1.8, the GUI display well the -3.4028230607370965e+38 value, but with 2.4, it displays 0. So seems to be on QGIS side. That said, -3.4028230607370965e+38 doesn't make sense as a nodata value for Byte, which can only range from 0 to 255. After some testing, it seems that QGIS displays 0 when the nodata value is out of the range of the data type. However, when I load it using the gdal python API, I get this: ds= gdal.Open('cdl10lu83.tif') band=ds.GetRasterBand(1) band.GetNoDataValue() -3.4028230607370965e+38 Also when I run `gdalinfo` I see the same nodata value: Band 1 Block=128x128 Type=Byte, ColorInterp=Gray Min=0.000 Max=26.000 Minimum=0.000, Maximum=26.000, Mean=10.115, StdDev=5.072 NoData Value=-3.4028230607370965e+038 I'm running GDAL 1.11.0, although I've also experienced the same behavior on gdalinfo with 1.9.0. I'm using QGIS 2.4 which is built against GDAL 1.9. Any ideas what's going on and how to handle it? -- Richard P. Sharp Jr. Lead Software Architect Natural Capital Project Stanford University, U Minnesota, TNC, WWF 371 Serra Mall Stanford, CA 94305 http://www.stanford.edu/~rpsharp/ -- Spatialys - Geospatial professional services http://www.spatialys.com ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] How get EPSG code from an OGRSpatialReferenceH?
Le vendredi 29 août 2014 05:20:16, David Strip a écrit : It's my recollection from a question I posted here a little over a year ago that except for a few special cases, autoIdentifyEPSG only works if there is an authority node providing the EPSG. Hu, no. That would make it really useless. AutoIdentifyEPSG() tries to add EPSG authority and code on a very restricted set of common SRS that don't have it Hopefully someone will give you an authoritative answer. I believe GeoTools has the capability to find the EPSG from the WKT, but I have no idea how to interface to that On 8/28/2014 8:42 PM, Nik Sands wrote: Hi devs, What is the correct way to extract the EPSG code from an OGRSpatialReferenceH ? Currently I'm finding that the following works only for SRS of some images and not others: const char *charAuthType = OSRGetAttrValue(gdal.srcSRS, AUTHORITY, 0); const char *charSrsCode = OSRGetAttrValue(gdal.srcSRS, AUTHORITY, 1); However, there is no AUTHORITY node in some SRSs so it doesn't work for those images. To cater for this, I'm trying to explicitly set the authority node using: OSRAutoIdentifyEPSG(gdal.srcSRS); But this fails with OGRERR_UNSUPPORTED_SRS (even when it is an SRS that GDAL recognises and uses well). Yes, this is expected. There are just a few SRS definitions that are encoded in it. So I'm stumped... how do I reliably determine the EPSG for an OGRSpatialReferenceH? There's no real reliable way of doing that. There are approximative methods to get a best match. For example you could iterate on EPSG codes with importFromEPSG() and exportToProj4(), and compare with exportToProj4() on your WKT, but you can easily find situations where several EPSG SRS resolve to the same proj4 string. Anyway, there's currently no such ready-made heuristics method in GDAL, although it might be useful to have one ultimately. Cheers, Nik. ___ 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 -- Spatialys - Geospatial professional services http://www.spatialys.com ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] How get EPSG code from an OGRSpatialReferenceH?
On 8/29/2014 11:45 AM, Even Rouault wrote: Le vendredi 29 août 2014 05:20:16, David Strip a écrit : It's my recollection from a question I posted here a little over a year ago that except for a few special cases, autoIdentifyEPSG only works if there is an authority node providing the EPSG. Hu, no. That would make it really useless. AutoIdentifyEPSG() tries to add EPSG authority and code on a very restricted set of common SRS that don't have it Isn't that what I wrote? few special cases = very restricted set ? ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] How get EPSG code from an OGRSpatialReferenceH?
Le vendredi 29 août 2014 19:52:57, David Strip a écrit : On 8/29/2014 11:45 AM, Even Rouault wrote: Le vendredi 29 août 2014 05:20:16, David Strip a écrit : It's my recollection from a question I posted here a little over a year ago that except for a few special cases, autoIdentifyEPSG only works if there is an authority node providing the EPSG. Hu, no. That would make it really useless. AutoIdentifyEPSG() tries to add EPSG authority and code on a very restricted set of common SRS that don't have it Isn't that what I wrote? few special cases = very restricted set ? Sorry. Appears I read your sentence to fast and missed that except for a few specifal cases. -- Spatialys - Geospatial professional services http://www.spatialys.com ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] How get EPSG code from an OGRSpatialReferenceH?
Thanks for the answer. Not what I wanted to hear but such is life. (And I think it makes sense now that you explain it - ie, it's not a neatly reversible translation). It will complicate my user interface somewhat, but I think I've got an idea of how to work around it. Thanks, Nik. On 30 Aug 2014, at 3:45 am, Even Rouault even.roua...@spatialys.com wrote: On 8/28/2014 8:42 PM, Nik Sands wrote: Hi devs, What is the correct way to extract the EPSG code from an OGRSpatialReferenceH ? Currently I'm finding that the following works only for SRS of some images and not others: const char *charAuthType = OSRGetAttrValue(gdal.srcSRS, AUTHORITY, 0); const char *charSrsCode = OSRGetAttrValue(gdal.srcSRS, AUTHORITY, 1); However, there is no AUTHORITY node in some SRSs so it doesn't work for those images. To cater for this, I'm trying to explicitly set the authority node using: OSRAutoIdentifyEPSG(gdal.srcSRS); But this fails with OGRERR_UNSUPPORTED_SRS (even when it is an SRS that GDAL recognises and uses well). Yes, this is expected. There are just a few SRS definitions that are encoded in it. So I'm stumped... how do I reliably determine the EPSG for an OGRSpatialReferenceH? There's no real reliable way of doing that. There are approximative methods to get a best match. For example you could iterate on EPSG codes with importFromEPSG() and exportToProj4(), and compare with exportToProj4() on your WKT, but you can easily find situations where several EPSG SRS resolve to the same proj4 string. Anyway, there's currently no such ready-made heuristics method in GDAL, although it might be useful to have one ultimately. Cheers, Nik. ___ 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 -- Spatialys - Geospatial professional services http://www.spatialys.com ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev