Closed Leon0402 closed 2 years ago
Hi @Leon0402, I highly recommend you take a look through the new version of trajdata. I've overhauled the map interface so now there's a unified vectorized representation which should be easier to work with.
Hi @BorisIvanovic I already had a look at new changes, but I don't see how they help here. I found no methods, which would simply above code.
But maybe I overlooked something. Can you give an example?
Ahh sorry, I thought you might have been looking for more detailed information in the map. If you're looking to get the entire rasterized maps, what you're doing above makes sense 👍
I don't think there's much I can do to simplify the first function, however I would think that load_map_patch
covers a good portion of the second function, since you are already getting the patch bounds as .min() - 50
and .max() + 50
, the average of which you could pass as the world center and the differences of which you can pass as the patch size.
As for offset_xy
, if you don't want any offset, you could always pass in (0, 0)
(this will center the patch at your spcified world center).
@BorisIvanovic Do you mean there is not much we can do to simply the first function with what Trajdata offers currently or in general?
In general I could think of a few ways to improve the first and second method:
dataset.access_scene_cache(scene)
. Additionally the SceneCache should then offer more methodsload_map_patch
can be refactored a little bit to provide default values and such stuff for easier usage. And perhaps some overload with patch bounds rather than centers or to access the whole map. Perhaps also make padding optional. @Leon0402 Your interpretation is correct: "there is not much we can do to simply the first function with what Trajdata offers currently"
As for your later points, I agree. We're actually internally building something like a MapAPI
object whose goal is to provide a nice interface to access map data without the requirement to access internal class members like now (sorry for the state of it now...). Keep an eye out for a future update when I bring it to this repo! 👌
Hi,
I have some uses cases where I need the map data beforehand for a specific scene. Here are two code examples:
I find it a little bit difficult to read the map data and would love to have a nicer interface for this! Can something be added to make this simpler?
Edit: I know there a methods like
load_map_patch
, but they were difficult to use in the above methods. Mainly because you have to specify a center and it also does padding.