问题标签 [sharpmap]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
95 浏览

c# - 如何在地图上重叠 .NET UI 控件

我想在同一个图层上设置多个符号,但据我所知,SharpMap (v4.0)不支持这一点。所以我决定设置一个由 Points 填充的孤独层,并在每个点上“粘贴” dotNet UserInterfaces

每个交互式 UI 都有自己的内部声明对象,该对象将调节其属性,例如显示的图像、是否可见等...

那么,如何将这些 UI 位置链接到它们对应的图层点?我一直在尝试方法“ MapControl .PointToScreen()”,但什么也没做,需要这样的东西:

myUI.Location = myPoint.Coordinate;

简单的例子或问题的其他观点将非常棒并且非常受欢迎。谢谢!!!

0 投票
1 回答
2386 浏览

c# - 将 EPSG:4326 投影转换为 EPSG:3857 墨卡托

我正在使用 sharpmap 将 MSSQL 中的边框(几何)渲染为 PNG 图像。这一切都很好,除了国家在平面图像格式上看起来太“宽泛”。

据我了解,我需要创建到 EPSG:3857 投影的转换,但我不知道该怎么做。

这是我的代码

WKT 可以在这里找到https://pastebin.com/PEbpAdxT

任何帮助表示赞赏。

编辑:这是我现在为法国获得的图像,它是“豪华轿车”地区。如您所见,它太“宽”了。 在此处输入图像描述

这是我应用转换时的图像,可以在代码注释下找到does not work with this 在此处输入图像描述

编辑 2

我也尝试过以下转换,但这会呈现空白 png(没有红十字)

0 投票
1 回答
582 浏览

gis - Xamarin Mapsui - 如何让地图在世界末日翻滚?

我需要展示一张可以永远水平平移的地图。

我是否可以设置它,以便 TileLayer 滚动显示世界的另一端,平移到地图的尽头?

0 投票
1 回答
546 浏览

c# - 如何使用sharpmap在地球上渲染一个国家的图像

我在 SQL 数据库中有一个区域边界列表,我正在使用 sharpmap 为我需要的每个国家/地区呈现缩略图。它真的很好用。

但我想更进一步,在它周围添加一个小地球,并将国家定位在它在地球上的位置,但我不知道从哪里开始。

这是我目前用来渲染国家拇指的代码。有任何想法吗?

0 投票
1 回答
297 浏览

sharpmap - 将 Sharp Map 地图导出到 Shape 文件 (.shp)

说明: 我从 PostGreSQL 读取数据并使用 SharpMap 库将其显示在 SharpMap 上。

我想要什么我想将 SharpMap 地图导出到 ShapeFile (.shp)。我怎样才能做到这一点?

0 投票
1 回答
101 浏览

geojson - 形状未绘制在生成的地图图像上

我正在尝试从附加的 JSON 创建地图图像,图像显示正确的位置但不绘制多边形。

这仅在一个特征具有圆形形状的情况下发生,而对于其他形状,它们被渲染得很好。

以下函数用于从 json 创建图像。

我正在使用以下 Geojson 文件来渲染形状

0 投票
3 回答
2083 浏览

c# - 如何将存储在 SQLite 数据库中的 BLOB 数据转换为 SharpMap.Geometry.Geometry

我将几何数据存储在 SQLite 数据库中,列的数据类型是 BLOB。

我使用以下方法将 BLOB 数据转换为清晰的地图几何图形

SharpMap.Converters.WellKnownBinary.GeometryFromWKB.Parse(<字节数组>);

但它抛出异常“字节顺序无法识别

但是,如果我使用 sql server management studio 数据库并使用 Image 数据类型将几何数据保存在表中,那么我得到的几何图形没有任何错误。

唯一的区别是数据类型,在 SQLite 中我使用了数据类型“BLOB”,而在 sql server 中我使用了数据类型“Image”。

我还注意到字节数组大小的另一个差异,如果我使用 SQLite 数据库,那么我得到的字节数组大小为“3812”,如果我使用 sql server 数据库,那么我得到的字节数组大小为“1902”。

有人知道解决方案吗?

我正在处理以下数据:

