12 | | '''USAGE:'''[[BR]]'''gdal2wktraster.py''' -r rasterfile [-r rasterfile] -t [<schema>.]<table> [<options>] |
13 | | |
14 | | '''-r''' <rasterfile> Specifies input raster file. Multiple -r options can be specified for a number of input files or wildcards can be used (? and *). At least one input raster file is REQUIRED.[[BR]]'''-t''' <table> Name of destination table in with or without target schema specified. This parameter is REQUIRED. |
15 | | |
16 | | |
17 | | '''OPTIONS:'''[[BR]]'''-s''' <srid> Set the SRID field. Default is -1.[[BR]]'''-b''' <nbband> Specify the number of band. The number of rasterfile must correspond to this number.[[BR]]'''-f''' <field> Name of target column for raster data. Default column name is rast.[[BR]]'''-I''' Create a GiST index on the raster column.[[BR]]'''-o''' <file> Output file for generated SQL commands. If not specified, stdout is assumed.[[BR]]'''-R''' Simply register the raster in the database. Absolute path to the raster and georeferencing informations are stored instead of the raster actual data.[[BR]]'''-F''' Add a "filename" column containing the original name of the loaded raster file. |
| 16 | '''USAGE:'''[[BR]] |
| 17 | '''gdal2wktraster.py''' -r rasterfile [-r rasterfile] -t [<schema>.]<table> [<options>] |
| 18 | |
| 19 | '''-r''' <rasterfile> Specifies input raster file. Multiple -r options can be specified for a number of input files or wildcards can be used (? and *). At least one input raster file is REQUIRED.[[BR]] |
| 20 | '''-t''' <table> Name of destination table in with or without target schema specified. This parameter is REQUIRED. |
| 21 | |
| 22 | |
| 23 | '''OPTIONS:'''[[BR]] |
| 24 | '''-s''' <srid> Set the SRID field. Default is -1.[[BR]] |
| 25 | '''-b''' <nbband> Specify the number of band. The number of rasterfile must correspond to this number.[[BR]] |
| 26 | '''-f''' <field> Name of target column for raster data. Default column name is rast.[[BR]] |
| 27 | '''-I''' Create a GiST index on the raster column.[[BR]] |
| 28 | '''-o''' <file> Output file for generated SQL commands. If not specified, stdout is assumed.[[BR]] |
| 29 | '''-R''' Simply register the raster in the database. Absolute path to the raster and georeferencing informations are stored instead of the raster actual data.[[BR]] |
| 30 | '''-F''' Add a "filename" column containing the original name of the loaded raster file. |
43 | | '''OPTIONS:'''[[BR]]'''-s''' <srid> Set the SRID field. Default is -1.[[BR]]'''-b''' <nbband> Specify the number of band. The number of rasterfile must correspond to this number.[[BR]]'''-P''' <pixeltypes> Specify the pixels types in which to store each band. Ex. ‘8-bit unsigned integer,16-bit float’. conversion may happens.[[BR]]'''-n''' <nodata values> Specify the nodata value for each bands. Ex. ‘0,0.0’. Default to ‘none’ for each band.[[BR]]'''-t''' <pixels> Divide rasters into <pixels>x<pixels> tiles, one tile per row. Default is to store whole rasters as one row. |
| 60 | '''OPTIONS:'''[[BR]] |
| 61 | '''-s''' <srid> Set the SRID field. Default is -1.[[BR]] |
| 62 | '''-b''' <nbband> Specify the number of band. The number of rasterfile must correspond to this number.[[BR]] |
| 63 | '''-P''' <pixeltypes> Specify the pixels types in which to store each band. Ex. ‘8-bit unsigned integer,16-bit float’. conversion may happens.[[BR]] |
| 64 | '''-n''' <nodata values> Specify the nodata value for each bands. Ex. ‘0,0.0’. Default to ‘none’ for each band.[[BR]] |
| 65 | '''-t''' <pixels> Divide rasters into <pixels>x<pixels> tiles, one tile per row. Default is to store whole rasters as one row. |
58 | | '''RT_SRID(raster|geometry) -> integer'''[[BR]]Return the SRID associated with the raster. |
59 | | |
60 | | '''RT_Width(raster) -> integer'''[[BR]]Return the width of the raster. |
61 | | |
62 | | '''RT_Height(raster) -> integer'''[[BR]]Return the height of the raster. |
63 | | |
64 | | '''RT_PixelSizeX(raster) -> float64'''[[BR]]Return the georeference's X pixel size of the raster. [http://en.wikipedia.org/wiki/World_file See]. |
65 | | |
66 | | '''RT_PixelSizeY(raster) -> float64'''[[BR]]Return the georeference's Y pixel size of the raster. [http://en.wikipedia.org/wiki/World_file See]. |
67 | | |
68 | | '''RT_RotationX(raster) -> float64'''[[BR]]Return the georeference's X rotation. |
69 | | |
70 | | '''RT_RotationY(raster) -> float64'''[[BR]]Return the georeference's Y rotation. [http://en.wikipedia.org/wiki/World_file See]. |
71 | | |
72 | | '''RT_UpperLeftX(raster) -> float64'''[[BR]]Return the georeference's X-coordinate of the center of the upper left pixel. [http://en.wikipedia.org/wiki/World_file See]. |
73 | | |
74 | | '''RT_UpperLeftY(raster) -> float64'''[[BR]]Return the georeference's Y-coordinate of the center of the upper left pixel. [http://en.wikipedia.org/wiki/World_file See]. |
75 | | |
76 | | '''RT_GeoReference(raster) -> string'''[[BR]]Return the georeference of the raster as a string representing the 6 doubles of an equivalent world file (including the carriage return). [http://en.wikipedia.org/wiki/World_file See]. |
77 | | |
78 | | '''RT_NumBands(raster) -> integer'''[[BR]]Return the number of band included in the raster. |
79 | | |
80 | | '''RT_BandPixelType(raster, integer) -> string'''[[BR]]Return the pixel type of the specified 1-based Nth band of raster. Band index is 1-based. The function returns one of the following values: |
| 83 | '''RT_SRID(raster|geometry) -> integer'''[[BR]] |
| 84 | Return the SRID associated with the raster. |
| 85 | |
| 86 | '''RT_Width(raster) -> integer'''[[BR]] |
| 87 | Return the width of the raster. |
| 88 | |
| 89 | '''RT_Height(raster) -> integer'''[[BR]] |
| 90 | Return the height of the raster. |
| 91 | |
| 92 | '''RT_PixelSizeX(raster) -> float64'''[[BR]] |
| 93 | Return the georeference's X pixel size of the raster. [http://en.wikipedia.org/wiki/World_file See]. |
| 94 | |
| 95 | '''RT_PixelSizeY(raster) -> float64'''[[BR]] |
| 96 | Return the georeference's Y pixel size of the raster. [http://en.wikipedia.org/wiki/World_file See]. |
| 97 | |
| 98 | '''RT_RotationX(raster) -> float64'''[[BR]] |
| 99 | Return the georeference's X rotation. |
| 100 | |
| 101 | '''RT_RotationY(raster) -> float64'''[[BR]] |
| 102 | Return the georeference's Y rotation. [http://en.wikipedia.org/wiki/World_file See]. |
| 103 | |
| 104 | '''RT_UpperLeftX(raster) -> float64'''[[BR]] |
| 105 | Return the georeference's X-coordinate of the center of the upper left pixel. [http://en.wikipedia.org/wiki/World_file See]. |
| 106 | |
| 107 | '''RT_UpperLeftY(raster) -> float64'''[[BR]] |
| 108 | Return the georeference's Y-coordinate of the center of the upper left pixel. [http://en.wikipedia.org/wiki/World_file See]. |
| 109 | |
| 110 | '''RT_GeoReference(raster) -> string'''[[BR]] |
| 111 | Return the georeference of the raster as a string representing the 6 doubles of an equivalent world file (including the carriage return). [http://en.wikipedia.org/wiki/World_file See]. |
| 112 | |
| 113 | '''RT_NumBands(raster) -> integer'''[[BR]] |
| 114 | Return the number of band included in the raster. |
| 115 | |
| 116 | '''RT_BandPixelType(raster, integer) -> string'''[[BR]] |
| 117 | Return the pixel type of the specified 1-based Nth band of raster. Band index is 1-based. The function returns one of the following values: |
99 | | '''RT_GetBBox(raster) -> polygon geometry'''[[BR]]'''RT_Envelope(raster|geometry) -> polygon geometry'''[[BR]]'''RT_Shape(raster) -> polygon geometry'''[[BR]]'''RT_AsPolygon(raster) -> polygon geometry set'''[[BR]]'''RT_Intersects(raster|geometry, raster|geometry)'''[[BR]]'''RT_Intersection(raster|geometry, raster|geometry, ‘raster’|’geometry’)->raster/geometry''' |
| 137 | '''RT_GetBBox(raster) -> polygon geometry'''[[BR]] |
| 138 | '''RT_Envelope(raster|geometry) -> polygon geometry'''[[BR]] |
| 139 | '''RT_Shape(raster) -> polygon geometry'''[[BR]] |
| 140 | '''RT_AsPolygon(raster) -> polygon geometry set'''[[BR]] |
| 141 | '''RT_Intersects(raster|geometry, raster|geometry)'''[[BR]] |
| 142 | '''RT_Intersection(raster|geometry, raster|geometry, ‘raster’|’geometry’)->raster/geometry''' |
110 | | There is two options to select the band to convert from a multiband raster in all the RT_AsFormat functions. [[BR]][[BR]] |
111 | | 1. Precede each call with RT_Band() to return a selected band.[[BR]]Pros: This is a general function that can be called before any function that would otherwise require a band parameter.[[BR]]Cons: This implies creating a temporary raster. This might be more elegant and general but is this too much overhead comparing with having a band parameter?[[BR]][[BR]] |
112 | | 1. Add a band parameter to each RT_AsFormat function.[[BR]]Pros: Hypothetically less overhead.[[BR]]Cons: Every functions implying access to a band should then have this parameter when in most case it would be equal to 1. In many cases it makes no sence to have to specify a band parameter since it is the whole raster that we want to export, including all the bands. |
| 154 | There is two options to select the band to convert from a multiband raster in all the RT_AsFormat functions. [[BR]] |
| 155 | [[BR]] |
| 156 | 1. Precede each call with RT_Band() to return a selected band.[[BR]] |
| 157 | Pros: This is a general function that can be called before any function that would otherwise require a band parameter.[[BR]] |
| 158 | Cons: This implies creating a temporary raster. This might be more elegant and general but is this too much overhead comparing with having a band parameter?[[BR]] |
| 159 | [[BR]] |
| 160 | 1. Add a band parameter to each RT_AsFormat function.[[BR]] |
| 161 | Pros: Hypothetically less overhead.[[BR]] |
| 162 | Cons: Every functions implying access to a band should then have this parameter when in most case it would be equal to 1. In many cases it makes no sence to have to specify a band parameter since it is the whole raster that we want to export, including all the bands. |
120 | | '''RT_Band(raster, band) -> raster'''[[BR]]Return a single band from a multiband raster. If "band" is greater than the value returned by RT_GetNumBands(), the function returns the last band. This function should be used to select a band before converting it to JPEG, TIFF, PNG, SVG or KML with the corresponding function. e.g. '''RT_AsJPEG(RT_Band(raster, band), quality) |
121 | | |
122 | | '''RT_AsJPEG(raster, quality) -> JPEG as "bytea"'''[[BR]]Return the raster as a JPEG encoded as a PostgreSQL bytea. By default quality is set to 75, but this option can be used to select other values. Values must be in the range 10-100. Low values result in higher compression ratios, but poorer image quality. Values above 95 are not meaningfully better quality but can but substantially larger. (copied from http://www.gdal.org/frmt_jpeg.html) |
| 170 | '''RT_Band(raster, band) -> raster'''[[BR]] |
| 171 | Return a single band from a multiband raster. If "band" is greater than the value returned by RT_GetNumBands(), the function returns the last band. This function should be used to select a band before converting it to JPEG, TIFF, PNG, SVG or KML with the corresponding function. e.g. '''RT_AsJPEG(RT_Band(raster, band), quality) |
| 172 | |
| 173 | '''RT_AsJPEG(raster, quality) -> JPEG as "bytea"'''[[BR]] |
| 174 | Return the raster as a JPEG encoded as a PostgreSQL bytea. By default quality is set to 75, but this option can be used to select other values. Values must be in the range 10-100. Low values result in higher compression ratios, but poorer image quality. Values above 95 are not meaningfully better quality but can but substantially larger. (copied from http://www.gdal.org/frmt_jpeg.html) |
139 | | * Method "MaxMinValue": Use the Max and the Min cached in the raster. e.g. for 16BSI (min, max) -> (-2033, 2456) -> (round((-2033 - -2033)/(2456 - -2033)*255), round((2456 - -2033)/(2456 - -2033)*255)) -> (0, 255).[[BR]][[BR]]This is equivalent to RT_AsJPEG(raster, quality, RT_Minimum(rast), RT_Maximum(rast)) |
140 | | |
141 | | * Method "MaxMinType": Use the Max and the Min allowed by the type. e.g. for 16BSI (min, max) -> (-2033, 2456) -> (round((-2033 - -32768)/(32767 - -32768)*255), round((2456 - -32768)/(32767 - -32768)*255)) -> (120, 137)[[BR]][[BR]]This would be equivalent to RT_AsJPEG(raster, quality, RT_BandPixelTypeMin(rast), RT_BandPixelTypeMax(rast)). Both functions (RT_BandPixelTypeMin & BandPixelTypeMax) are not yet planned and I could not find an SQL query that returns the equivalent range for a type. [http://groups.google.nl/group/microsoft.public.sqlserver.programming/browse_thread/thread/46512c2691da4607/6743f4aea485c6d1 One possible solution.] |
| 191 | * Method "MaxMinValue": Use the Max and the Min cached in the raster. e.g. for 16BSI (min, max) -> (-2033, 2456) -> (round((-2033 - -2033)/(2456 - -2033)*255), round((2456 - -2033)/(2456 - -2033)*255)) -> (0, 255).[[BR]] |
| 192 | [[BR]]This is equivalent to RT_AsJPEG(raster, quality, RT_Minimum(rast), RT_Maximum(rast)) |
| 193 | |
| 194 | * Method "MaxMinType": Use the Max and the Min allowed by the type. e.g. for 16BSI (min, max) -> (-2033, 2456) -> (round((-2033 - -32768)/(32767 - -32768)*255), round((2456 - -32768)/(32767 - -32768)*255)) -> (120, 137)[[BR]] |
| 195 | [[BR]]This would be equivalent to RT_AsJPEG(raster, quality, RT_BandPixelTypeMin(rast), RT_BandPixelTypeMax(rast)). Both functions (RT_BandPixelTypeMin & BandPixelTypeMax) are not yet planned and I could not find an SQL query that returns the equivalent range for a type. [http://groups.google.nl/group/microsoft.public.sqlserver.programming/browse_thread/thread/46512c2691da4607/6743f4aea485c6d1 One possible solution.] |
203 | | This section is dedicated to discussion that took place during the [http://wiki.osgeo.org/wiki/Toronto_Code_Sprint_2009 Toronto Code Sprint 2009].[[BR]][[BR]] |
204 | | 1. Bug tracking - Launch separate Google project or join PostGIS bug tracker, as a module? Answer: We will track our bug in the PostGIS Google Code project. PostGIS plan on moving (back) to Trac soon.[[BR]][[BR]] |
205 | | 1. Wiki: is there a chance to have a better wiki for documentation, schedule, specs, road map, users inputs? Actual PostGIS wiki limitations: security, no images, no tables (or sophisticated page structure) (For this Leo and Regina are drafting up a PSC and then once we have a PSC we'll vote to locate on OSGEO. Main issue is Refractions server is kind of old)[[BR]][[BR]] |
| 259 | This section is dedicated to discussion that took place during the [http://wiki.osgeo.org/wiki/Toronto_Code_Sprint_2009 Toronto Code Sprint 2009].[[BR]] |
| 260 | [[BR]] |
| 261 | 1. Bug tracking - Launch separate Google project or join PostGIS bug tracker, as a module? Answer: We will track our bug in the PostGIS Google Code project. PostGIS plan on moving (back) to Trac soon.[[BR]] |
| 262 | [[BR]] |
| 263 | 1. Wiki: is there a chance to have a better wiki for documentation, schedule, specs, road map, users inputs? Actual PostGIS wiki limitations: security, no images, no tables (or sophisticated page structure) (For this Leo and Regina are drafting up a PSC and then once we have a PSC we'll vote to locate on OSGEO. Main issue is Refractions server is kind of old)[[BR]] |
| 264 | [[BR]] |