Opened 16 years ago

Closed 13 years ago

#745 closed defect (fixed)

Error Theming Layer using data source with feature joins

Reported by: CivilEng Owned by:
Priority: high Milestone:
Component: Web API Version: 2.0.1
Severity: critical Keywords: Theming, feature joins
Cc: brucedechant External ID:

Description (last modified by jbirch)

The error is raised when individual distribution is requested.

MgFeatureAggregateOptions aggregateOptions = new MgFeatureAggregateOptions();
aggregateOptions.AddFeatureProperty(UFunctions.GetParameter(this.args, "PROPERTYNAME"));
aggregateOptions.SelectDistinct(true);

// this line raises the exception
dataReader = featureService.SelectAggregate(resId, layer.GetFeatureClassName(), aggregateOptions);

Error: Index is out of range.
StackTrace:
- MgFeatureServiceHandler.ProcessOperation line 83 file d:\buildforgeprojects\mapguide_open_source_v2.0\build_27.16\mgdev\server\src\services\feature\FeatureServiceHandler.cpp
  - MgOpSelectFeaturesSpatial.Execute line 110 file d:\buildforgeprojects\mapguide_open_source_v2.0\build_27.16\mgdev\server\src\services\feature\OpSelectFeaturesSpatial.cpp
  - MgServerSelectFeatures.SelectFeatures line 249 file d:\buildforgeprojects\mapguide_open_source_v2.0\build_27.16\mgdev\server\src\services\feature\ServerSelectFeatures.cpp
  - GetItem line 81 file d:\buildforgeprojects\mapguide_open_source_v2.0\build_27.16\mgdev\common\foundation\System/DisposableCollection.cpp Index is out of range.

I am attaching mgp file and access database in order to replicate the error. the mgp contains the flexible(fusion) and basic layout. Both layouts invoke to thememain.aspx (It's the same that comes with the dotnetviewersample).

I have tested for manage and unmanage data source, just as SHP, SDF, and SQL2008 providers.

Attachments (2)

dataCH.mdb (124.0 KB ) - added by CivilEng 16 years ago.
From_SiteServer_20081030_TestTheming.mgp (173.5 KB ) - added by CivilEng 16 years ago.

Download all attachments as: .zip

Change History (7)

by CivilEng, 16 years ago

Attachment: dataCH.mdb added

comment:1 by jbirch, 16 years ago

Description: modified (diff)

comment:2 by brucedechant, 16 years ago

Cc: brucedechant added

comment:3 by tomfukushima, 16 years ago

Milestone: 2.1

comment:4 by jbirch, 15 years ago

Please re-test against 2.1 and let us know if this is still an issue (or close if has been fixed). Will close this ticket if no response by next ticket cleanup cycle.

comment:5 by jng, 13 years ago

Resolution: fixed
Status: newclosed

Try this:

MgFeatureAggregateOptions aggregateOptions = new MgFeatureAggregateOptions();
aggregateOptions.AddComputedProperty("UniqueValue", "UNIQUE(" + UFunctions.GetParameter(this.args, "PROPERTYNAME") + ")");

dataReader = featureService.SelectAggregate(resId, layer.GetFeatureClassName(), aggregateOptions);

UNIQUE() is an undocumented special function that returns a list of unique values for the given property.

Each unique value will be present under the "UniqueValue" computed property as you iterate through the data reader.

Solution tested on 2.4 preview.

Note: See TracTickets for help on using tickets.