-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
156 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
demo/geotools-batik/src/main/kotlin/kotlinIsland/KotlinIslandGeojson.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 2020. JetBrains s.r.o. | ||
* Use of this source code is governed by the MIT license that can be found in the LICENSE file. | ||
*/ | ||
|
||
package kotlinIsland | ||
|
||
import org.geotools.api.feature.Feature | ||
import org.geotools.api.feature.type.FeatureType | ||
import org.geotools.feature.FeatureCollection | ||
import org.geotools.geojson.feature.FeatureJSON | ||
import java.io.File | ||
import java.nio.file.Paths | ||
|
||
/** | ||
* Loads data and geometries from "Kotlin Island" GeoJSON files. | ||
*/ | ||
internal object KotlinIslandGeojson { | ||
fun loadPlaces(): FeatureCollection<FeatureType, Feature> { | ||
// return loadResource("docs/examples/data/kotlin_places.geojson") | ||
return loadResource("docs/examples/data/kotlin_places_no_crs.geojson") | ||
} | ||
|
||
@Suppress("SameParameterValue") | ||
private fun loadResource(relativePathname: String): FeatureCollection<FeatureType, Feature> { | ||
val fileName: String = Paths.get(relativePathname).toAbsolutePath().normalize().toString() | ||
|
||
val geoJSONFile = File(fileName) | ||
val featureCollection = FeatureJSON().readFeatureCollection(geoJSONFile.reader()) | ||
return featureCollection | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
demo/geotools-batik/src/main/kotlin/kotlinIsland/PointsMapMain.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2021. JetBrains s.r.o. | ||
* Use of this source code is governed by the MIT license that can be found in the LICENSE file. | ||
*/ | ||
|
||
package kotlinIsland | ||
|
||
import org.jetbrains.letsPlot.batik.plot.component.PlotViewerWindowBatik | ||
import org.jetbrains.letsPlot.geom.geomPoint | ||
import org.jetbrains.letsPlot.intern.toSpec | ||
import org.jetbrains.letsPlot.label.ggtitle | ||
import org.jetbrains.letsPlot.letsPlot | ||
import org.jetbrains.letsPlot.toolkit.geotools.toSpatialDataset | ||
import java.awt.Dimension | ||
|
||
fun main() { | ||
// GeoTools | ||
val places = KotlinIslandGeojson.loadPlaces() | ||
|
||
// Lets-Plot | ||
val placesSD = places.toSpatialDataset() | ||
val p = letsPlot() + | ||
geomPoint(map = placesSD, color = "red") + | ||
ggtitle("Kotlin Island Tourists Attractions") | ||
|
||
PlotViewerWindowBatik( | ||
"Spatial plot demo", | ||
rawSpec = p.toSpec(), | ||
windowSize = Dimension(800, 500), | ||
preserveAspectRatio = false, | ||
repaintDelay = 300 | ||
).open() | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
</head> | ||
<body> | ||
<script type="text/javascript" | ||
src="https://cdn.jsdelivr.net/gh/JetBrains/[email protected].0/js-package/distr/lets-plot.min.js"></script> | ||
src="https://cdn.jsdelivr.net/gh/JetBrains/[email protected].2/js-package/distr/lets-plot.min.js"></script> | ||
<script src="js-frontend-app.js"></script> | ||
<div> | ||
<h2>Lets-Plot Kotlin/JS Demo.</h2> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC::CRS84" } }, | ||
"features": [ | ||
{ "type": "Feature", "properties": { "name": "Kronstadt Naval Cathedral", "type": "church" }, "geometry": { "type": "Point", "coordinates": [ 29.777455, 59.991744 ] } }, | ||
{ "type": "Feature", "properties": { "name": "Kronstadt History Museum", "type": "museum" }, "geometry": { "type": "Point", "coordinates": [ 29.791317, 59.986777 ] } }, | ||
{ "type": "Feature", "properties": { "name": "Kronstadt Naval Museum", "type": "museum" }, "geometry": { "type": "Point", "coordinates": [ 29.763422, 59.996108 ] } }, | ||
{ "type": "Feature", "properties": { "name": "City Russian Cemetery", "type": "cemetery" }, "geometry": { "type": "Point", "coordinates": [ 29.70613, 60.019788 ] } }, | ||
{ "type": "Feature", "properties": { "name": "Kronstadt Lutheran Cemetery", "type": "cemetery" }, "geometry": { "type": "Point", "coordinates": [ 29.749861, 60.002212 ] } }, | ||
{ "type": "Feature", "properties": { "name": "Vladimir Church", "type": "church" }, "geometry": { "type": "Point", "coordinates": [ 29.766254, 59.998515 ] } } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ "type": "Feature", "properties": { "name": "Kronstadt Naval Cathedral", "type": "church" }, "geometry": { "type": "Point", "coordinates": [ 29.777455, 59.991744 ] } }, | ||
{ "type": "Feature", "properties": { "name": "Kronstadt History Museum", "type": "museum" }, "geometry": { "type": "Point", "coordinates": [ 29.791317, 59.986777 ] } }, | ||
{ "type": "Feature", "properties": { "name": "Kronstadt Naval Museum", "type": "museum" }, "geometry": { "type": "Point", "coordinates": [ 29.763422, 59.996108 ] } }, | ||
{ "type": "Feature", "properties": { "name": "City Russian Cemetery", "type": "cemetery" }, "geometry": { "type": "Point", "coordinates": [ 29.70613, 60.019788 ] } }, | ||
{ "type": "Feature", "properties": { "name": "Kronstadt Lutheran Cemetery", "type": "cemetery" }, "geometry": { "type": "Point", "coordinates": [ 29.749861, 60.002212 ] } }, | ||
{ "type": "Feature", "properties": { "name": "Vladimir Church", "type": "church" }, "geometry": { "type": "Point", "coordinates": [ 29.766254, 59.998515 ] } } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## [4.7.2] - 2024-mm-dd | ||
## [4.7.3] - 2024-mm-dd | ||
|
||
### Added | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
plot-api/src/jvmMain/resources/letsPlotKotlinAPI/version.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
lets_plot.version=4.3.1 | ||
lets_plot_kotlin_api.version=4.7.1 | ||
lets_plot.version=4.3.2 | ||
lets_plot_kotlin_api.version=4.7.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters