Oracle 输出:游标、文件还是很长的字符串?

发布于 2024-08-29 13:13:29 字数 695 浏览 2 评论 0原文

首先,设置:我在 Oracle10g 数据库中有一个包含空间列的表。我需要能够传递空间参考,以便可以将几何图形重新投影到任意坐标系中。最终,我需要将此投影的结果压缩为 zip 文件,并使其可供通过 Silverlight 项目下载。

我真的很感激有关实现这一目标的最佳方法的想法。在下面的示例中,SRID 是用于将几何点转换为新坐标系的空间参考 ID 整数。

特别是,我可以看到几种可能性。还有更多,但这是我的想法:

a) 将 SRID 传递到动态视图 -->进行投影,输出光标 -->将光标发送到 UTL_COMPRESS -->将输出写入文件(以某种方式)-->将 URL 发送到 Silverlight 应用程序

b) 使用 SRID 从 Silverlight 应用程序调用 Oracle 函数 -->进行投影,输出字符串 -->将字符串构建到文件中 -->使用 .NET 中的 SharpZipLib 库压缩文件 -->将字节流发送回Silverlight应用程序

我已经完成了b)的前两个步骤,100个点的转换大约需要7秒,这是令人无法接受的慢。我希望完全在 Oracle 中进行处理会更快。

如果任何人都可以看到这两种方法的潜在问题,或者可以提出更好的方法,那将非常有帮助。

谢谢!

预计到达时间:我想在发布之前给这篇文章起一个更好的标题。对不起。

First, the setup: I have a table in an Oracle10g database with spatial columns. I need to be able to pass in a spatial reference so that I can reproject the geometry into an arbitrary coordinate system. Ultimately, I need to compress the results of this projection to a zip file and make it available for download through a Silverlight project.

I would really appreciate ideas as to the best way to accomplish this. In the examples below, the SRID is the Spatial reference ID integer used to convert the geometric points into a new coordinate system.

In particular, I can see a couple of possibilities. There are many more, but this is an idea of how I'm thinking:

a) Pass SRID to a dynamic view --> perform projection, output a cursor --> send cursor to UTL_COMPRESS --> write output to a file (somehow) --> send URL to Silverlight app

b) Use SRID to call Oracle function from Silverlight app --> perform projection, output a string --> build strings into a file --> compress file using SharpZipLib library in .NET --> send bytestream back to Silverlight app

I've done the first two steps of b), and the conversion of 100 points took about 7 seconds, which is unacceptably slow. I'm hoping it would be faster doing the processing totally in Oracle.

If anyone can see potential problems with either way of doing this, or can suggest a better way, it would be very helpful.

Thanks!

ETA: I meant to give this a better title before I posted. Sorry.

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

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

发布评论

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

评论(1

清风挽心 2024-09-05 13:13:29

只是清理未回答的问题。这个问题提到了我需要制作的一个系统,Silverlight 应用程序的用户可以选择一组点(其中数千个)并将这些点导出重新投影到状态平面坐标中。问题在于,数千个积分的转换速度太慢,无法在用户等待时进行。因此我执行了以下操作:

将 SRID 从 Silverlight 应用程序传递到 Oracle 并创建转换请求。我有一项单独的工作轮询请求表。当它找到一个时,它会转换请求中选择的所有点并将它们写入文件。文件完成后,服务会向请求中的地址发送一封电子邮件,其中包含下载文件所需的 URL。

Just cleaning up unanswered questions. This question referred to a system I needed to make where the user of the Silverlight app could select a set of points (several thousand of them) and export those points re-projected into state plane coordinates. The problem was that the conversion of thousands of points was too slow to have happen while the user waited. so I did the following:

I pass the SRID from my Silverlight app to Oracle and create a conversion request. I have a separate job polling the requests table. When it finds one, it converts all the points selected in the request and writes them to a file. When the file is complete, a service sends an email to the address in the request with the URL needed to download the file.

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