-
Notifications
You must be signed in to change notification settings - Fork 61
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
base: master
Are you sure you want to change the base?
GeoDataFrame init #909
Conversation
There was a problem hiding this 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) | ||
|
||
} | ||
|
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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<*> { |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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<*> { |
There was a problem hiding this comment.
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
No description provided.