Replies: 3 comments
-
The library isn't of any use since it's in Kotlin. You might be able to use some methods of calling Java from Lua, but I'm skeptical that's a useful route. You could process the json from lua, but a more useful route would be to process the json file into a lua file with object definitions you can include from your transforms. The get_bbox function in the flex transforms would let you do countries, but you'd have to handle your lookup. As mentioned in the processing thread, we could get the ability to do a lookup similar to imposm's geojson matching at some point. None of this really helps, as to use the json file you'd need to turn all of the filters into lua string matching. I suppose it's all possible in PostgreSQL too, but that's always been the case. Fortunately, in my experience mappers are pretty good about getting maxspeed tagged on all roads where it matters, so the need for a library like the one linked will get better over time as maxspeed data gets filled in more. |
Beta Was this translation helpful? Give feedback.
-
You can use an approach like Sven uses in his osml10n setup. A server runs in the background (in Svens case written in Python, because he needs some Python libs, in your case probably in Kotlin) which can be accessed from Lua through a network connection. He also uses get_bbox to find out in which country he is. I suspect this is going to be slow though, because you have the extra network connection for each |
Beta Was this translation helpful? Give feedback.
-
osm-legal-default-speeds repo mentions that it's supporting native environment, besides the already mentioned JVM, and also Javascript. Unfortunately, the project repo doesn't describe all prerequisites and necessary steps in more detail. If that's the case, you might be able to call this native code through Lua FFI and your own bindings. That's probably the best performance you could get. However, FFI tends to be rather complex: you need detailed knowledge of C and calling conventions. I used FFI before in Ruby to generate GPS trace preview images, and I guess you will face similar challenges in Lua. Edit: FFI seems to be LuaJIT specific... for Lua, maybe take a look at https://www.lua.org/pil/26.html or https://chsasank.com/lua-c-wrapping.html and similar approaches instead. |
Beta Was this translation helpful? Give feedback.
-
Westnordost recently released this Kotlin library, GeoJSON and testing Tool that will add default maxspeed data to OSM data https://github.com/westnordost/osm-legal-default-speeds.
I am wondering, how one would go about to apply this process to a tooling setup that is based on osmium > osm2pgsql (LUA) > some custom PostgreSQL/PostGIS for more fancy filtering/processing.
I read the post by Sarah that mmd-osm shared in the geometry processing thread.
My take is, that right now, there is not good way to apply such default data. Or is there…?
Beta Was this translation helpful? Give feedback.
All reactions