0x01030000000100000076000000908FC85763BD2D41B5E1CEFAB9385841A8564425CABB2D412642A24FB83858411BFBC2F5D3BA2D4184A995ABBF385841CAD4637804BA2D415C8C795FA4385841F114538DDDB92D41F55448C2AC385841C64F734F30B92D41B249DC25CD385841A3CB7AAD4DB12D4199B5872A3B3858416D582E7839B02D41A9556428F637584143144991BBB02D416A06CFA4D53758417B22EADD21B12D41655331199F375841452E9D966AB12D4166ED16B88B3758419BB6676466B02D413D6180586D375841E89DECDF98B02D4191927111613758411C78DF662DB22D4170EA69F128375841D9D525280FB22D41A078FBDB103758415C485630A6B12D41F3EB2128EC3658419D97CCE77BB22D41C592B7E1CF365841831F9ECFB8B32D41589F8359E8365841A4599CA91AB42D4183458EF6F7365841BD50CAAF3AB42D41D8584F2DF836584115C52BF88AB42D41CB916AC0DF365841C9C54DE07BB32D41EE6958C1BF365841DE5A1651E3B22D415B4704FDA6365841D73CCC798FB22D41CB9E9E17963658415663F51F78B22D41E3403AA988365841B4235ECA76B22D41F0CA34EE7A36584188D446ECB9B32D41FB8ED8B5093658412812E3D8E8B32D41616C0DA2CC3558419DF34042BDB32D41EE235FC17B355841A36F009898B22D41054448484C355841E21AEBA9AFB42D41946B3A2761355841C463E28F4FB52D413FF3CA035F355841461A2E564BB52D4113CAB89257355841D2226CFEF8B62D41B71CC9EC153558419073855FC9B72D410A4B9247E1345841508668C7C4BC2D41E0B9D62FD7345841661D26E68ABE2D410E80C7D7AF34584149753FDA9AC02D418BDAADF075345841B50A90264DC32D41871EDC1F7D345841E0F2F43CA2C62D4107B6748781345841870AC042C0C62D41F61C18959D345841B238413BC0C72D4124BD21B4DC34584180D416141CC82D41E44457B4E934584175CA2F0700C92D4149867508343558414835F68B24CF2D418F8AD232F3345841D200559B07D02D414E65E5D5E1345841065A4DCB6CD02D4185CE4559E2345841254C3A15C5D02D415D1D78A14935584166C96D57F5D02D41C414E543623558415D6312F097D02D41C605342D94355841E65A332103D12D412A5960ABBA3558411194E61042D12D41F97012B6EC35584116DEF2091ED12D4186D8858FF03558412248444320D12D41EFAF11A6FD355841CB79634EEDD12D414275A2982D3658418C67CC2FE2D12D419E5D943153365841A93F65748BD12D418D280AC6643658419D1B2A62C0D12D41B19988E397365841934A32D73DD12D41BA8CCD9FAA365841646BF8D86DD22D414ED7D61EE136584146B4EFBE0DD32D417A3B6E9BE03658419F2A4C7030D32D41FCBCC386E53658413BB53AA930D32D4164780A6D1337584191D463BCD9D12D41B116E437083758419B2461F02CD12D415D301E26073758412FE24D704FD02D41DF24A4CB0C3758416BACD3FE50D02D411FFCC625173758413730503BD0CF2D41AAE124111C3758413061531920CF2D41A0D6E5442A3758411A6E1BE5A4CE2D414619DF4C3837584115D1D11FF4CC2D412A2B02E47B375841B0897DE34ECC2D41F7A6AFD36F3758418831353299CB2D4110590A15B03758414401543C3ACB2D4191DD8968C137584146EBF50830CA2D4158913B28D63758414ED056195EC92D4133420C50EF375841CF6C4EDAAAC82D41A57F0D5BF73758419E80ED363DC82D4120E370DA00385841A0D330BE85C72D4176B51AAC163858418132924D17C42D41ED5B97AB51385841DB1AC747F9C32D4163E87BEE4638584157EEAC6699C42D41C9D1BC2B30385841040137B0EFC42D4119CE642E2A3858417020BF9CB1C52D41BC74946A263858416A3227FE16C72D41489711A10E385841C9151581BDC92D414F1C52F8D637584124EAE0F5F3CA2D413D750DBCB237584147D5911AB2CB2D41B9E3E10F743758417635C66FB1CB2D4140FA886365375841632C30082CCA2D41CE0050B46437584105493CCA11CA2D413CB74FA156375841FE65D622B6CA2D414A1C58C131375841C950F9B0B5CA2D41B4443CB92B375841AD2913B768CB2D414719112023375841A9A4228E94CA2D4133F15AA90F375841AEE3024BA5C82D41EC089804EA365841F76822311FC82D41CC821BEE01375841DE1EB75E2AC62D418150AD64E0365841C039F774E3C42D41551E26A4CE3658414520FB2E0CC42D415933F721D336584151443641D7C32D41FE09F7AA0437584112C708BA1AC12D41F123AB9F14375841E933DCD86CBF2D412A142AE92A375841A3BBE95204BF2D41538E58422037584179B2EE56F2BD2D416FA23E89EF365841F8B58C69BFBD2D41387D57ABF4365841EABF0EE24EBD2D41C63A39B302375841E83C19224DBC2D410263BB2A333758411530B6EA54BC2D41C672B000853758413E00C81F41BC2D4171582088943758416914F51292BC2D41B3EC88989837584110B8EC661EBD2D41582E965DC13758416CE832F109BD2D41A36943A90C3858419923E1491BBD2D41161BD1B918385841E17A43A53ABD2D4126D39FFB2038584123EF3F59FEBD2D41EC01CAEC313858419D044C88A4BC2D410422669584385841908FC85763BD2D41B5E1CEFAB938584100000000

