Add GeoDataFrame.generate* overloads that generate schema declarations suitable for T : WithGeometry marker parameter
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 1.1k
- Forks
- 83
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 30
Description
Let's say you read GeoDataFrame.readShapefile and assign schema to it. Right now there's no way to do it without manual editing of generated code
geo.df.generateDataClasses generates a schema without WithGeometry supertype and it's not suitable for our T : WithGeometry bound. So schema has to be edited. Plus, it cannot be applied directly and need geo.modify { it.cast<MySchema>() }
Proposed:
add geo.generateDataClasses() that generates data class MySchema(...) : WithGeometry
and GeoDataFrame.cast
Implementation details:
Generating a schema with specific supertype requires using internal MarkersExtractor to obtain marker for knownMarkers parameter:
val withGeometry = MarkersExtractor.get<WithGeometry>()
val codegen = CodeGenerator.create()
codegen.generate(
...,
knownMarkers = listOf(withGeometry)
)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the GeoDataFrame.generateDataClasses and GeoDataFrame.cast entry points, then trace CodeGenerator.create and MarkersExtractor.get() as described in the issue. Compare the existing geo.df.generateDataClasses behavior with the proposed overloads; done means generated schemas satisfy the WithGeometry bound and can be used directly with GeoDataFrame.cast.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100