change package to space.kscience

This commit is contained in:
Alexander Nozik 2024-06-04 11:06:50 +03:00
parent 327cef9ea9
commit 7c7a788d2e
51 changed files with 92 additions and 88 deletions

View File

@ -5,6 +5,7 @@
### Added ### Added
### Changed ### Changed
- Package changed to `space.kscience`
### Deprecated ### Deprecated

View File

@ -5,10 +5,10 @@ plugins {
id("space.kscience.gradle.project") id("space.kscience.gradle.project")
} }
val kmathVersion: String by extra("0.4.0-RC2") val kmathVersion: String by extra("0.4.0")
allprojects { allprojects {
group = "center.sciprog" group = "space.kscience"
version = "0.3.0-dev-2" version = "0.3.0-dev-2"
repositories { repositories {

View File

@ -14,9 +14,6 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Window import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application import androidx.compose.ui.window.application
import center.sciprog.maps.compose.* import center.sciprog.maps.compose.*
import center.sciprog.maps.coordinates.GeodeticMapCoordinates
import center.sciprog.maps.coordinates.Gmc
import center.sciprog.maps.coordinates.kilometers
import center.sciprog.maps.features.* import center.sciprog.maps.features.*
import center.sciprog.maps.geojson.geoJson import center.sciprog.maps.geojson.geoJson
import io.ktor.client.HttpClient import io.ktor.client.HttpClient
@ -32,6 +29,9 @@ import space.kscience.attributes.Attributes
import space.kscience.kmath.geometry.Angle import space.kscience.kmath.geometry.Angle
import space.kscience.kmath.geometry.degrees import space.kscience.kmath.geometry.degrees
import space.kscience.kmath.geometry.radians import space.kscience.kmath.geometry.radians
import space.kscience.maps.coordinates.GeodeticMapCoordinates
import space.kscience.maps.coordinates.Gmc
import space.kscience.maps.coordinates.kilometers
import java.nio.file.Path import java.nio.file.Path
import kotlin.math.PI import kotlin.math.PI
import kotlin.random.Random import kotlin.random.Random

View File

@ -1,10 +1,10 @@
package center.sciprog.maps.compose package space.kscience.maps.compose
import center.sciprog.maps.coordinates.GeodeticMapCoordinates
import center.sciprog.maps.coordinates.Gmc
import center.sciprog.maps.features.Rectangle import center.sciprog.maps.features.Rectangle
import space.kscience.kmath.geometry.Angle import space.kscience.kmath.geometry.Angle
import space.kscience.kmath.geometry.abs import space.kscience.kmath.geometry.abs
import space.kscience.maps.coordinates.GeodeticMapCoordinates
import space.kscience.maps.coordinates.Gmc
internal fun Angle.isBetween(a: Angle, b: Angle) = this in a..b || this in b..a internal fun Angle.isBetween(a: Angle, b: Angle) = this in a..b || this in b..a

View File

@ -1,6 +1,6 @@
@file:Suppress("DEPRECATION") @file:Suppress("DEPRECATION")
package center.sciprog.maps.compose package space.kscience.maps.compose
import kotlin.jvm.Synchronized import kotlin.jvm.Synchronized

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.compose package space.kscience.maps.compose
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
@ -6,12 +6,12 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.DpRect import androidx.compose.ui.unit.DpRect
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import center.sciprog.maps.coordinates.Gmc
import center.sciprog.maps.coordinates.MercatorProjection
import center.sciprog.maps.coordinates.WebMercatorCoordinates
import center.sciprog.maps.coordinates.WebMercatorProjection
import center.sciprog.maps.features.* import center.sciprog.maps.features.*
import space.kscience.kmath.geometry.radians import space.kscience.kmath.geometry.radians
import space.kscience.maps.coordinates.Gmc
import space.kscience.maps.coordinates.MercatorProjection
import space.kscience.maps.coordinates.WebMercatorCoordinates
import space.kscience.maps.coordinates.WebMercatorProjection
import kotlin.math.* import kotlin.math.*

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.compose package space.kscience.maps.compose
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Deferred import kotlinx.coroutines.Deferred

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.compose package space.kscience.maps.compose
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
@ -11,13 +11,13 @@ import androidx.compose.ui.graphics.toComposeImageBitmap
import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import center.sciprog.maps.coordinates.Gmc
import center.sciprog.maps.features.* import center.sciprog.maps.features.*
import io.github.oshai.kotlinlogging.KotlinLogging import io.github.oshai.kotlinlogging.KotlinLogging
import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.supervisorScope import kotlinx.coroutines.supervisorScope
import org.jetbrains.skia.Image import org.jetbrains.skia.Image
import space.kscience.maps.coordinates.Gmc
import kotlin.math.ceil import kotlin.math.ceil
import kotlin.math.pow import kotlin.math.pow

View File

@ -1,9 +1,9 @@
package center.sciprog.maps.compose package space.kscience.maps.compose
import center.sciprog.maps.coordinates.GeodeticMapCoordinates
import center.sciprog.maps.coordinates.Gmc
import center.sciprog.maps.coordinates.WebMercatorProjection
import center.sciprog.maps.features.ViewPoint import center.sciprog.maps.features.ViewPoint
import space.kscience.maps.coordinates.GeodeticMapCoordinates
import space.kscience.maps.coordinates.Gmc
import space.kscience.maps.coordinates.WebMercatorProjection
/** /**
* Observable position on the map. Includes observation coordinate and [zoom] factor * Observable position on the map. Includes observation coordinate and [zoom] factor

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.compose package space.kscience.maps.compose
import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.DpSize
@ -9,6 +9,7 @@ import center.sciprog.maps.features.Rectangle
import center.sciprog.maps.features.ViewPoint import center.sciprog.maps.features.ViewPoint
import space.kscience.kmath.geometry.Angle import space.kscience.kmath.geometry.Angle
import space.kscience.kmath.geometry.radians import space.kscience.kmath.geometry.radians
import space.kscience.maps.coordinates.*
import kotlin.math.abs import kotlin.math.abs
import kotlin.math.floor import kotlin.math.floor
import kotlin.math.pow import kotlin.math.pow
@ -19,7 +20,8 @@ public object WebMercatorSpace : CoordinateSpace<Gmc> {
private fun tileScale(zoom: Float): Float = 2f.pow(zoom - floor(zoom)) private fun tileScale(zoom: Float): Float = 2f.pow(zoom - floor(zoom))
override fun Rectangle(first: Gmc, second: Gmc): Rectangle<Gmc> = GmcRectangle(first, second) override fun Rectangle(first: Gmc, second: Gmc): Rectangle<Gmc> =
space.kscience.maps.compose.GmcRectangle(first, second)
override fun Rectangle(center: Gmc, zoom: Float, size: DpSize): Rectangle<Gmc> { override fun Rectangle(center: Gmc, zoom: Float, size: DpSize): Rectangle<Gmc> {
val scale = WebMercatorProjection.scaleFactor(zoom) val scale = WebMercatorProjection.scaleFactor(zoom)
@ -62,7 +64,10 @@ public object WebMercatorSpace : CoordinateSpace<Gmc> {
val maxLat = maxOf { it.top } val maxLat = maxOf { it.top }
val minLong = minOf { it.left } val minLong = minOf { it.left }
val maxLong = maxOf { it.right } val maxLong = maxOf { it.right }
return GmcRectangle(Gmc.normalized(minLat, minLong), Gmc.normalized(maxLat, maxLong)) return space.kscience.maps.compose.GmcRectangle(
Gmc.normalized(minLat, minLong),
Gmc.normalized(maxLat, maxLong)
)
} }
override fun Collection<Gmc>.wrapPoints(): Rectangle<Gmc>? { override fun Collection<Gmc>.wrapPoints(): Rectangle<Gmc>? {
@ -72,7 +77,10 @@ public object WebMercatorSpace : CoordinateSpace<Gmc> {
val maxLat = maxOf { it.latitude } val maxLat = maxOf { it.latitude }
val minLong = minOf { it.longitude } val minLong = minOf { it.longitude }
val maxLong = maxOf { it.longitude } val maxLong = maxOf { it.longitude }
return GmcRectangle(Gmc.normalized(minLat, minLong), Gmc.normalized(maxLat, maxLong)) return space.kscience.maps.compose.GmcRectangle(
Gmc.normalized(minLat, minLong),
Gmc.normalized(maxLat, maxLong)
)
} }
override fun Gmc.offsetTo(b: Gmc, zoom: Float): DpOffset { override fun Gmc.offsetTo(b: Gmc, zoom: Float): DpOffset {
@ -132,5 +140,5 @@ public fun CoordinateSpace<Gmc>.Rectangle(
center.latitude + (height / 2), center.latitude + (height / 2),
center.longitude + (width / 2) center.longitude + (width / 2)
) )
return GmcRectangle(a, b) return space.kscience.maps.compose.GmcRectangle(a, b)
} }

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.compose package space.kscience.maps.compose
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.drawscope.DrawScope import androidx.compose.ui.graphics.drawscope.DrawScope
@ -10,6 +10,7 @@ import center.sciprog.maps.coordinates.*
import center.sciprog.maps.features.* import center.sciprog.maps.features.*
import org.jetbrains.skia.Font import org.jetbrains.skia.Font
import space.kscience.kmath.geometry.Angle import space.kscience.kmath.geometry.Angle
import space.kscience.maps.coordinates.*
import kotlin.math.ceil import kotlin.math.ceil

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.compose package space.kscience.maps.compose
import io.github.oshai.kotlinlogging.KotlinLogging import io.github.oshai.kotlinlogging.KotlinLogging
import io.ktor.client.HttpClient import io.ktor.client.HttpClient

View File

@ -1,8 +1,7 @@
package center.sciprog.maps.compose package space.kscience.maps.compose
import io.ktor.client.HttpClient import io.ktor.client.HttpClient
import io.ktor.client.engine.cio.CIO import io.ktor.client.engine.cio.CIO
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.supervisorScope import kotlinx.coroutines.supervisorScope
import kotlinx.coroutines.test.runTest import kotlinx.coroutines.test.runTest
import org.junit.jupiter.api.Test import org.junit.jupiter.api.Test

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.coordinates package space.kscience.maps.coordinates
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlin.jvm.JvmInline import kotlin.jvm.JvmInline

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.coordinates package space.kscience.maps.coordinates
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import space.kscience.kmath.geometry.* import space.kscience.kmath.geometry.*

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.coordinates package space.kscience.maps.coordinates
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import space.kscience.kmath.geometry.* import space.kscience.kmath.geometry.*

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.coordinates package space.kscience.maps.coordinates
import space.kscience.kmath.geometry.* import space.kscience.kmath.geometry.*
import kotlin.math.* import kotlin.math.*
@ -64,8 +64,8 @@ public fun GeoEllipsoid.meridianCurve(
} }
return GmcCurve( return GmcCurve(
forward = GmcPose(Gmc.normalized(fromLatitude, longitude), if (up) Angle.zero else Angle.pi), forward = GmcPose(GeodeticMapCoordinates.normalized(fromLatitude, longitude), if (up) Angle.zero else Angle.pi),
backward = GmcPose(Gmc.normalized(toLatitude, longitude), if (up) Angle.pi else Angle.zero), backward = GmcPose(GeodeticMapCoordinates.normalized(toLatitude, longitude), if (up) Angle.pi else Angle.zero),
distance = s distance = s
) )
} }
@ -77,8 +77,8 @@ public fun GeoEllipsoid.parallelCurve(latitude: Angle, fromLongitude: Angle, toL
require(latitude in (-Angle.piDiv2)..(Angle.piDiv2)) { "Latitude must be in (-90, 90) degrees range" } require(latitude in (-Angle.piDiv2)..(Angle.piDiv2)) { "Latitude must be in (-90, 90) degrees range" }
val right = toLongitude > fromLongitude val right = toLongitude > fromLongitude
return GmcCurve( return GmcCurve(
forward = GmcPose(Gmc.normalized(latitude, fromLongitude), if (right) Angle.piDiv2 else -Angle.piDiv2), forward = GmcPose(GeodeticMapCoordinates.normalized(latitude, fromLongitude), if (right) Angle.piDiv2 else -Angle.piDiv2),
backward = GmcPose(Gmc.normalized(latitude, toLongitude), if (right) -Angle.piDiv2 else Angle.piDiv2), backward = GmcPose(GeodeticMapCoordinates.normalized(latitude, toLongitude), if (right) -Angle.piDiv2 else Angle.piDiv2),
distance = reducedRadius(latitude) * abs((fromLongitude - toLongitude).toRadians().value) distance = reducedRadius(latitude) * abs((fromLongitude - toLongitude).toRadians().value)
) )
} }
@ -193,7 +193,7 @@ public fun GeoEllipsoid.curveInDirection(
val L = lambda - (1 - C) * f * sinAlpha * val L = lambda - (1 - C) * f * sinAlpha *
(sigma.value + C * sinSigma * (cosSigmaM2 + C * cosSigma * (-1 + 2 * cos2SigmaM2))) (sigma.value + C * sinSigma * (cosSigmaM2 + C * cosSigma * (-1 + 2 * cos2SigmaM2)))
val endPoint = Gmc.normalized(phi2, start.longitude + L.radians) val endPoint = GeodeticMapCoordinates.normalized(phi2, start.longitude + L.radians)
// eq. 12 // eq. 12

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.coordinates package space.kscience.maps.coordinates
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import space.kscience.kmath.geometry.Angle import space.kscience.kmath.geometry.Angle

View File

@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
package center.sciprog.maps.coordinates package space.kscience.maps.coordinates
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import space.kscience.kmath.geometry.* import space.kscience.kmath.geometry.*

View File

@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
package center.sciprog.maps.coordinates package space.kscience.maps.coordinates
import space.kscience.kmath.geometry.abs import space.kscience.kmath.geometry.abs
import kotlin.math.* import kotlin.math.*

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.coordinates package space.kscience.maps.coordinates
import space.kscience.kmath.geometry.radians import space.kscience.kmath.geometry.radians
import kotlin.test.Test import kotlin.test.Test
@ -6,8 +6,8 @@ import kotlin.test.assertEquals
internal class DistanceTest { internal class DistanceTest {
companion object { companion object {
val moscow = Gmc.ofDegrees(55.76058287719673, 37.60358622841869) val moscow = GeodeticMapCoordinates.ofDegrees(55.76058287719673, 37.60358622841869)
val spb = Gmc.ofDegrees(59.926686023580444, 30.36038109122013) val spb = GeodeticMapCoordinates.ofDegrees(59.926686023580444, 30.36038109122013)
} }
@Test @Test

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.coordinates package space.kscience.maps.coordinates
import kotlin.test.Test import kotlin.test.Test
import kotlin.test.assertEquals import kotlin.test.assertEquals
@ -6,7 +6,7 @@ import kotlin.test.assertEquals
class MercatorTest { class MercatorTest {
@Test @Test
fun sphereForwardBackward(){ fun sphereForwardBackward(){
val moscow = Gmc.ofDegrees(55.76058287719673, 37.60358622841869) val moscow = GeodeticMapCoordinates.ofDegrees(55.76058287719673, 37.60358622841869)
val mercator = MapProjection.epsg3857.toProjection(moscow) val mercator = MapProjection.epsg3857.toProjection(moscow)
//https://epsg.io/transform#s_srs=4326&t_srs=3857&x=37.6035862&y=55.7605829 //https://epsg.io/transform#s_srs=4326&t_srs=3857&x=37.6035862&y=55.7605829
assertEquals(4186.0120709, mercator.x.kilometers, 1e-4) assertEquals(4186.0120709, mercator.x.kilometers, 1e-4)
@ -18,7 +18,7 @@ class MercatorTest {
@Test @Test
fun ellipseForwardBackward(){ fun ellipseForwardBackward(){
val moscow = Gmc.ofDegrees(55.76058287719673, 37.60358622841869) val moscow = GeodeticMapCoordinates.ofDegrees(55.76058287719673, 37.60358622841869)
val projection = MercatorProjection(ellipsoid = GeoEllipsoid.WGS84) val projection = MercatorProjection(ellipsoid = GeoEllipsoid.WGS84)
val mercator = projection.toProjection(moscow) val mercator = projection.toProjection(moscow)
val backwards = projection.toGeodetic(mercator) val backwards = projection.toGeodetic(mercator)

View File

@ -1,6 +1,5 @@
package center.sciprog.maps.compose package space.kscience.maps.compose
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.gestures.drag import androidx.compose.foundation.gestures.drag
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Offset

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.compose package space.kscience.maps.compose
import androidx.compose.foundation.gestures.GestureCancellationException import androidx.compose.foundation.gestures.GestureCancellationException
import androidx.compose.foundation.gestures.PressGestureScope import androidx.compose.foundation.gestures.PressGestureScope

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.features package space.kscience.maps.features
import androidx.compose.runtime.MutableState import androidx.compose.runtime.MutableState
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.features package space.kscience.maps.features
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.DpOffset

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.features package space.kscience.maps.features
import androidx.compose.ui.input.pointer.PointerEvent import androidx.compose.ui.input.pointer.PointerEvent
import androidx.compose.ui.input.pointer.isPrimaryPressed import androidx.compose.ui.input.pointer.isPrimaryPressed

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.features package space.kscience.maps.features
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable import androidx.compose.runtime.Stable

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.features package space.kscience.maps.features
import androidx.compose.foundation.Canvas import androidx.compose.foundation.Canvas
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.features package space.kscience.maps.features
import androidx.compose.runtime.* import androidx.compose.runtime.*
import androidx.compose.runtime.snapshots.SnapshotStateMap import androidx.compose.runtime.snapshots.SnapshotStateMap

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.features package space.kscience.maps.features
import androidx.compose.ui.input.pointer.PointerEvent import androidx.compose.ui.input.pointer.PointerEvent
import androidx.compose.ui.input.pointer.isPrimaryPressed import androidx.compose.ui.input.pointer.isPrimaryPressed

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.features package space.kscience.maps.features
import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.DpSize

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.features package space.kscience.maps.features
/** /**
* @param T type of coordinates used for the view point * @param T type of coordinates used for the view point

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.features package space.kscience.maps.features
import space.kscience.attributes.Attributes import space.kscience.attributes.Attributes
import kotlin.jvm.JvmName import kotlin.jvm.JvmName

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.features package space.kscience.maps.features
import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size import androidx.compose.ui.geometry.Size

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.features package space.kscience.maps.features
import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.PointerMatcher import androidx.compose.foundation.PointerMatcher

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.geojson package space.kscience.maps.geojson
import center.sciprog.maps.geojson.GeoJson.Companion.PROPERTIES_KEY import center.sciprog.maps.geojson.GeoJson.Companion.PROPERTIES_KEY
import center.sciprog.maps.geojson.GeoJson.Companion.TYPE_KEY import center.sciprog.maps.geojson.GeoJson.Companion.TYPE_KEY

View File

@ -1,9 +1,9 @@
package center.sciprog.maps.geojson package space.kscience.maps.geojson
import center.sciprog.maps.coordinates.Gmc
import center.sciprog.maps.coordinates.meters
import center.sciprog.maps.geojson.GeoJsonGeometry.Companion.COORDINATES_KEY import center.sciprog.maps.geojson.GeoJsonGeometry.Companion.COORDINATES_KEY
import kotlinx.serialization.json.* import kotlinx.serialization.json.*
import space.kscience.maps.coordinates.Gmc
import space.kscience.maps.coordinates.meters
import kotlin.jvm.JvmInline import kotlin.jvm.JvmInline
public sealed interface GeoJsonGeometry : GeoJson { public sealed interface GeoJsonGeometry : GeoJson {

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.geojson package space.kscience.maps.geojson
import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.serializer import kotlinx.serialization.serializer

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.geojson package space.kscience.maps.geojson
import kotlinx.serialization.KSerializer import kotlinx.serialization.KSerializer
import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.descriptors.SerialDescriptor

View File

@ -1,12 +1,12 @@
package center.sciprog.maps.geojson package space.kscience.maps.geojson
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import center.sciprog.maps.coordinates.Gmc
import center.sciprog.maps.features.* import center.sciprog.maps.features.*
import kotlinx.serialization.json.contentOrNull import kotlinx.serialization.json.contentOrNull
import kotlinx.serialization.json.intOrNull import kotlinx.serialization.json.intOrNull
import kotlinx.serialization.json.jsonPrimitive import kotlinx.serialization.json.jsonPrimitive
import space.kscience.NameAttribute import space.kscience.NameAttribute
import space.kscience.maps.coordinates.Gmc
/** /**

View File

@ -1,11 +1,11 @@
package center.sciprog.maps.geojson package space.kscience.maps.geojson
import center.sciprog.maps.coordinates.Gmc
import center.sciprog.maps.features.Feature import center.sciprog.maps.features.Feature
import center.sciprog.maps.features.FeatureGroup import center.sciprog.maps.features.FeatureGroup
import center.sciprog.maps.features.FeatureRef import center.sciprog.maps.features.FeatureRef
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonObject
import space.kscience.maps.coordinates.Gmc
import java.net.URL import java.net.URL
/** /**

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.scheme package space.kscience.maps.scheme
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.scheme package space.kscience.maps.scheme
import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp

View File

@ -1,7 +1,6 @@
package center.sciprog.maps.scheme package space.kscience.maps.scheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.DpRect import androidx.compose.ui.unit.DpRect

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.scheme package space.kscience.maps.scheme
import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.DpSize

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.scheme package space.kscience.maps.scheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.svg package space.kscience.maps.svg
import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Rect import androidx.compose.ui.geometry.Rect

View File

@ -1,4 +1,4 @@
package center.sciprog.maps.svg package space.kscience.maps.svg
import androidx.compose.ui.geometry.CornerRadius import androidx.compose.ui.geometry.CornerRadius
import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Offset

View File

@ -1,7 +1,6 @@
package center.sciprog.maps.svg package space.kscience.maps.svg
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp

View File

@ -36,6 +36,7 @@ public class AttributesSerializer(
override val content: Map<out Attribute<*>, Any?> = attributeMap override val content: Map<out Attribute<*>, Any?> = attributeMap
override fun toString(): String = "Attributes(value=${content.entries})" override fun toString(): String = "Attributes(value=${content.entries})"
override fun equals(other: Any?): Boolean = other is Attributes && Attributes.equals(this, other) override fun equals(other: Any?): Boolean = other is Attributes && Attributes.equals(this, other)
override fun hashCode(): Int = content.hashCode()
} }
} }
@ -69,6 +70,3 @@ public abstract class SerializableAttribute<T>(
} }
public object NameAttribute : SerializableAttribute<String>("name", String.serializer()) public object NameAttribute : SerializableAttribute<String>("name", String.serializer())
public fun Attributes.Companion.equals(a1: Attributes, a2: Attributes): Boolean =
a1.keys == a2.keys && a1.keys.all { a1[it] == a2[it] }