-
Notifications
You must be signed in to change notification settings - Fork 16
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
Geo #449
base: dev
Are you sure you want to change the base?
Geo #449
Conversation
# Conflicts: # kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/translator/toLetsPlot.kt # kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/translator/util.kt
if (dataset is GeoSpatialData) { | ||
dataset | ||
} else { | ||
null |
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 we return null, is it possible to log here something with warning? or throw an exception if we don't handle null higher
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.
There is no error here, it is a note that in the Lets-Plot specification it is impossible to pass geodataset as main (default for layers), so if we have a main geodatset in kandy, it should be passed to each layer separately during processing and that's exactly what's going here.
featureBuffer.add(LayerWrapper(this, addGroups, dataset?.wrap(), mappings, settings, groupKeys)) | ||
val map = if (dataset is GeoSpatialData) { | ||
dataset.toSpatialDataset() | ||
} else null |
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.
How should be these null handled?
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.
It shouldn't, it's a feature of the Lets-Plot specification, which is described in the previous conversation
import org.jetbrains.kotlinx.kandy.ir.data.TableData | ||
import org.jetbrains.letsPlot.spatial.SpatialDataset | ||
|
||
public interface GeoSpatialData: TableData { |
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, generate and fill KDocs
import org.locationtech.jts.geom.MultiPolygon | ||
import org.locationtech.jts.operation.union.CascadedPolygonUnion | ||
|
||
|
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.
Remove empty line and add some KDocs, great that exception is raised? Could we throw IllegalArgumentException in other situation which I commented?
) { | ||
geometry().forEach { | ||
if (it !is Polygonal) { | ||
error("Not a polygon geometry: $it") |
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.
why it somewhere IllegalArgumentException, somewhere error? could it be unified through the PR?
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.
Also KDocs required
import org.locationtech.jts.geom.Puntal | ||
import kotlin.reflect.typeOf | ||
|
||
// TODO add ColumnAccessor & String 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.
TODO: add KDocs
|
||
package org.jetbrains.kotlinx.kandy.letsplot.geo.dsl | ||
|
||
public sealed interface GeoDataScope |
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 really required a separate file?
} | ||
} | ||
|
||
@PublishedApi |
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.
Sorry, is it @PublishedApi and internal in the same time? Is it correct?
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.
But @PublishedApi
is applicable only for internal properties :)
import org.jetbrains.kotlinx.kandy.dsl.internal.LayerCreatorScope | ||
import org.jetbrains.kotlinx.kandy.dsl.internal.MultiLayerPlotBuilder | ||
|
||
public class GeoDataFrameScope<T : WithGeometry>( |
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.
KDocs please
import org.jetbrains.kotlinx.kandy.dsl.internal.DatasetBuilder | ||
import org.jetbrains.kotlinx.kandy.dsl.internal.dataframe.MultiLayerPlotBuilderImpl | ||
|
||
public class GeoDataFramePlotBuilder<T : WithGeometry> @PublishedApi internal constructor( |
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.
KDocs please
override fun toSpatialDataset(): SpatialDataset { | ||
with(geoDataFrame) { | ||
// TODO encoding precision | ||
val geojson = GeometryJSON(10) |
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.
Magic Constant - should be extracted and explained
with(geoDataFrame) { | ||
// TODO encoding precision | ||
val geojson = GeometryJSON(10) | ||
return SpatialDataset.withGEOJSON( |
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 possible to rename to withGeoJson to be more Kotlinish?
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.
It's not our API
val friendModules = listOf(project(":kandy-api"), project(":kandy-lets-plot")) | ||
val jarTasks = friendModules.map { it.tasks.getByName("jar") as Jar } | ||
val jarPaths = jarTasks.map { it.archiveFile.get().asFile.absolutePath } | ||
(this as BaseKotlinCompile).friendPaths.from(jarPaths) |
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 please add some note or explanation about why do we need friend modules here?
// jai core dependency should be excluded from geotools dependencies and added separately | ||
fun ExternalModuleDependency.excludeJaiCore() = exclude("javax.media", "jai_core") | ||
|
||
|
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.
remove blank lines
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.
It requires more work on KDocs and some questions should be answered also
No description provided.