-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from pailakka/update-java-deps
Updates and cleanup
- Loading branch information
Showing
29 changed files
with
380 additions
and
20,181 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,31 @@ | ||
name: mtk2garmin-converter docker image | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- 'mtk2garmin-converter/**' | ||
- '.github/workflows/mtk2garmin-converter.yaml' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
context: "{{defaultContext}}:mtk2garmin-converter" | ||
tags: teemupel/mtk2garmin-converter:latest |
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,31 @@ | ||
name: ubuntugis-base docker image | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- 'mapcreator/ubuntugis-base/**' | ||
- '.github/workflows/ubuntugis-base.yaml' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
context: "{{defaultContext}}:mapcreator/ubuntugis-base" | ||
tags: teemupel/mtk2garmin-ubuntugis-base:latest |
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,3 @@ | ||
version: '3' | ||
services: | ||
mml-client: | ||
image: teemupel/mml-muutostietopalvelu-client | ||
|
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,9 +1,9 @@ | ||
FROM ghcr.io/osgeo/gdal:ubuntu-full-3.6.3 | ||
FROM ghcr.io/osgeo/gdal:ubuntu-full-3.10.0 | ||
|
||
RUN apt update && apt install -y curl | ||
|
||
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - && \ | ||
apt update && \ | ||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash && \ | ||
. /root/.bashrc && nvm install 22 && apt update && apt upgrade -y && \ | ||
apt install -y git p7zip-full nodejs default-jdk maven&& \ | ||
npm install -g svgo &&\ | ||
apt clean |
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
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
57 changes: 57 additions & 0 deletions
57
mtk2garmin-converter/src/main/java/org/hylly/mtk2garmin/LightNode.java
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,57 @@ | ||
package org.hylly.mtk2garmin; | ||
|
||
import it.unimi.dsi.fastutil.shorts.Short2ShortOpenHashMap; | ||
import org.openstreetmap.osmosis.core.container.v0_6.NodeContainer; | ||
import org.openstreetmap.osmosis.core.domain.v0_6.*; | ||
|
||
import java.util.Date; | ||
|
||
class LightNode { | ||
final long id; | ||
final double lon; | ||
final double lat; | ||
final long hash; | ||
Short2ShortOpenHashMap nodeTags; | ||
boolean wayPart; | ||
|
||
LightNode(long id, long hash, double lon, double lat, boolean wayPart) { | ||
this.id = id; | ||
this.hash = hash; | ||
this.lon = lon; | ||
this.lat = lat; | ||
this.wayPart = wayPart; | ||
} | ||
|
||
void addTag(short key, short value) { | ||
if (nodeTags == null) { | ||
nodeTags = new Short2ShortOpenHashMap(); | ||
} | ||
|
||
nodeTags.put(key, value); | ||
} | ||
|
||
long getId() { | ||
return id; | ||
} | ||
|
||
boolean isWayPart() { | ||
return wayPart; | ||
} | ||
|
||
long getHash() { | ||
return hash; | ||
} | ||
|
||
public NodeContainer toOsmiumEntity(StringTable stringTable, Date timestamp) { | ||
CommonEntityData ced = new CommonEntityData(this.id, -1, timestamp, OsmUser.NONE, 0); | ||
if (nodeTags != null) { | ||
nodeTags.short2ShortEntrySet().forEach(t -> ced.getTags().add(new Tag(stringTable.getStringById(t.getShortKey()), stringTable.getStringById(t.getShortValue())))); | ||
} | ||
|
||
return new NodeContainer(new Node(ced, this.lat, this.lon)); | ||
} | ||
|
||
public WayNode toOsmiumWayNode() { | ||
return new WayNode(this.id, this.lat, this.lon); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
mtk2garmin-converter/src/main/java/org/hylly/mtk2garmin/LightRelation.java
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,35 @@ | ||
package org.hylly.mtk2garmin; | ||
|
||
import it.unimi.dsi.fastutil.shorts.Short2ShortRBTreeMap; | ||
import org.openstreetmap.osmosis.core.container.v0_6.RelationContainer; | ||
import org.openstreetmap.osmosis.core.domain.v0_6.CommonEntityData; | ||
import org.openstreetmap.osmosis.core.domain.v0_6.OsmUser; | ||
import org.openstreetmap.osmosis.core.domain.v0_6.Relation; | ||
import org.openstreetmap.osmosis.core.domain.v0_6.Tag; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Date; | ||
|
||
class LightRelation { | ||
final Short2ShortRBTreeMap tags = new Short2ShortRBTreeMap(); | ||
final ArrayList<LightRelationMember> members = new ArrayList<>(); | ||
long id; | ||
|
||
long getId() { | ||
return id; | ||
} | ||
|
||
void setId(long id) { | ||
this.id = id; | ||
} | ||
|
||
public RelationContainer toOsmiumEntity(StringTable stringTable, Date timestamp) { | ||
CommonEntityData ced = new CommonEntityData(this.id, -1, timestamp, OsmUser.NONE, 0); | ||
tags.short2ShortEntrySet().forEach(t -> ced.getTags().add(new Tag(stringTable.getStringById(t.getShortKey()), stringTable.getStringById(t.getShortValue())))); | ||
|
||
Relation r = new Relation(ced, this.members.stream().map(LightRelationMember::toOsmiumEntity).toList()); | ||
|
||
return new RelationContainer(r); | ||
|
||
} | ||
} |
Oops, something went wrong.