Skip to content
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

values unit of collected item using org_rel -> gives no error if not matching. #199

Closed
jipclaassens opened this issue Mar 31, 2023 · 14 comments
Assignees
Labels
invalid This doesn't seem right
Milestone

Comments

@jipclaassens
Copy link
Member

jipclaassens commented Mar 31, 2023

If the configured values unit of the collected item does not match with original attribute, no error is given and gives false results! See attribute /sub/D

Moreover, attribute /src/B gives no real error message.

For example:

container Cfg
{
unit<uint32> Kwartalen : nrofrows = 45
{
	attribute<uint32> value        : [201201 ,201204, 201207, 201210
										, 201301 ,201304, 201307, 201310
										, 201401, 201404, 201407, 201410
										, 201501, 201504, 201507, 201510
										, 201601, 201604, 201607, 201610
										, 201701, 201704, 201707, 201710
										, 201801, 201804, 201807, 201810
										, 201901, 201904, 201907, 201910
										, 202001, 202004, 202007, 202010
										, 202101, 202104, 202107, 202110
										, 202201, 202204, 202207, 202210
										, 202301];
	attribute<string> label         := 'Y' + string(value);
}

unit<uint32> NoData: NrOfrows = 1
{
	attribute<uint32> value     := const(0,.);
	attribute<string> Label     : ['NA'];
}

unit<uint32> Kwartalen_nodata := union_unit(NoData, Kwartalen)
{
	attribute<string>   Label        := union_data(., NoData/Label, Kwartalen/Label), DialogType = "LabelText";
	attribute<uint32>   value        := union_data(., NoData/value, Kwartalen/value);
}

unit<uint32> src : nrofrows = 5
{
	attribute<uint32>           A_kw           : [201304, 201210, 201704, 201801, 202207];
	attribute<Kwartalen>        A              := rlookup(a_kw, Kwartalen/value); 
	attribute<bool>             selection_attr := A > 3;
	attribute<Kwartalen_nodata> B              := A;    // should give error, because mismatch of values units.
	attribute<Kwartalen_nodata> C              := 1 * A; //categorical multiplication should be allowed, but then without the 
                                                              categorical values unit. In this case, this should give an error.
	attribute<uint32>                    E              := 2 * A;  //so this should be allowed.
}

unit<uint32> sub := select_with_org_rel(src/selection_attr)
{
	attribute<Kwartalen_nodata> D              := org_rel -> A;
}
}

src:
image

sub:
image

related with issues: #117

@jipclaassens jipclaassens added bug invalid This doesn't seem right OVSRV06 testcase available on ovsrv06 labels Mar 31, 2023
@jipclaassens jipclaassens removed the OVSRV06 testcase available on ovsrv06 label Apr 3, 2023
@jipclaassens
Copy link
Member Author

The result of a union_unit should be catagorical.

@mtbeek32
Copy link
Contributor

mtbeek32 commented Apr 3, 2023

idea: All explicitly configured units with as a value type of the group: CanbeDomainUnit and for which the cardinality is known or can be known: categorical.

@mtbeek32
Copy link
Contributor

mtbeek32 commented Apr 3, 2023

configuration also available in:
repository: https://github.com/ObjectVision/GeoDMS-Test
configuration file: Unit/Unit/cfg/categorical_test.dms

@mtbeek32
Copy link
Contributor

mtbeek32 commented Apr 3, 2023

Also added to unit test, partly not yet active for test that should work in the future.

MaartenHilferink added a commit that referenced this issue Apr 3, 2023
…Kwartalen_nodata : UInt32) with the categorical calculation results ( : UInt32) is not possible (different CheckedKeyExpr)
@MaartenHilferink MaartenHilferink modified the milestones: v8.9.3, v8.9.2 Apr 4, 2023
MaartenHilferink added a commit that referenced this issue Apr 4, 2023
@MaartenHilferink
Copy link
Collaborator

MaartenHilferink commented Apr 4, 2023

idea: All explicitly configured units with as a value type of the group: CanbeDomainUnit and for which the cardinality is known or can be known: categorical.

