AnsweredAssumed Answered

CreateDataset fails with "value does not fall within the expected range"

Question asked by mark3773 on Jun 15, 2018

I am able to create a network dataset with just street and empty turn feature classes but as soon as i add a single point junction source i get this error. I've reduced the problem from being anything to do with the source evaluators as i still get the error when i don't set any for the source.

 

I thought maybe it was an extents issue but i drop/recreate the index and recalculate the FC extent before adding the source.

 

Spent all day fighting this error and wondering if anyone else has hit this error before and found a solution?

 

Without the junction source i can create and exercise the network with an OD cost matrix solver with no issues. Junction creation below. Any thoughts welcome, thanks!

 

mark

public static INetworkSource CreateJunctionSource(string name,
    esriNetworkJunctionConnectivityPolicy connectivityPolicy = esriNetworkJunctionConnectivityPolicy.esriNJCPOverride)
{
    // Create a JunctionFeatureSource object and point it to the appropriate feature class.
    INetworkSource junctionNetworkSource = new JunctionFeatureSourceClass();
    junctionNetworkSource.Name = $"{name}";
    junctionNetworkSource.ElementType = esriNetworkElementType.esriNETJunction;

    // Set the junction feature source's connectivity settings.
    IJunctionFeatureSource junctionFeatureSource = (IJunctionFeatureSource)junctionNetworkSource;
    junctionFeatureSource.UsesSubtypes = false;
    junctionFeatureSource.RemoveAllClassConnectivityGroups();
    junctionFeatureSource.ClassConnectivityGroups.Add(1);
    junctionFeatureSource.ClassConnectivityPolicy = connectivityPolicy;
    return junctionNetworkSource;
}

Outcomes