Dreamlone / State_Hydrological_Institute

The repository contains materials for projects during my work at State Hydrological Institute (Saint Petersburg, Russia).
1 stars 0 forks source link

sample shapefile #1

Open jaimebayes opened 3 years ago

jaimebayes commented 3 years ago

Hi,

It would be great to have your sample shapefile to test it, just for fun. An then, test it on our own shapefiles.

JL

Dreamlone commented 3 years ago

Hi! As I understand, you are talking about the River_ranking.ipynb file. I can give you a layer of the Ural river, which is already divided into segments and the length is calculated for each segment (let me know if you need it). But I would suggest that you do not use my code from this notebook (the explanations are in Russian), but refer to my article on medium - The Algorithm for Ranking the Segments of the River Network for Geographic Information Analysis Based on Graphs.

Moreover, my colleague and I have made a plugin for the "QGIS" geographic information system - Lines Ranking. And check repo with source code of plugin also. So you can use the plugin on any vector linear objects, such as river layers from OpenStreetMap.

jaimebayes commented 3 years ago

Hi, Thanks for your soon reply. Sure, I would like to have your layer of the Ural river. Yes, I already read your medium article, very interesting, and because of it, I installed and run your plugin in QGIS 3.14, but it gave me a weird result, I mean, it shows just a fraction of the original network, I dont know why, maybe my shapefile is a bit large. JL

Dreamlone commented 3 years ago

I am very glad that you are interested in my article and algorithm. The problem may be that your source layer has a corrupted topology, which even the built-in correction algorithm can't handle. Or, you may have chosen the "tightening" threshold too small or too large. You can fix the problem areas of the layer manually, or just try to change the "tightening" threshold until get satisfactory result. I should also say that the segmentation modules and topology corrections that our algorithm uses give an undetermined result in some cases. The segment ranking algorithm is sensitive to partitioning, so you can try running the algorithm several times. But remember, our algorithm is strictly deterministic, it can produce different results only because of different partitions into segments.

But I have another suggestion. Since the algorithm selects one connectivity component in the graph, if a part of your river does not touch other segments, these segments will not be included in the final layer. This is a feature of the algorithm - it only works within a single river network. Therefore the algorithm is able to select river networks that flow into a particular reservoir from large vector layers.

With large layers, the algorithm should have no problems. Nethertheless, we will soon prepare an update for the plugin and hopefully it will work even faster.

So, you can find vector layers in my Google drive folder. The Ural_lines layer is already divided into segments, and the Ural_points layer contains information about the intersection of these segments. You can use these layers outside of QGIS. Running just the appropriate functions from the second part of my notebook. So Ural_lines should be loaded into "l_data" variable and Ural_points - into "data" variable. The All_rivers layer is suitable for use in the QGIS plugin. Try the algorithm on it first. You will see that some parts of the river disappear from the final layer - it is ok. This is due to the features of the vector layer.

Good luck!

jaimebayes commented 3 years ago

Hi, You are right, my network layer must be corrupted, because it runs fine with your layer in QGIS. I will try to run it as notebook, following your suggestions. Thanks for your support, this is very interesting to me as a engineer working with GIS almost everyday. I will tell you how it works as a colab notebook. Best regards, JL

Dreamlone commented 3 years ago

Great, if you have any questions, feel free to contact me