是否有 SqlGeography 的 silverlight 替代品?

发布于 2024-09-24 09:45:57 字数 391 浏览 0 评论 0原文

我正在寻找可在 Silverlight 中工作的 Microsoft.SqlServer.Types.SqlGeography 的替代品。我主要对数据的任意集合(点、路径或多边形)以及 STBuffer、STUnion 和 STIntersect 功能感兴趣。

我需要通过中间层的 WCF 从数据库中检索一些地理数据,并将其返回到我的 silverlight 客户端,并让它操纵那里的地理空间数据。我错误地认为我可以使用 Microsoft.SqlServer.Types.SqlGeography 类型来执行此操作。不幸的是,它包含非托管代码,并且不会通过 WCF 进行序列化。

我希望有人以前已经做过这件事,而不仅仅是将纬度/经度编码为其他格式。问题是,当我将数据返回给客户端时,我需要对数据执行操作,并且不想处理执行此操作的算法。

I'm looking for a replacement for Microsoft.SqlServer.Types.SqlGeography that will work in Silverlight. I'm primarily interested in arbitrary collection of data (point, path, or polygon) and the STBuffer, STUnion and STIntersect functionality.

I need to retrieve some geography data from my database via WCF on the middle tier and return it to my silverlight client and let it manipulate the geospatial data there. I mistakenly believed that I would be able to do this with the Microsoft.SqlServer.Types.SqlGeography type. Unfortunately it contains unmanaged code and will not serialize over WCF.

I'm hoping that someone has done this before with more than simply encoding the lat/long into some other format. The thing is that I need to perform operations on the data when I return it to the client and don't want to deal with implementing the algorithms for doing this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

善良天后 2024-10-01 09:45:57

老实说,我不知道 SqlGeography 类型,但我最近创建了自己的纬度/经度类型(它们序列化为逗号分隔的字符串)。它相当简单,相关算法也很简单(至少是我需要的)。

您拥有的优势之一是完全控制序列化,您可以执行诸如修剪“未使用”小数之类的操作,以减少 Web 服务负载。

Honestly I did not know about SqlGeography types, but I recently created my own lat/lon types (they serialize as comma-separated string). It's rather easy and so are the related algorithms (at least what I needed).

One advantage you have is the full control over serialization where you can do things like trimming "unused" decimals in order to reduce the web service payload.

踏雪无痕 2024-10-01 09:45:57

最后,我最终实现了尽可能严格的功能集。

In the end, I ended up implementing the strictest set of functionality that I possibly could.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文