You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "paleolimbot (via GitHub)" <gi...@apache.org> on 2026/02/24 16:05:41 UTC
[PR] feat(python/sedonadb): Handle crs-like objects in parameterized queries [sedona-db]
paleolimbot opened a new pull request, #660:
URL: https://github.com/apache/sedona-db/pull/660
This PR adds support for literal conversion for the three CRS-like objects I know about, the main one being `pyproj.CRS()`. This is a nice quality of life improvement for writing SQL against GeoPandas data frames. For example, this is finding all the points within 10 km of some lon/lat:
```python
import geopandas
import sedona.db
url = "https://github.com/geoarrow/geoarrow-data/releases/download/v0.2.0/ns-water_water-point.fgb"
gdf = geopandas.read_file(url)
sd = sedona.db.connect()
sd.create_data_frame(gdf).to_view("gdf", overwrite=True)
sd.sql("""
SELECT "OBJECTID", "FEAT_CODE", geometry FROM gdf
WHERE ST_DWithin(ST_Transform(ST_Point(-64, 45, 4326), $1), geometry, 10000)
""", params=(gdf.crs,)).show()
#> ┌──────────┬───────────┬─────────────────────────────────────────────────────────────────┐
#> │ OBJECTID ┆ FEAT_CODE ┆ geometry │
#> │ int64 ┆ utf8 ┆ geometry │
#> ╞══════════╪═══════════╪═════════════════════════════════════════════════════════════════╡
#> │ 18927 ┆ WAFA60 ┆ POINT Z(428474.02329999954 4984050.078299999 77.89999999999418) │
#> ├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
#> │ 18915 ┆ WADM60 ┆ POINT Z(421205.36319999956 4983412.968 22.89999999999418) │
#> ├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
#> │ 17112 ┆ WAFA60 ┆ POINT Z(418256.42310000025 4975386.877800001 71.80000000000291) │
#> └──────────┴───────────┴─────────────────────────────────────────────────────────────────┘
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(python/sedonadb): Handle crs-like objects in parameterized queries [sedona-db]
Posted by "zhangfengcdt (via GitHub)" <gi...@apache.org>.
zhangfengcdt commented on code in PR #660:
URL: https://github.com/apache/sedona-db/pull/660#discussion_r2853971095
##########
python/sedonadb/python/sedonadb/expr/literal.py:
##########
Review Comment:
Do we want to add CRS support information here since it is supported literal now?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org