ShapeNetwork class example

#1

Hello,
I am looking for the same feature as the topic recently posted: path planning.
Paul suggested that ShapeNetwork class is still available in MapWinGIS, but there is no certainty if it is still working.
@pmeems, is there some old example that I can follow, in order to test its working?
Thank you.

0 Likes

#2

I don’t have any example code. And I can’t remember I’ve seen any (and I’m over a decade with this project :wink: )

All I have is the API description:

A shape network is created from the shapes in a polyline shapefile which allows you to traverse the shapefile simulating water flowing in a watershed to a single outlet. To create a shape network from a polyline shapefile, first choose an outlet shape from the shapes in the shapefile. Next, choose an outlet point within the specified outlet shape. Finally, you need to select a tolerance value. The tolerance is used to determine whether to include a shape in the shape network if it is not connected to the network. Using this starting criteria, a shape network can be created from the polyline shapefile.

0 Likes

#3

Thank you Paul.
I googled and found an old MapWinGIS manual from 2007, which shows this VBdotNET example code:

Private Sub BuildNetwork()
Dim sf As New MapWinGIS.Shapefile()
Dim shapenetwork As New MapWinGIS.ShapeNetwork()
Dim result As Integer, hndl As Integer
'Open a line shapefile
sf.Open(“C:\test.shp”)
'Build a shape network from the shapefile using shape 0 as the outlet shape and point 0 in shape 0 as the outlet point
result = shapenetwork.Build(sf, 0, 0, 10, MapWinGIS.AmbiguityResolution.DISTANCE_TO_OUTLET)
End Sub

But that does not seem to be enough.
Anyhow, thank you for the effort.

0 Likes

#4

Hello all (@george, @pmeems).

I looked into this only a little, but my take on it was that it was designed for a specific purpose, and that purpose would not satisfy street routing problems; for instance,

  • rather than a distinct outlet point, it is necessary to specify specific starting and ending points (and sometimes intermediate points, as in the TSP)
  • you have to be able to deal with one-way streets, temporarily closed roads, and speed limits

Because of the various complexities, I decided not to try re-inventing that wheel in our code, but rather to use an external library. As mentioned previously, there are various options out there, depending on your use cases and constraints (e.g. self-contained vs web service, shapefiles vs Open Street Maps, etc.)

Regards.
Jerry.

0 Likes

#5

Thank you for sharing your experiences @jerryfaust!
I will will follow your topic, in order not to contaminate this one.

0 Likes

#6

I’m watching this too!If you implement it, I hope you can give me some Suggestions!

Thank you very much!

0 Likes