Skip to content

Commit

Permalink
Merge pull request #2891 from finnishtransportagency/DROTH-3938_add-n…
Browse files Browse the repository at this point in the history
…ew-side-code-value-based-on-master

Droth 3938 add new side code value based on master
  • Loading branch information
sasuolanderSito authored Feb 5, 2024
2 parents ceef723 + b002e5f commit 10e88b3
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ sealed trait SideCode {
def value: Int
}
object SideCode {
val values = Set(BothDirections, TowardsDigitizing, AgainstDigitizing, Unknown)
val values = Set(BothDirections, TowardsDigitizing, AgainstDigitizing, Unknown, DoesNotAffectRoadLink)

def apply(intValue: Int): SideCode = {
values.find(_.value == intValue).getOrElse(Unknown)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class DynamicLinearAssetDao {
def apply(r: PositionedResult) : DynamicAssetRow = {
val id = r.nextLong()
val linkId = r.nextString()
val sideCode = r.nextInt()
val sideCode = r.nextIntOption()
val startMeasure = r.nextDouble()
val endMeasure = r.nextDouble()
val propertyPublicId = r.nextString
Expand All @@ -147,7 +147,7 @@ class DynamicLinearAssetDao {
val verifiedDate = r.nextTimestampOption().map(timestamp => new DateTime(timestamp))
val informationSource = r.nextIntOption()

DynamicAssetRow(id, linkId, sideCode, value, startMeasure, endMeasure, createdBy, createdDate, modifiedBy, modifiedDate, expired, typeId, timeStamp, geomModifiedDate, linkSource, verifiedBy, verifiedDate, informationSource)
DynamicAssetRow(id, linkId, sideCode.getOrElse(99), value, startMeasure, endMeasure, createdBy, createdDate, modifiedBy, modifiedDate, expired, typeId, timeStamp, geomModifiedDate, linkSource, verifiedBy, verifiedDate, informationSource)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ class LaneDao(){
def apply(r: PositionedResult) = {
val expired = r.nextBoolean()
val value = r.nextInt()
val sideCode = r.nextInt()
val sideCode = r.nextIntOption()

LightLane(value, expired, sideCode)
LightLane(value, expired, sideCode.getOrElse(99))
}
}

implicit val getLaneAsset: GetResult[LaneRow] = new GetResult[LaneRow] {
def apply(r: PositionedResult) : LaneRow = {
val id = r.nextLong()
val linkId = r.nextString()
val sideCode = r.nextInt()
val sideCode = r.nextIntOption()
val startMeasure = r.nextDouble()
val endMeasure = r.nextDouble()
val createdBy = r.nextStringOption()
Expand All @@ -61,7 +61,7 @@ class LaneDao(){
val expiredBy = r.nextStringOption()
val expiredDate = r.nextTimestampOption().map(timestamp => new DateTime(timestamp))

LaneRow(id, linkId, sideCode, value, startMeasure, endMeasure, createdBy, createdDate, modifiedBy, modifiedDate,
LaneRow(id, linkId, sideCode.getOrElse(99), value, startMeasure, endMeasure, createdBy, createdDate, modifiedBy, modifiedDate,
expiredBy, expiredDate, expired, timeStamp, municipalityCode, laneCode, geomModifiedDate)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class LaneHistoryDao() {
val newId = r.nextLong()
val oldId = r.nextLong()
val linkId = r.nextString()
val sideCode = r.nextInt()
val sideCode = r.nextIntOption()
val startMeasure = r.nextDouble()
val endMeasure = r.nextDouble()
val createdBy = r.nextStringOption()
Expand All @@ -47,7 +47,7 @@ class LaneHistoryDao() {
val historyCreatedBy = r.nextString()
val changeEventOrderNumber = r.nextIntOption()

LaneHistoryRow(id, newId, oldId, linkId, sideCode, value, startMeasure, endMeasure, createdBy, createdDate, modifiedBy, modifiedDate,
LaneHistoryRow(id, newId, oldId, linkId, sideCode.getOrElse(99), value, startMeasure, endMeasure, createdBy, createdDate, modifiedBy, modifiedDate,
expired, timeStamp, municipalityCode, laneCode, geomModifiedDate, historyCreatedDate, historyCreatedBy, changeEventOrderNumber)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PostGISLinearAssetDao() {

val id = r.nextLong()
val linkId = r.nextString()
val sideCode = r.nextInt()
val sideCode = r.nextIntOption()
val prohibitionId = r.nextLong()
val prohibitionType = r.nextInt()
val validityPeridoType = r.nextIntOption()
Expand All @@ -62,7 +62,7 @@ class PostGISLinearAssetDao() {
val informationSource = r.nextIntOption()
val isSuggested = r.nextBoolean()

ProhibitionsRow(id, linkId, sideCode, prohibitionId, prohibitionType, validityPeridoType, validityPeridoStartHour, validityPeridoEndHour,
ProhibitionsRow(id, linkId, sideCode.getOrElse(99), prohibitionId, prohibitionType, validityPeridoType, validityPeridoStartHour, validityPeridoEndHour,
exceptionType, startMeasure, endMeasure, createdBy, createdDate, modifiedBy, modifiedDate, expired, timeStamp,
geomModifiedDate, validityPeridoStartMinute, validityPeridoEndMinute, prohibitionAdditionalInfo, linkSource,
verifiedBy, verifiedDate, informationSource, isSuggested)
Expand All @@ -74,7 +74,7 @@ class PostGISLinearAssetDao() {
def apply(r: PositionedResult) : PersistedLinearAsset = {
val id = r.nextLong()
val linkId = r.nextString()
val sideCode = r.nextInt()
val sideCode = r.nextIntOption()
val value = r.nextIntOption().map(NumericValue)
val startMeasure = r.nextDouble()
val endMeasure = r.nextDouble()
Expand All @@ -92,7 +92,7 @@ class PostGISLinearAssetDao() {
val informationSource = r.nextIntOption()


PersistedLinearAsset(id, linkId, sideCode, value, startMeasure, endMeasure, createdBy, createdDate, modifiedBy, modifiedDate, expired, typeId, timeStamp, geomModifiedDate,
PersistedLinearAsset(id, linkId, sideCode.getOrElse(99), value, startMeasure, endMeasure, createdBy, createdDate, modifiedBy, modifiedDate, expired, typeId, timeStamp, geomModifiedDate,
linkSource, verifiedBy, verifiedDate, informationSource.map(info => InformationSource.apply(info)))
}
}
Expand All @@ -101,7 +101,7 @@ class PostGISLinearAssetDao() {
def apply(r: PositionedResult) = {
val id = r.nextLong()
val linkId = r.nextString()
val sideCode = r.nextInt()
val sideCode = r.nextIntOption()
val value = r.nextIntOption().map(NumericValue)
val startMeasure = r.nextDouble()
val endMeasure = r.nextDouble()
Expand All @@ -124,8 +124,8 @@ class PostGISLinearAssetDao() {
val administrativeClass = AdministrativeClass(r.nextInt())

val geometry = Seq(Point(startPoint_x, startPoint_y), Point(endPoint_x, endPoint_y))
PieceWiseLinearAsset(id, linkId, SideCode(sideCode), value, geometry, expired, startMeasure, endMeasure,
geometry.toSet, modifiedBy, modifiedDate, createdBy, createdDate, typeId, SideCode.toTrafficDirection(SideCode(sideCode)), timeStamp,
PieceWiseLinearAsset(id, linkId, SideCode(sideCode.getOrElse(99)), value, geometry, expired, startMeasure, endMeasure,
geometry.toSet, modifiedBy, modifiedDate, createdBy, createdDate, typeId, SideCode.toTrafficDirection(SideCode(sideCode.getOrElse(99))), timeStamp,
geomModifiedDate, linkSource, administrativeClass, verifiedBy = verifiedBy, verifiedDate = verifiedDate, informationSource = informationSource.map(info => InformationSource.apply(info)))


Expand All @@ -142,8 +142,8 @@ class PostGISLinearAssetDao() {
val endPoint_x = r.nextDouble()
val endPoint_y = r.nextDouble()
val geometry = Seq(Point(startPoint_x, startPoint_y), Point(endPoint_x, endPoint_y))
val sideCode = r.nextInt()
LightLinearAsset(geometry, value, expired, typeId, sideCode)
val sideCode = r.nextIntOption()
LightLinearAsset(geometry, value, expired, typeId, sideCode.getOrElse(99))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class PostGISMaintenanceDao() {
def apply(r: PositionedResult) : DynamicAssetRow = {
val id = r.nextLong()
val linkId = r.nextString()
val sideCode = r.nextInt()
val sideCode = r.nextIntOption()
val startMeasure = r.nextDouble()
val endMeasure = r.nextDouble()

Expand All @@ -89,7 +89,7 @@ class PostGISMaintenanceDao() {
val verifiedDate = r.nextTimestampOption().map(timestamp => new DateTime(timestamp))
val informationSource = r.nextIntOption()

DynamicAssetRow(id, linkId, sideCode, value, startMeasure, endMeasure, createdBy, createdDate, modifiedBy, modifiedDate, expired, typeId, timeStamp, geomModifiedDate, linkSource, verifiedBy, verifiedDate, informationSource)
DynamicAssetRow(id, linkId, sideCode.getOrElse(99), value, startMeasure, endMeasure, createdBy, createdDate, modifiedBy, modifiedDate, expired, typeId, timeStamp, geomModifiedDate, linkSource, verifiedBy, verifiedDate, informationSource)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PostGISSpeedLimitDao(val roadLinkService: RoadLinkService) extends Dynamic
def apply(r: PositionedResult) : SpeedLimitRow = {
val id = r.nextLong()
val linkId = r.nextString()
val sideCode = r.nextInt()
val sideCode = r.nextIntOption()
val value = r.nextIntOption()
val startMeasure = r.nextDouble()
val endMeasure = r.nextDouble()
Expand All @@ -47,7 +47,7 @@ class PostGISSpeedLimitDao(val roadLinkService: RoadLinkService) extends Dynamic
val linkSource = r.nextInt()
val publicId = r.nextString()

SpeedLimitRow(id, linkId, SideCode(sideCode), value, startMeasure, endMeasure, modifiedBy, modifiedDateTime, createdBy, createdDateTime, timeStamp, geomModifiedDate, expired, linkSource = LinkGeomSource(linkSource), publicId)
SpeedLimitRow(id, linkId, SideCode(sideCode.getOrElse(99)), value, startMeasure, endMeasure, modifiedBy, modifiedDateTime, createdBy, createdDateTime, timeStamp, geomModifiedDate, expired, linkSource = LinkGeomSource(linkSource), publicId)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ object PostGISDirectionalTrafficSignDao {
propertyRequired = propertyRequired,
propertyValue = propertyValue.getOrElse(propertyDisplayValue.getOrElse("")).toString,
propertyDisplayValue = propertyDisplayValue.orNull)
val validityDirection = r.nextInt()
val validityDirection = r.nextIntOption()
val createdBy = r.nextStringOption()
val createdDateTime = r.nextTimestampOption().map(timestamp => new DateTime(timestamp))
val modifiedBy = r.nextStringOption()
Expand All @@ -142,7 +142,7 @@ object PostGISDirectionalTrafficSignDao {
val linkSource = r.nextInt()
val externalId = r.nextStringOption()

DirectionalTrafficSignRow(id, linkId, point.x, point.y, mValue, floating, timeStamp, municipalityCode, property, validityDirection,
DirectionalTrafficSignRow(id, linkId, point.x, point.y, mValue, floating, timeStamp, municipalityCode, property, validityDirection.getOrElse(99),
bearing, createdBy, createdDateTime, modifiedBy, modifiedDateTime, linkSource = LinkGeomSource(linkSource), externalId = externalId)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ object PostGISTrafficSignDao {
val modifiedAt = r.nextTimestampOption().map(timestamp => new DateTime(timestamp))
val linkSource = r.nextInt()
val bearing = r.nextIntOption()
val validityDirection = r.nextInt()
val validityDirection = r.nextIntOption()
val optPanelType = r.nextIntOption()
val panelValue = r.nextStringOption()
val panelInfo = r.nextStringOption()
Expand All @@ -244,7 +244,7 @@ object PostGISTrafficSignDao {
val externalId = r.nextStringOption()

TrafficSignRow(id, linkId, point.x, point.y, mValue, floating, timeStamp, municipalityCode, property,
validityDirection, bearing, createdBy, createdAt, modifiedBy, modifiedAt, LinkGeomSource(linkSource),
validityDirection.getOrElse(99), bearing, createdBy, createdAt, modifiedBy, modifiedAt, LinkGeomSource(linkSource),
additionalPanel, expired, externalId)
}
}
Expand Down

0 comments on commit 10e88b3

Please sign in to comment.