Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeoDataFrame init #909

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

GeoDataFrame init #909

wants to merge 3 commits into from

Conversation

AndreiKingsley
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@Jolanrensen Jolanrensen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good initial version :) just some comments here and there

implementation(libs.ktor.serialization.kotlinx.json)

}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it still required to be a friend module?

import org.jetbrains.kotlinx.dataframe.api.with

class GeoDataFrame<T : GeoFrame>(val df: DataFrame<T>, val crs: CoordinateReferenceSystem?) {
fun update(updateBlock: DataFrame<T>.() -> DataFrame<T>): GeoDataFrame<T> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider other names? Like

  • updateDf
  • replaceDf (more consistent with what replace does in DF compared to update)

return GeoDataFrame(df.updateBlock(), crs)
}

fun applyCRS(targetCRS: CoordinateReferenceSystem? = null): GeoDataFrame<T> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proper camel casing would be "applyCrs" and "targetCrs"

with(libs.plugins) {
alias(kotlin.jvm)
alias(publisher)
alias(jupyter.api)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you include ktlint too?


object Geocoder {

private val url = "https://geo2.datalore.jetbrains.com/map_data/geocoding"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be included in the stock library? As far as I remember this was a reverse engineering endeavour and since it depends on an external URL behaviour might change or stop working entirely

@@ -41,3 +41,4 @@ plugins {
}
include("dataframe-excel")
include("core")
include("dataframe-geo")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want dataframe-geo to be imported by default when users depend on the generic dataframe package, also add dataframe-geo in build.gradle.kts

return execute(codeWithConverter, variableName)
}

override fun Builder.onLoaded() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this jupyter integration do exactly? could you add some docs?

import java.net.URL


fun GeoDataFrame.Companion.readGeoJSON(path: String): GeoDataFrame<*> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readGeoJson is proper camel casing

typeBuilder.name = name ?: "geodata"
typeBuilder.setCRS(crs)
val geometryClass = if (singleGeometryType) {
// todo singleOrNull() ?: error()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

many todo's haha

import org.jetbrains.kotlinx.dataframe.geo.GeoFrame
import org.locationtech.jts.geom.Geometry

fun SimpleFeatureCollection.toGeoDataFrame(): GeoDataFrame<*> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rename the file to "toGeoDataFrame" like you did with the other file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants