Kotlin / Kotlin/dataframe

Add GeoDataFrame.generate* overloads that generate schema declarations suitable for T : WithGeometry marker parameter

Open
#1,918 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

geo
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.