2

I have a PostGIS database of road features which are split at intersections. Some of the features on an individual road have certain attribute info (i.e. speed limits) and others do not. I want to fill in the gaps, so that if one feature is missing a speed limit, it will automatically be assigned based on the fact that maybe four blocks south there is another feature which has the same name, roadtype, and is connected through other features to the original.

Right now all I can think of is a clunky and slow python script which will calculate predecessors and successor features, then use a bunch of loops to propagate down the road. It feels like that would kind of be reinventing the wheel a little bit, and I am wondering if there might be any tools to help with this? Performance is a bit of a concern because I would like to do this for cities containing over a million features, although it is an offline process so it doesnt necessarily need to be ultra fast.

I am using Python 2 and have access to ArcGIS tools.

wmebane
  • 660
  • 4
  • 17
  • If only such thiang as "down" exists for roads. Have a look at http://gis.stackexchange.com/questions/165410/set-missing-pipe-network-data-age-size-based-on-nearest-neighboring-or-connec/165553#165553 this might give you some ideas – FelixIP Feb 17 '16 at 05:38

1 Answers1

1

I had to do a similar task (on water mains, so slightly different requirements) a few years back. I can't completely recall the process I came up with, but it was along the lines of the following:

  1. Select all lines with a valid speed limit value and output to a temporary feature class (so only lines with a speed limit are in the new temp FC
  2. Dissolve your streets feature class (into a new feature class) either by street name, or just a full dissolve that can be exploded at intersection
  3. Spatial join your dissolved streets to the lines with speed limit, which will add that speed limit against each dissolved line
  4. Spatial join your original streets to the dissolved lines which will add the speed limit to each individual street (in a new fc)
  5. Join your original street layer to the new temp fc and calculate the speed limit across

There is probably a more efficient way to do it, but the above should be fairly easy to put into python and should be less "clunky" than the process you describe. I also only had to do this on ~16000 features, so may be quite a different beast with 1m+ features.

Midavalo
  • 29,696
  • 10
  • 48
  • 104