@@ -190,8 +190,8 @@ def createRaster(
190190
191191 srs : Anything acceptable to geokit.srs.loadSRS(); optional
192192 The srs of the point to create
193- * If not given, longitude/latitude is assumed
194- * srs MUST be given as a keyword argument
193+ * If not given, no srs will be assigned to the created raster. Please be
194+ aware that some operations may not work correctly if no SRS is given.
195195 * If 'bounds' is an Extent object, the bounds' internal srs will override
196196 this input
197197
@@ -335,6 +335,11 @@ def createRaster(
335335 if srs is not None :
336336 rasterSRS = SRS .loadSRS (srs )
337337 raster .SetProjection (rasterSRS .ExportToWkt ())
338+ else :
339+ warnings .warn (
340+ message = "No srs given when creating raster. Please be aware that some operations may not work correctly." ,
341+ category = UserWarning ,
342+ )
338343
339344 # Fill the raster will zeros, null values, or initial values (if given)
340345 band : gdal .Band = raster .GetRasterBand (raster_band_index )
@@ -1965,7 +1970,7 @@ def drawRaster(
19651970 vmax : float | None = None ,
19661971 cmap = "viridis" ,
19671972 cbargs = None ,
1968- cutlineFillValue = - 9999 ,
1973+ noData : numeric | None = None ,
19691974 zorder = 0 ,
19701975 resampleAlg : Literal [
19711976 "near" ,
@@ -2012,13 +2017,9 @@ def drawRaster(
20122017 cutline : str or ogr.Geometry; optional
20132018 The cutline to limit the drawn data too
20142019 * If a string is given, it must be a path to a vector file
2015- * Values outside of the cutline are given the value 'cutlineFillValue'
2020+ * Values outside of the cutline are given the noData value of the raster
20162021 * Requires a warp
20172022
2018- cutlineFillValue : numeric; optional
2019- The value to give to values outside a cutline
2020- * Has no effect when cutline is not given
2021-
20222023 figsize : (int, int); optional
20232024 The figure size to create when generating a new axis
20242025 * If resultign figure looks weird, altering the figure size is your best
@@ -2054,6 +2055,9 @@ def drawRaster(
20542055
20552056 cbargs : dict; optional
20562057
2058+ noData : numeric; optional
2059+ Replaces all previous noData values with this value in the output raster.
2060+
20572061 resampleAlg : str, optional
20582062 The resampleAlg passed on to a call of warp() if needed, by default "med"
20592063
@@ -2123,8 +2127,7 @@ def drawRaster(
21232127 pixelWidth = xres ,
21242128 srs = srs ,
21252129 bounds = bounds ,
2126- fill = cutlineFillValue ,
2127- noData = None ,
2130+ noData = noData ,
21282131 resampleAlg = resampleAlg ,
21292132 ** warp_kwargs ,
21302133 )
@@ -2133,8 +2136,6 @@ def drawRaster(
21332136
21342137 # Read the Data
21352138 data = extractMatrix (source ).astype (float )
2136- if cutlineFillValue is not None :
2137- data [data == cutlineFillValue ] = np .nan
21382139
21392140 data [data == info .noData ] = np .nan
21402141
@@ -2427,8 +2428,7 @@ def warp(
24272428 srs : srs_input | None = None ,
24282429 bounds : tuple [numeric , numeric , numeric , numeric ] | None = None ,
24292430 dtype : None | geokit_c_data_types_literal = None ,
2430- noData = None ,
2431- fill : numeric | None = None ,
2431+ noData : numeric | None = None ,
24322432 overwrite : bool = True ,
24332433 meta : None | dict [str , str ] = None ,
24342434 ** kwargs ,
@@ -2488,15 +2488,11 @@ def warp(
24882488 - a String such as "Byte", "UInt16", or "Double"
24892489
24902490 noData : numeric; optional
2491- The no-data value to apply to the output raster
2491+ Replaces all previous noData values with this value in the output raster.
24922492
24932493 meta: dict; optional: contains a key value pair that is passed to the
24942494 output gdal.dataset using the SetMetadataItem method.
24952495
2496- fill : numeric; optional
2497- The fill data to place into the new raster before warping occurs
2498- * Does not play a role when writing a file to disk
2499-
25002496 **kwargs:
25012497 * All keyword arguments are passed on to a call to gdal.WarpOptions
25022498 * Use these to fine-tune the warping procedure
@@ -2570,12 +2566,6 @@ def warp(
25702566 pass
25712567 else :
25722568 raise GeoKitRasterError ("noData must be a numeric or boolean value but got: %s" % str (type (noDataRead )))
2573- if isinstance (fill , (numeric , bool )):
2574- list_of_numbers .append (fill )
2575- elif fill is None :
2576- pass
2577- else :
2578- raise GeoKitRasterError ("fill must be a numeric boolean or None value but got: %s" % str (type (fill )))
25792569
25802570 list_of_datatypes = []
25812571 if isinstance (dtype , str ):
@@ -2675,7 +2665,6 @@ def warp(
26752665 dy = pixelHeight ,
26762666 dtype = gdal_data_type_string ,
26772667 noData = noDataRead ,
2678- fill = fill ,
26792668 )
26802669
26812670 # Do a warp
0 commit comments