Geotools 从多边形和尺寸创建 CRS
我有一些网格数据(二维数组),其中有一些与之关联的地理空间元数据。边界位于具有 WSG84 经纬度坐标的 jts 多边形中。多边形是一个矩形,但未轴对齐(不是边界框)。
我正在尝试创建一个描述此覆盖范围的 geotools CooperativeReferenceSystem 对象。我想使用 CRS 重新投影覆盖范围,但我还需要按原样使用 CRS,因此跳过 CRS 创建步骤是不好的。
煮沸: 如何从 WSG84 多边形、dx、dy、nx、ny 转换为使用地理工具描述网格的 CooperativeReferenceSystem 对象?
预先感谢您的帮助
I have some grid data (2d array) that has some geospatial metadata associated with it. The bounds are in a jts polygon with WSG84 lon lat coordinates. The polygon is a rectangle, but is not axis aligned (not a bounding box).
I am trying to create a geotools CoordinateReferenceSystem object that describes this coverage. I want to use the CRS to reproject the coverage, but I also need to use the CRS as-is so skipping the CRS creation step is no good.
Boiled down:
How do you go from a WSG84 polygon, dx, dy, nx, ny to a CoordinateReferenceSystem object that describes the grid using geotools?
Thanks in advance for the help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
那么你知道你的坐标适合的纬度矩形吗?听起来你可以进行仿射变换将坐标转换为纬度/经度;然后正常进行?
因此,首先处理您的几何图形以与您的矩形“对齐”;然后他们将进入 WGS84,您可以继续生活。
有关仿射变换的背景信息,请查看文档:
如果您的数据实际上是一个网格(如网格覆盖范围),您可以查看图像马赛克代码;它支持以各种方向记录网格并将它们拼接成无缝结果。
请注意,对于网格,该过程是相反的;而不是根据请求转换数据;请求被转换以与数据对齐(因此它可以从光栅图像中采样适当的值)。
So you know the latlon rectangle which your coordinates fit into? Sounds like you could make an affine transform to transform your coordinates into lat/lon; and then carry on normally?
So process your geometry to "line up" with your rectangle first; they will then be in WGS84 and you can get on with life.
For background on affine transform check the docs:
If your data is actually a grid (as in a grid coverage) you can look at the image moasic code; it supports recording grids in all manner of orientations and stitches them into a seamless result.
Please note that for grids the process is reversed; rather than transform the data based on the request; the request is transformed to line up with the data (so it can sample the appropriate values out of the raster image).
如果您的坐标是 WGS86,您应该使用 EPSG:4326 作为 CRS。然而,从声音来看,您的网格位于其他投影中,在这种情况下,您需要将边界矩形重新投影到该投影,然后在正确的投影中创建网格。
如果您不知道网格数据所在的投影,我怀疑您完蛋了。
If your coordinates are WGS86 you should use EPSG:4326 as the CRS. However from the sound of it your grid is in some other projection in which case you'll need to reproject the bounding rectangle to that projection and then create the grid in the correct projection.
If you don't know the projection that the grid data are in I suspect you are screwed.