0 投票
1 回答
751 浏览

c# - SharpMap WMTS / TMS 服务器实现

谁能帮我在 SharpMap 中实施 WMTS / TMS 服务器?

我一直在尝试从差异来源进行很多尝试,但我似乎无法提出一个可行的解决方案。下面是我正在使用的处理程序,它只是绘制框而不是数据库中的数据。我正在使用与 WMS 服务器相同的方法:

从 SQL Server 获取数据,它对 WMS 工作得很好。唯一的区别是下面的那个通过使用.FindAll(lyr => lyr.Table.Equals(layer))查询返回一个特定的层而不是一个列表。

如果我只是提出创建代码可能会有所帮助SharpMap.Map

0 投票
1 回答
80 浏览

c# - .Net 3.5 VS 2008 无效令牌“出”错误

我正在尝试为 .Net 3.5 编译SharpMap,我已经对大部分错误进行了排序,目前我得到的唯一错误是:

类、结构或接口成员声明中的标记“out”无效

类、结构或接口成员声明中的标记“>”无效

预期类型

错误位于此文件的开头(第 36 行) 。这是代码(第一行有错误)。

此外,我无法找出TOid是什么以及它来自哪个库。我正在使用 VS 2008 .Net 3.5,由于我正在处理的项目的具体情况,我无法升级。

0 投票
1 回答
1570 浏览

c# - How to use 'SharpMap' WPF Control

I want to use SharpMap in a WPF application, however, I can’t figure out how to use this control. This is what I have tried so far, and the dead-ends I have faced.

Using the WPFExample available on Github: SharpMap on GitHub.

First I tried opening the SharpMap.Sln in VS Community 2017. I am unable to build the application due to the shear number of errors. See screenshot below. I have tried reinstalling all the nuget packages with no change, clean, built etc with no joy. Too many errors to list that mainly revolve around missing namespaces etc.

I then tried opening just the WPFSamples project, again, reinstalling the Nuget packages, and finally adding any other projects that were referenced, however this just made the error list even longer.

I then tried starting a new WPF Application and adding the following Nuget packages:

  1. SharpMaps

  2. SharpMaps.UI

And then manually adding the SharpMaps.UI.Wpf.dll from the samples debug folder on GitHub. The XAML I used is below. There is no code behind. The solution will build with no errors, however, when I try to run it it gives the following error:

System.Windows.Markup.XamlParseException: ''The invocation of the constructor on type 'SharpMap.UI.WPF.SharpMapHost' that matches the specified binding constraints threw an exception.' Line number '30' and line position '10'.' TypeLoadException: Could not load type 'SharpMap.Layers.ILayer' from assembly 'SharpMap, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

So my questions are:

1. What step(s) am I missing that prevents the sample WPF SharpMap project in GitHub from working (I get no errors when I open VS)? Now Solved. Despite using VS2017, it only had .NET 4.6.1 installed, adding .NET 4.7.2 solved the issue. There were no warnings that it was pointing to the wrong framework version so resolving this was just luck.

  1. What am I missing in my code below to get the barebones SharpMap working? Unfortunately, the documentation lacks any WPF support and I can’t find any other examples, so from here on it will be trial and error.

XAML:

Just for completeness, the code behind (no changes really)

EDIT:

I've also tried using MapSui which uses SharpMap and supports WPF however I'm still finding that I can't run the examples on GitHub, nor is the documentation available to build a bare bones example.

EDIT 2:

Ok, so I simply can't get SharpMap to work in my WPF application. Since updating my .NET framework, I have revisited MapSui and founf the examples worked as expected. I then applied MapSui to my project using this simple guide: MapSui Startup Guide and it just worked perfectly. I still think my question deserves an answer for others who want to use WPF and SHarpMap, however, I will continue using MapSui.