如何将IFeatureClass对象序列化为XML?
在其他ArcObjects上使用IXMLSerializer有一些资源,但这对IFeatureClass不起作用,因为它没有实现ISerializable.
无法将Ilayer转换为IPolygon.
我正在为ArcMap开发一个工具栏,我通过侧面目录中的代码获取一个图层.图层是多边形,但代码不会将其转换为IPolygon.
谁能帮我吗?这是我用来尝试将其转换为IPolygon的代码...
IPolygon poly = m_document.Maps.get_Item(0).get_Layer(0) as IPolygon;
Run Code Online (Sandbox Code Playgroud)
我可以做这个:
ILayer layer = m_document.Maps.get_Item(0).get_Layer(0) as ILayer;
Run Code Online (Sandbox Code Playgroud)
这是有效的,只是不将它转换为IPloygon ..
我有数据要创建一个GIS类型的应用程序,它具有添加和删除不同类型的图层的典型功能.什么是最好的架构方法?
数据包括Eastings和Northings的房产位置.我还有GML和Shapefiles中的军械调查数据.
我知道这是一个非常广泛的问题,但主题领域对我来说似乎也很广泛,我不确定要走哪条路.
我正在考虑使用SQL 2008空间和Bing Silverlight控件来可视化地图.要做到这一点,我必须将东向和北向转换为GWS84地理数据类型吗?但是如果我将shapefile转换为GML并使用GeomFromGML将所有GML文件导入sql,则它们将采用几何数据类型.这两种类型不兼容吗?
此外,ESRI ArcGIS API for Silverlight应该在等式中吗?这是一个创建地图的好环境,我可以将其指向SQL sqerver 2008作为数据源(如果需要,使用WCF服务)?
任何建议非常感谢!
我正在用C#编写一个GIS应用程序.应用程序的一部分允许用户选择KML文件,然后程序将处理该文件.我正在使用OpenFileDialog,但问题是所有代码都在对话框关闭之前执行(并且在用户确定文件之后).这需要一段时间,因为该程序必须缩放和做其他事情.有没有办法在我的代码执行之前以编程方式关闭对话框?
编辑:一些代码为那些问.
private void OnKMLFileSet(object sender, CancelEventArgs e)
{
Polygon polygon = KmlToPolygon(openFileDialog2.FileName);
// After this, I no longer need the file, but the dialog stays open until the end of the method
Graphic graphic = new Graphic();
graphic.Geometry = polygon;
textBox1.Text = string.Format("{0:n}", CalculateAreaInSqKilometers(polygon)).Split('.')[0];
textBox2.Text = string.Format("{0:n}", CalculateAreaInSqMiles(polygon)).Split('.')[0];
textBox3.Text = string.Format("{0:n}", CalculateAreaInSqKnots(polygon)).Split('.')[0];
Note polyInfo = new Note("Polygon with nautical area: " + textBox3.Text, polygon);
map.Map.ChildItems.Add(polyInfo);
map.ZoomTo(polygon.GetEnvelope());
}
Run Code Online (Sandbox Code Playgroud) 我试图转换为C#的Vba代码.我变得非常接近,但我可以弄清楚为什么我一直收到这个错误.错误无法将方法组"NextFeature"转换为非委托类型"ESRI.ArcGIS.Carto.IFeatureSelection".你打算调用这个方法吗?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.ArcMapUI;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geodatabase;
namespace ArcMapAddin1
{
public partial class frmParcelReader : Form
{
public frmParcelReader()
{
InitializeComponent();
}
public void ReadData()
{
//IMxDocument pMxDoc = default(IMxDocument);
IMxDocument pMxDoc = ArcMapAddin1.ArcMap.Document;
//IMap pMap = default(IMap);
IMap pMap = pMxDoc.FocusMap;
//IFeatureSelection pFLayer = default(IFeatureSelection);
IFeatureLayer pLayer = pMap.get_Layer(0) as IFeatureLayer;
IFeatureSelection pFLayer = pLayer as IFeatureSelection;
string stopHere2 = "";
for (int …Run Code Online (Sandbox Code Playgroud) 我正在开发一个应用程序,它将从各种源检索数据并从数据构造ESRI GraphicsLayer对象并将其显示在地图上.我之前创建过自定义FeatureLayers,但是这个项目需要使用GraphicsLayers,因为我需要能够切换图层的可见性.下面的代码从主机获取数据并将其放入GraphicsLayer.
define(["dojo/_base/declare", "dojo/_base/array", "dojo/request", "esri/graphic", "esri/geometry/Geometry", "esri/InfoTemplate"],
function(declare, array, request, Graphic, Geometry, InfoTemplate) {
return declare(null, {
getAllCurrentReadings: function() {
var rtn = [];
var stations = ["S", "SN", "AN", "UP", "GR", "PL", "SR", "J", "N", "FL"];
array.forEach(stations, function(item, i) {
request.post("includes/buoybay_proxy.php", {
data: {
"method": "RetrieveCurrentReadings",
"params": "CBIBS," + item + ",113f8b...f27e0a0bb" // NOTE: id: 1 is necessary as well but is added manually by jsonRPCClient
},
sync: true,
handleAs: "json"
}).then(
function(response) {
var gfx, attr, t; …Run Code Online (Sandbox Code Playgroud) 我是ESRI的JavaSCript API的新手,它的易用性和速度给我留下了深刻的印象.作为交互式数据门户的一部分,我让用户输入经度和经度作为十进制度作为空间查询的一部分来返回州,县和FIP.这部分工作得很好,但作为一个附加功能,我想在现有地图上绘制一个点图形,显示输入的坐标位置(DONE),然后以一定的合理比例将中心和缩放到所述点.
centerAndZoom方法是这里的逻辑选择,但它似乎不起作用.我的感觉是地图需要刷新,但我似乎无法想出这个.
我敢肯定我在这里缺少一些基本的东西; 在此先感谢您的时间!
function DrawPointAndZoom() {
// Get currently entered lat/long.
var lat = $('#SiteLatitude').attr('value');
var long = $('#SiteLongitude').attr('value');
var latLongPoint = new esri.geometry.Point(long, lat, new esri.SpatialReference({ wkid: 4326 }));
//Draw point
var symbol = new esri.symbol.SimpleMarkerSymbol().setSize(8).setColor(new dojo.Color([255, 0, 0]));
var graphic = new esri.Graphic(latLongPoint, symbol);
var infoTemplate1 = new esri.InfoTemplate();
infoTemplate1.setTitle("point1");
infoTemplate1.setContent("test point 1");
graphic.setInfoTemplate(infoTemplate1);
map.graphics.add(graphic);
map.centerAndZoom(latLongPoint, 15);
}
Run Code Online (Sandbox Code Playgroud) 使用R和两个形状文件:tl_2015_01_prisecroads(alabama)和tl_2015_13_prisecroads georgia),使用readOGR()读取两个R对象.我需要关注一个包括西乔治亚州和东阿拉巴马州的地区.我试过rbind()和spRbind()无济于事.
ga_al <- rbind(alabama, georgia, fix.duplicated.IDs=TRUE)
Error in as(x, "SpatialLines") :
no method or default for coercing “logical” to “SpatialLines”
ga_al <- spRbind(alabama, georgia)
Error in spRbind(as(obj, "SpatialLines"), as(x, "SpatialLines")) :
non-unique line IDs
Run Code Online (Sandbox Code Playgroud)
问题1:如何组合两个形状文件来映射两个状态的区域?问题2:如何放大组合形状文件的较小区域?
我是GIS和ASP.NET世界的新手,我正在尝试运行本教程:http://help.arcgis.com/en/sdk/10.0/serveradf_net/conceptualhelp/index.html#//000200000025000000
我没有遇到以下错误:
Could not load 'ESRI.ArcGIS.3DAnalyst, Version=10.0.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86' assembly or one of its dependencies. File not found.
Error in the source code:
Line 37: <add assembly="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
Line38: <add assembly="AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28F01B0E84B6D53E"/>
Line 39: <add assembly="ESRI.ArcGIS.3DAnalyst, Version=10.0.0.0, Culture=neutral, PublicKeyToken=8FC3CC631E44AD86"/>
Line40: <add assembly="ESRI.ArcGIS.3DAnalystUI, Version=10.0.0.0, Culture=neutral, PublicKeyToken=8FC3CC631E44AD86"/>
Line41: <add assembly="ESRI.ArcGIS.ADF, Version=10.0.0.0, Culture=neutral, PublicKeyToken=8FC3CC631E44AD86"/>
Run Code Online (Sandbox Code Playgroud)
我无法加载任何ESRI程序集.
我需要的组件位于
C:\Program Files (x86)\ArcGIS\DeveloperKit10.0\DotNet
Run Code Online (Sandbox Code Playgroud)
我尝试在GAC缓存中添加程序集并将此路径添加到.NET Framework\AssemblyFolders注册表项但没有任何效果.我还尝试更改应用程序池的用户身份.
有关如何解决的任何想法吗?
我有一个mapbox,想要在其上显示一层esri数据.我正在从这个json文件中获取数据:
数据['results'] [0] ['value'] ['features']数组看起来像这样:
[{'attributes':{'key':'value'}},{'geometry':{'paths':[[ - 13273770,4064608],[ - 13273762,4064613],....]}}, {'attributes':{'key':'value'}},{'geometry':{'paths':[[ - 13273770,4064608],[ - 13273762,4064613],....]}},{ 'attributes':{'key':'value'}},{'geometry':{'paths':[[ - 13273770,4064608],[ - 13273762,4064613],....]}}}]
我的问题是关于几何数组.那里的数据没有Lat/Lng值(我希望这样),所以我不知道如何将这些添加到我的地图中.我是GIS的新手,到目前为止我所做的研究都指向了SpatialReferences.任何帮助显然非常感谢!
所以我正在阅读一些代码,我发现了这个陈述.在这种情况下,"x"是用户输入,所以我认为它是某种形式的验证,但它做了什么?x ==不是x没有任何意义,"#"是什么意思?
这是令人讨厌的代码块:
def main(*argv):
try:
#Get FC and Fields
inputFC = arcpy.GetParameterAsText(0)
if inputFC =="#" or not inputFC:
inputFC = "Tooldata\\InputFC" # provide a default value if unspecified
Run Code Online (Sandbox Code Playgroud) 目前我有这张leaflet.js地图
<div id="myMap" style="width: 100%; height:300px;"></div>
<script>
// This setup the leafmap object by linking the map() method to the map id (in <div> html element)
var map = L.map('myMap', {
center: [14.599512, 120.984222],
zoom: 13,
// minZoom: 1.5,
// maxZoom: 1.5
});
// Start adding controls as follow... L.controlName().addTo(map);
// Control 1: This add the OpenStreetMap background tile
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// Control 2: This add a scale to the map
L.control.scale().addTo(map); …Run Code Online (Sandbox Code Playgroud)