From 96818293bd4e569b54f06a8c5669e4623c0e43ad Mon Sep 17 00:00:00 2001 From: John Bampton Date: Tue, 28 Feb 2023 21:44:05 +1000 Subject: [PATCH] [DOCS] ipynb: remove unneeded whitespace --- binder/ApacheSedonaRaster.ipynb | 46 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/binder/ApacheSedonaRaster.ipynb b/binder/ApacheSedonaRaster.ipynb index 77bc80979c..e0e53e405d 100644 --- a/binder/ApacheSedonaRaster.ipynb +++ b/binder/ApacheSedonaRaster.ipynb @@ -170,7 +170,7 @@ } ], "source": [ - "''' RS_GetBand() will fetch a particular band from given data array which is the concatenation of all the bands'''\n", + "'''RS_GetBand() will fetch a particular band from given data array which is the concatenation of all the bands'''\n", "\n", "df = df.selectExpr(\"Geom\",\"RS_GetBand(data, 1,bands) as Band1\",\"RS_GetBand(data, 2,bands) as Band2\",\"RS_GetBand(data, 3,bands) as Band3\", \"RS_GetBand(data, 4,bands) as Band4\")\n", "df.createOrReplaceTempView(\"allbands\")\n", @@ -204,7 +204,7 @@ } ], "source": [ - "''' RS_NormalizedDifference can be used to calculate NDVI for a particular geotiff image since it uses same computational formula as ndvi'''\n", + "'''RS_NormalizedDifference can be used to calculate NDVI for a particular geotiff image since it uses same computational formula as ndvi'''\n", "\n", "NomalizedDifference = df.selectExpr(\"RS_NormalizedDifference(Band1, Band2) as normDiff\")\n", "NomalizedDifference.show(5)" @@ -230,7 +230,7 @@ } ], "source": [ - "''' RS_Mean() can used to calculate mean of piel values in a particular spatial band '''\n", + "'''RS_Mean() can used to calculate mean of piel values in a particular spatial band'''\n", "meanDF = df.selectExpr(\"RS_Mean(Band1) as mean\")\n", "meanDF.show(5)" ] @@ -280,7 +280,7 @@ } ], "source": [ - "''' RS_GreaterThan() is used to mask all the values with 1 which are greater than a particular threshold'''\n", + "'''RS_GreaterThan() is used to mask all the values with 1 which are greater than a particular threshold'''\n", "greaterthanDF = spark.sql(\"Select RS_GreaterThan(Band1,1000.0) as greaterthan from allbands\")\n", "greaterthanDF.show()" ] @@ -305,7 +305,7 @@ } ], "source": [ - "''' RS_GreaterThanEqual() is used to mask all the values with 1 which are greater than a particular threshold'''\n", + "'''RS_GreaterThanEqual() is used to mask all the values with 1 which are greater than a particular threshold'''\n", "\n", "greaterthanEqualDF = spark.sql(\"Select RS_GreaterThanEqual(Band1,360.0) as greaterthanEqual from allbands\")\n", "greaterthanEqualDF.show()" @@ -331,7 +331,7 @@ } ], "source": [ - "''' RS_LessThan() is used to mask all the values with 1 which are less than a particular threshold'''\n", + "'''RS_LessThan() is used to mask all the values with 1 which are less than a particular threshold'''\n", "lessthanDF = spark.sql(\"Select RS_LessThan(Band1,1000.0) as lessthan from allbands\")\n", "lessthanDF.show()" ] @@ -356,7 +356,7 @@ } ], "source": [ - "''' RS_LessThanEqual() is used to mask all the values with 1 which are less than equal to a particular threshold'''\n", + "'''RS_LessThanEqual() is used to mask all the values with 1 which are less than equal to a particular threshold'''\n", "lessthanEqualDF = spark.sql(\"Select RS_LessThanEqual(Band1,2890.0) as lessthanequal from allbands\")\n", "lessthanEqualDF.show()" ] @@ -381,7 +381,7 @@ } ], "source": [ - "''' RS_Add() can add two spatial bands together'''\n", + "'''RS_Add() can add two spatial bands together'''\n", "sumDF = df.selectExpr(\"RS_Add(Band1, Band2) as sumOfBand\")\n", "sumDF.show(5)" ] @@ -406,7 +406,7 @@ } ], "source": [ - "''' RS_Subtract() can subtract two spatial bands together'''\n", + "'''RS_Subtract() can subtract two spatial bands together'''\n", "subtractDF = df.selectExpr(\"RS_Subtract(Band1, Band2) as diffOfBand\")\n", "subtractDF.show(5)" ] @@ -431,7 +431,7 @@ } ], "source": [ - "''' RS_Multiply() can multiple two bands together'''\n", + "'''RS_Multiply() can multiple two bands together'''\n", "multiplyDF = df.selectExpr(\"RS_Multiply(Band1, Band2) as productOfBand\")\n", "multiplyDF.show(5)" ] @@ -456,7 +456,7 @@ } ], "source": [ - "''' RS_Divide() can divide two bands together'''\n", + "'''RS_Divide() can divide two bands together'''\n", "divideDF = df.selectExpr(\"RS_Divide(Band1, Band2) as divisionOfBand\")\n", "divideDF.show(5)" ] @@ -481,7 +481,7 @@ } ], "source": [ - "''' RS_MultiplyFactor() will multiply a factor to a spatial band'''\n", + "'''RS_MultiplyFactor() will multiply a factor to a spatial band'''\n", "mulfacDF = df.selectExpr(\"RS_MultiplyFactor(Band2, 2) as target\")\n", "mulfacDF.show(5)" ] @@ -506,7 +506,7 @@ } ], "source": [ - "''' RS_BitwiseAND() will return AND between two values of Bands'''\n", + "'''RS_BitwiseAND() will return AND between two values of Bands'''\n", "bitwiseAND = df.selectExpr(\"RS_BitwiseAND(Band1, Band2) as AND\")\n", "bitwiseAND.show(5)" ] @@ -531,7 +531,7 @@ } ], "source": [ - "''' RS_BitwiseOR() will return OR between two values of Bands'''\n", + "'''RS_BitwiseOR() will return OR between two values of Bands'''\n", "bitwiseOR = df.selectExpr(\"RS_BitwiseOR(Band1, Band2) as OR\")\n", "bitwiseOR.show(5)" ] @@ -556,7 +556,7 @@ } ], "source": [ - "''' RS_Count() will calculate the total number of occurrence of a target value'''\n", + "'''RS_Count() will calculate the total number of occurrence of a target value'''\n", "countDF = df.selectExpr(\"RS_Count(RS_GreaterThan(Band1,1000.0), 1.0) as count\")\n", "countDF.show(5)" ] @@ -581,7 +581,7 @@ } ], "source": [ - "''' RS_Modulo() will calculate the modulus of band value with respect to a given number'''\n", + "'''RS_Modulo() will calculate the modulus of band value with respect to a given number'''\n", "moduloDF = df.selectExpr(\"RS_Modulo(Band1, 21.0) as modulo \")\n", "moduloDF.show(5)" ] @@ -606,7 +606,7 @@ } ], "source": [ - "''' RS_SquareRoot() will calculate calculate square root of all the band values upto two decimal places'''\n", + "'''RS_SquareRoot() will calculate calculate square root of all the band values upto two decimal places'''\n", "rootDF = df.selectExpr(\"RS_SquareRoot(Band1) as root\")\n", "rootDF.show(5)\n" ] @@ -631,7 +631,7 @@ } ], "source": [ - "''' RS_LogicalDifference() will return value from band1 if value at that particular location is not equal tp band1 else it will return 0'''\n", + "'''RS_LogicalDifference() will return value from band1 if value at that particular location is not equal tp band1 else it will return 0'''\n", "logDiff = df.selectExpr(\"RS_LogicalDifference(Band1, Band2) as loggDifference\")\n", "logDiff.show(5)" ] @@ -656,7 +656,7 @@ } ], "source": [ - "''' RS_LogicalOver() will iterate over two bands and return value of first band if it is not equal to 0 else it will return value from later band'''\n", + "'''RS_LogicalOver() will iterate over two bands and return value of first band if it is not equal to 0 else it will return value from later band'''\n", "logOver = df.selectExpr(\"RS_LogicalOver(Band3, Band2) as logicalOver\")\n", "logOver.show(5)" ] @@ -693,7 +693,7 @@ } ], "source": [ - "''' Plotting images as a dataframe using geotiff Dataframe.'''\n", + "'''Plotting images as a dataframe using geotiff Dataframe.'''\n", "\n", "df = spark.read.format(\"geotiff\").option(\"dropInvalid\",True).option(\"readToCRS\", \"EPSG:4326\").load(DATA_DIR)\n", "df = df.selectExpr(\"image.origin as origin\",\"ST_GeomFromWkt(image.geometry) as Geom\", \"image.height as height\", \"image.width as width\", \"image.data as data\", \"image.nBands as bands\")\n", @@ -942,7 +942,7 @@ } ], "source": [ - "''' RS_Append() takes the data array containing bands, a new band to be appended, and number of total bands in the data array.\n", + "'''RS_Append() takes the data array containing bands, a new band to be appended, and number of total bands in the data array.\n", " It appends the new band to the end of the data array and returns the appended data'''\n", "\n", "df = df.selectExpr(\"origin\", \"geom\", \"RS_Append(data, normalizedDifference, bands) as data_edited\", \"height\", \"width\", \"bands\").drop(\"data\")\n", @@ -988,7 +988,7 @@ } ], "source": [ - "''' Sample UDF calculates sum of all the values in a band which are greater than 1000.0 '''\n", + "'''Sample UDF calculates sum of all the values in a band which are greater than 1000.0'''\n", "\n", "def SumOfValues(band):\n", " total = 0.0\n", @@ -1047,7 +1047,7 @@ } ], "source": [ - "''' Sample UDF to visualize a particular region of a GeoTiff image'''\n", + "'''Sample UDF to visualize a particular region of a GeoTiff image'''\n", "\n", "def generatemask(band, width,height):\n", " for (i,val) in enumerate(band):\n",