-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shakemap map bounds across date line breaking #1840
Comments
You can probably handle this by normalizing the coordinates around the epicenter, so longitudes are consistent. If event longitude is +, normalize all values to be [0,360); if event longitude is -, normalize all values to be (-360,0]. For the image overlay, something like:
This was an issue in geojson and @cbworden implemented something to handle this shift. For this event, all longitudes seem to use the - coordinate system even though epicenter is +. This results in contours plotting on "wrong" side of map instead of with epicenter. |
I'm not sure I understand what you mean by "all longitudes". From where are you obtaining the longitudes? The overlay png looks okay, and the png world file correctly gives the upper left corner of the plot and the dx increment is positive and the dy is negative. What needs to change to make the overlay work? |
Looking in the event feed: The shakemap product reports:
The image overlay is stretched and reversed because of this. Daniel can probably update the referenced coordinates so the overlay is shown correctly, or they could be updated for internal consistency before sending the product: MMI contours file uses negative coordinates, even though the epicenter longitude is reported as (+)173.054. When selecting contours they are plotted on the "other" side of the map at the left edge.
Coverage JSON is consistent with epicenter longitude and looks good:
|
I guess I'm lost. It seems like in one case longitudes that go beyond +/-180 are okay, and in the other they are not. Is everything relative to the epicenter, or are longitudes absolute? Why is -179 different from 181? And when? So, if my epicenter is 179.0 and the map spans 4 degrees (+/- 2 degrees on either side of the epicenter), what are its max/min longitudes? And if the epicenter is -179.0, what are its max/min longitudes? For everything. The properties, the contours, the stations, everything. |
The main problem is when we use the data in leaflet. It's longitudes continue, but it only wraps at 360 instead of 180. Using coordinates that are close to the reported epicenter helps keep all the data in a similar view. So if the epicenter was at +179, use coordinates [+177, +181]; for -179, use coordinates[-181, -178]; etc. It's okay if the values extend beyond +/- 180 as long as they are centered on the epicenter. Generally this should keep longitudes within (-360,360] and better to be consistent even if there's a little overflow. There's a whole other issue if the origin is on one side, and shakemap on the other, but it's much easier to shift individual points than polygons with many points. |
Okay, thanks. I'll go through the code and try to keep things consistent with the epicenter. If only the world was flat this would all be easier. |
Are we reasonably safe at the zero line? So, e.g., if the min longitude is -2 and the max is +2 I can leave it? |
yes, because those are both close to zero. |
Checkout us1000778i
The text was updated successfully, but these errors were encountered: