Follow-up to #2579953: Asset cluster maps

The way that the Full Geometry layer is generated currently will not scale. It draws a polygon for EACH asset, which means if multiple assets were moved to an area, that area's geometry will be drawn once for each asset. Visually you don't notice it, because it's just the same shapes repeated on top of themselves. But with larger farms that have thousands of assets, that's just crazy. So I think the best way to do it would be to split the View and create a second one that uses Log as a base table, instead of Farm Asset. This way, we would load up all movement logs (which have the geometry), join in the Asset(s) they reference, and filter by asset type. So we would only have one geometry per movement. There is still the possibility of having multiple polygons per geometry (if there are multiple movements to the same geometry), but it would be less than the other approach. I wonder if we can GROUP BY the content of the geometry field itself?

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

Project: Farm Log » farmOS
Component: User interface » Farm Logs

All farmOS repositories have been merged into the farmOS distribution (see #2876992: Merge farmOS repositories into drupal.org/project/farm). I'm going through and moving all open issues from the various project issue queues to the central queue now...

m.stenta’s picture

Version: 7.x-1.x-dev » 2.x-dev
paul121’s picture

This way, we would load up all movement logs (which have the geometry), join in the Asset(s) they reference, and filter by asset type. So we would only have one geometry per movement.

Our current dashboard and asset maps have separate layers for each asset type, and we include cluster counts to represent overlapping assets, so I wonder if this issue is partially covered?

I wonder if we can GROUP BY the content of the geometry field itself?

This idea of grouping by the geometry value itself is interesting. I think this would mean that in the geojson each feature's geometry would be unique, but it means one feature might have the name/label of multiple asset(s)? This is challenging because it means the map popup for this feature can't load the preview for an individual asset.

m.stenta’s picture

Our current dashboard and asset maps have separate layers for each asset type, and we include cluster counts to represent overlapping assets, so I wonder if this issue is partially covered?

My original concern with this issue was the repeated geometries, which would still be present in v2.

The core issue is:

It draws a polygon for EACH asset, which means if multiple assets were moved to an area, that area's geometry will be drawn once for each asset.

To reproduce, create a single log that moves 100 assets to a location. That location's geometry will be drawn 100 times in the map of assets.

This is challenging because it means the map popup for this feature can't load the preview for an individual asset.

Yea this is a good point - and more relevant in v2 than it was when this issue was originally opened (2015!!). Originally (iirc) asset geometries didn't have popups like they do now (only the cluster did, which listed all the assets as links), so it wouldn't matter if we merged all the same geometries together into one. Now it would.

Looking back with fresh eyes, the "GROUP BY" idea is unworkable also because that database column isn't indexed so it would drastically decrease the query performance.

So this might be "won't fix" now... it hasn't been an issue in practice, only in theory. So maybe we just close this and wait to see if anyone actually encounters it in a meaningful way. It's bound to happen as soon as someone starts pushing the envelope... and then they can help come up with a solution. :-D

m.stenta’s picture

Status: Active » Closed (won't fix)

Closing as "won't fix" but anyone feel free to reopen if there's a need!