-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Reuse GeoArrowArrayReader in ReaderImpl (#29)
I am not entirely sure this is desired (it gives a bit of overhead), but while trying to understand the reader/writer/builder/visitor hierarchy in geoarrow-c, I noticed that here we were not using `GeoArrowArrayReader`, but the separate readers for WKT/WKB (`GeoArrowWKTReader`/`GeoArrowWKBReader`) and `GeoArrowArrayViewVisit` for native coords, duplicating the iteration function for WKT/WKB. While the `GeoArrowArrayReader` already abstracts away those three options behind a single interface. This gives a bit more overhead for the scalar `WKTReader` (I assume because this constructs a `geoarrow::Reader` every time, and this now not just initializes the `GeoArrowWKTReader`, but also the other structs for WKB and native). Given this is the scalar version (and you can always ensure to start from arrow input for optimal performance), I think that overhead is acceptable. But alternatively, we could also update `GeoArrowArrayReader` to only initialize the WKT/WKB readers if needed (when it gets data passed with that type), instead of upfront. Or another option is to expose the `GeoArrowArrayViewVisitWKT/WKB` functions in geoarrow.h, so that we can at least avoid reimplementing those. Also added some brief doc comments.
- Loading branch information
1 parent
829a0fe
commit 9ebd7b1
Showing
2 changed files
with
16 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters