cannot get accurate position using meter offset in scatterplot
See original GitHub issueI used the below to plot using METER_OFFSET. Results are quite good until the points are very far from the Origin, where they start moving away from their positions plotted using LNGLAT. Any idea to get it more accurate with the lnglat positions?
class Layer extends ScatterplotLayer {
constructor(props) {
super(props)
}
calculateInstancePositions(attribute) {
const { data, getPosition, projectionMode, positionOrigin } = this.props
const { viewport } = this.context
const { value } = attribute
let i = 0
for (const point of data) {
let position = getPosition(point)
if (projectionMode === COORDINATE_SYSTEM.METER_OFFSETS) {
const lngLatDelta = [
position[0] - positionOrigin[0],
position[1] - positionOrigin[1]
]
position = viewport.lngLatDeltaToMeters(lngLatDelta)
if (
(lngLatDelta[0] < 0 && position[0] > 0) ||
(lngLatDelta[0] > 0 && position[0] < 0)
) {
position[0] *= -1
}
if (
(lngLatDelta[1] < 0 && position[1] < 0) ||
(lngLatDelta[1] > 0 && position[1] > 0)
) {
position[1] *= -1
}
}
value[i++] = get(position, 0)
value[i++] = get(position, 1)
value[i++] = get(position, 2) || 0
}
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:23 (10 by maintainers)
Top Results From Across the Web
cannot get accurate position using meter offset in scatterplot
METER_OFFSET will only give you high precision for positions near the center. It is used when you have a center LATLNG with relative...
Read more >Scatter plot of position errors for different scenarios.
A method to enhance the indoor positioning accuracy by alleviating the effect of multipath distortion is presented. Using this method the line-of-sight ...
Read more >SCATTERPLOT Statement - SAS Help Center
A positive offset is to the right on discrete X values and up on discrete Y values. If the layout's axis options set...
Read more >ggplot2 offset scatterplot points - Stack Overflow
I would like to offset the second so it's displayed slightly down from the first set, so that it doesn't obscure the original....
Read more >A Complete Guide to Scatter Plots - Chartio
A scatter plot (aka scatter chart, scatter graph) uses dots to represent values ... Each row of the table will become a single...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@huaruiwu In that case,
projectionPixelsPerUnit
needs to be an attribute. Depending on the distance between the center point, each vertex would need to be projected using a differentprojectionPixelsPerUnit
Currently,
projectionPixelsPerUnit
is calculated around the center point and the same for all points.Collecting early thoughts on improved projection modes in this RFC