Hi,

I think you are looking for something like this:
https://postgis.net/docs/RT_ST_Value.html

The raster support in Sedona is very limited at the moment. The lack of a
proper raster type makes implementing st_value impossible. We had a brief
discussion about that recently.
https://lists.apache.org/thread/qdfcvxl6z5pb7m7ky5zsksyytyxqwv8c

If you want to make a contribution and need some guidance, please let me
know!

Br,
Martin Andersson

Den ons 18 jan. 2023 kl 05:45 skrev Jia Yu <[email protected]>:

> Hi Pedro,
>
> I got your point. Unfortunately, we don't have this function yet in Sedona.
> But we welcome anyone who want to contribute this to Sedona!
>
> Thanks,
> Jia
>
> On Tue, Jan 17, 2023 at 9:11 AM Pedro Mano Fernandes <
> [email protected]>
> wrote:
>
> > Hi all,
> >
> > Any clue? Or any documentation I can refer to?
> >
> > Here goes a dummy example to better explain myself: in QGIS I can click a
> > point (coordinates) of the geotiff and get the value in that point (in
> this
> > case 231 of Band 1).
> >
> > [image: image.png]
> >
> > Thanks,
> >
> > On Sun, 15 Jan 2023 at 16:17, Pedro Mano Fernandes <
> [email protected]>
> > wrote:
> >
> >> Hi Jia,
> >>
> >> Thanks for the fast response.
> >>
> >> With the regular spatial join I’ll get the array of data of the whole
> >> geotiff polygon. I was hoping to get the data element for specific
> >> coordinates inside that polygon. In other words: I guess the array of
> data
> >> corresponds to all the positions in the polygon, but I want to fetch
> >> specific positions.
> >>
> >> Thanks,
> >>
> >> On Sun, 15 Jan 2023 at 01:09, Jia Yu <[email protected]> wrote:
> >>
> >>> Hi Pedro,
> >>>
> >>> Once you use Sedona geotiff reader to read those geotiffs, you will get
> >>> a dataframe with the following schema:
> >>>
> >>>  |-- image: struct (nullable = true)
> >>>  |    |-- origin: string (nullable = true)
> >>>  |    |-- Geometry: string (nullable = true)
> >>>  |    |-- height: integer (nullable = true)
> >>>  |    |-- width: integer (nullable = true)
> >>>  |    |-- nBands: integer (nullable = true)
> >>>  |    |-- data: array (nullable = true)
> >>>  |    |    |-- element: double (containsNull = true)
> >>>
> >>>
> >>> You can use the following way to fetch the geometry column and perform
> >>> the spatial join;
> >>>
> >>> geotiffDF = geotiffDF.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")
> >>> geotiffDF.createOrReplaceTempView("GeotiffDataframe")
> >>> geotiffDF.show()
> >>>
> >>> More info can be found:
> >>>
> https://sedona.apache.org/1.3.1-incubating/api/sql/Raster-loader/#geotiff-dataframe-loader
> >>>
> >>> Thanks,
> >>> Jia
> >>>
> >>> On Sat, Jan 14, 2023 at 9:10 AM Pedro Mano Fernandes <
> >>> [email protected]> wrote:
> >>>
> >>>> Hi everyone!
> >>>>
> >>>> I'm trying to use elevation data in GeoTiff format. I understand how
> to
> >>>> load the dataset, as described in
> >>>>
> >>>>
> https://sedona.staged.apache.org/api/sql/Raster-loader/#geotiff-dataframe-loader
> >>>> .
> >>>> Now I'm wondering how to join this dataframe with another one that
> >>>> contains
> >>>> coordinates, in order to get the elevation data for those coordinates.
> >>>>
> >>>> Something along these lines:
> >>>>
> >>>> pointsDF
> >>>>   .join(geotiffDF, ...)
> >>>>   .select("lon", "lat", "geotiff_data")
> >>>>
> >>>> Are there any examples or documentation I can follow to accomplish
> this?
> >>>>
> >>>> Thanks,
> >>>>
> >>>> --
> >>>> Pedro Mano Fernandes
> >>>>
> >>> --
> >> Pedro Mano Fernandes
> >>
> >
> >
> > --
> > Pedro Mano Fernandes
> >
>


-- 
Hälsningar,
Martin

Reply via email to