|
In my experience, any time you project rasters across the Pacific you lose the "degenerate" data at longitudes > 180 (now fixed for Orthographic only). Even if you have Mercator data across the Pacific you lose it when reprojecting to Lat/Long. It seems to me that as Manifold's functions have moved more and more to using SQL operations in the background the problem has followed the definition of the "LONGITUDE" data type - which, when data is cast to that type, truncates coordinates > 180 to 180 (rather than to their complement at -360). I made this request a while back: I'd like to see images and surfaces in Latitude/Longitude that extend across the 180 longitude line be reprojected in a way that maintains any data at longitudes > 180. Here's an example illustrating the problem, drawings preserve data across the dateline, surfaces and images do not: I.e. (attached map file) 1. open World2.map 2. open World2 drawing 3. zoom to NZ/Pacific region (use /View/Panes/View/ ->NZPacific) 4. select all objects in view, copy / paste as new drawing 5. Change Projection of new drawing -> OrthoGraphic CenterLon = -174, CenterLat = -30 - The data east of lon 180 (i.e. the Antarctic Peninsula) is preserved Return to step 3. above (zoom to NZ Pacific in World2 Drawing) 6. F6, make image (default) 7. Assign projection of new image 8. Change project of new image -> OrthoGraphic CenterLon = -174, CenterLat = -30 - The data east of lon 180 is not preserved. Same goes for surfaces. (A workaround is to create a duplicate of the image, Assign its Projection to Local Offset X - 360, then copy/paste the two together and then reproject). It seems inconsistent to me that drawings and image/surfaces behave differently. This is the case with some SQL and other operations involving the Longitude type - although this at times will convert any longitudes >180 to 180.0 - which is another thing, and I'm not as clear about the situations. I'd certainly like to see longitudes > 180 handled as if they were -360, not pushed back to 180 - but I understand that the possibilities involved are quite diverse, and probably require some careful distinction. It would be great if the various situations were explicitly described in the manual. And this: Hello, assuming "Table" has data in "Column" containing numbers in the range [-180, 360] I would prefer a modification to the current behaviour: SELECT CAST([Column] AS Longitude) FROM [Table] Currently, this forces any values > 180 to equal 180.0, but it would be more useful if it could either: 1. Return an error, stating that the given values are not valid longitudes (as per the Data Type definition). 2. Same as (1.), but with an option argument to the CAST operator to allow longitudes greater than 180 to be converted to (lon - 360). 3. Allow CAST to accept a new Data Type called "Longitude2" - which has the following quality: LONGITUDE2: 8 bytes A double-precision floating-point longitude value in the range [0 - 360]. BTW, the documentation currently lists the Longitude data type as: LONGITUDE 8 bytes A double-precision floating-point *latitude* value. With these responses: > From: Michael Sumner > > I've tried out build 802 with the workflow described below (as in the > > original report). > > > > The same result occurs, so there seems to be no change when projecting > > lat/lon to orthographic across the dateline. > > > > ... We have tracked the problem down to a bug in the new code that we have added. We will fix the bug. Sorry for letting it slip through. > I would prefer a modification to the current behaviour: > > > > SELECT CAST([Column] AS Longitude) FROM [Table] > > > > Currently, this forces any values > 180 to equal 180.0, but it would > > be more useful if it could either: > > > > 1. Return an error, stating that the given values are not valid > > longitudes (as per the Data Type definition). We agree. We have filed a request to alter the code for the CAST so it returns a NULL value. > > 2. Same as (1.), but with an option argument to the CAST operator to > > allow longitudes greater than 180 to be converted to (lon - 360). We agree with this as well. We think the wrapping is best done with a function. > > 3. Allow CAST to accept a new Data Type called "Longitude2" - which > > has the following quality: > > > > LONGITUDE2 > > 8 bytes > > A double-precision floating-point longitude value in the range [0 - 360]. Given a wrapping function, this would no longer be necessary. > > BTW, the documentation currently lists the Longitude data type as: > > > > LONGITUDE > > 8 bytes > > A double-precision floating-point *latitude* value. We will fix this. The regime of testing is a great idea. I'd be happy to show how it's done using PROJ.4 / GDAL - which allows the specification of 0-360 longitudes using the "+over" argument to projection strings. This works even when reprojecting Mercator raster data with GDAL over the Pacific (but I'm not sure it works as comprehensively in as many cases as I'd like - due to lack of exploration, but also I'm still learning). Attachments:
world2.map
https://github.com/mdsumner |