What about:
unit<uint16> BouwJaar := range(uint16, 1050w, 2300w); ?
Maybe we need an andditional function cat_range for this and let nrofrows = x be replaced by cat_range

@mtbeek32
Copy link
Contributor

mtbeek32 commented Apr 5, 2023

Source of unit determines if it is categorical or not.

Units read from a storage, with a number of rows property or resulting from the following functions are considered categorical:

  • union_unit
  • unique
  • select_with_org_rel
  • select
  • select_with_attr_by_org_rel
  • select_uint32_16_8_with_attr_by_org_rel
  • select_with_attr_by_cond
  • select_uint32_16_8_with_attr_by_cond
  • combine
  • combine_uint8_16_32_64
  • overlay
  • overlay32
  • overlay_polygon
  • split_polygon
  • polygon_connectivity
  • dyna_point
  • dyna_point_with_ends
  • dyna_segment
  • dyna_segment_with_ends
  • sequence2points
  • arc2segm
  • connect
  • connect_eq
  • connect_ne
  • connected_parts
  • dijkstra
  • district
  • district_8
  • TiledUnit (irregular)
  • Subitem_PropValues
  • Inherited_PropValues
  • SubTree_PropValues

no categorical for the following functions:

  • range
  • BaseUnit
  • GridSet
  • no expression

regular variant of the TiledUnit data need to become depreciated

@basvanbemmel
Copy link
Collaborator

Ik krijg in 9.03 op (het werkt wel in 8.9.1):
/Analysis/Allocatie/Zichtjaren/Y2050/Impl/CalcStand/Subsector_rel

Domain unification of the specified categorical ValuesUnit (/CaseClassifications/StandVar/SubSector : UInt32) with the noncategorical calculation results ( : UInt32) is not possible (different CheckedKeyExpr)
/Analysis/Allocatie/Zichtjaren/Y2050/Impl/CalcStand/Subsector_rel

Context:

  1. while in DMS_TreeItem_IncInterestCount( /Analysis/Allocatie/Zichtjaren/Y2050/Impl/CalcStand/Subsector_rel: AbstrDataItem )

Open casus.dms
PD9866: https://pbl.sliksvn.com/ruimtescanner/PBL/ProjDir/branches/RSLight2021_ontwikkel_3
SD 9863: https://pbl.sliksvn.com/ruimtescanner/PBL/SourceData/Trunk/RSL

@basvanbemmel
Copy link
Collaborator

En hebben jullie het bovenstaande nu kunnen reprodcueren?

@mtbeek32
Copy link
Contributor

mtbeek32 commented May 8, 2023 via email

@basvanbemmel
Copy link
Collaborator

basvanbemmel commented May 8, 2023 via email

@jipclaassens
Copy link
Member Author

@basvanbemmel kun jij dit nog eens proberen met nieuwe basedata en variantdata? (lees; gegenereerde base/variantdata in een geodms 9 versie)

@basvanbemmel
Copy link
Collaborator

Ik heb opnieuw gegenereerd het lijkt nu inderdaad wel te werken.

@basvanbemmel
Copy link
Collaborator

Overigens in PD9712 is in Geography.dms iets gewijzigd waardoor cfg niet meer in te lezen is in exe 8.6.5 en lager.
Je krijgt dan:

Unknown property 'SpatialReference'
k:/pd/rslight2021_ontwikkel_3/cfg/RSLight2021/Geography.dms(6,94) at
unit rdc_meter_base : DialogData = "ngr_layer", SpatialReference = "EPSG:28992";
unit rdc_meter_base : DialogData = "ngr_layer", SpatialReference = "EPSG:28992"^
k:/pd/rslight2021_ontwikkel_3/runs/casus.dms(20,55) at
#include <%projdir%/cfg/RSLight2021/Geography.dms>
#include <%projdir%/cfg/RSLight2021/Geography.dms>^

Context:

  1. while in AppendTreeFromConfiguration::casus.dms
  2. while in DMS_CreateTreeFromConfiguration::casus.dms

@jipclaassens
Copy link
Member Author

Klopt, de Format property naam is veranderd in SpatialReference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

4 participants