你好我在R中使用igraph库有一个网络
Vertices: 616
Edges: 6270
Directed: TRUE
No graph attributes.
Vertex attributes: name, Lat, Lon.
Edge attributes: V3.
Run Code Online (Sandbox Code Playgroud)
如何使用顶点中的Lat,Lon信息为顶点和边创建两个shapefile?
我正在编写一个 python 代码来读取多边形形状文件中的点并将它们保存在一个点形状文件中。所以首先我制作了一个文本文件并将点的 (x,y) 存储在该 .txt 文件中。然后我试图从文本文件中制作一个点形状文件,但它给出了一个错误。
这是代码(只是最后一部分):
creat point shape-file from text file
import fileinput
import string
import os
env.overwriteOutput=True
outpath="C:/roadpl"
newfc="newpoint.shp"
arcpy.CreateFeatureclass_management(outpath, newfc, "Point")
infile="C:/roadpl/roadL5.txt"
cursor=arcpy.da.InsertCursor(newfc, ["SHAPE@"])
array=arcpy.Array()
for line in fileinput.input(infile):
X, Y=string.split(line, " ")
array.add(arcpy.Point(X,Y))
cursor.insertRow([arcpy.Point(array)])
fileinput.close()
del cursor
Run Code Online (Sandbox Code Playgroud)
这是错误:
Traceback (most recent call last):
File "C:\Lab5\P_Code_L5", line 49, in <module>
point.X, point.Y = line.split()
File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\arcobjects\_base.py", line 87, in _set
return setattr(self._arc_object, attr_name, cval(val))
RuntimeError: …Run Code Online (Sandbox Code Playgroud) 在设备中运行应用程序时出错:
java.lang.UnsatisfiedLinkError: Native method not found: com.esri.core.runtime.LicenseImpl.nativeIsClientIdValid:(Ljava/lang/String;)Z
at com.esri.core.runtime.LicenseImpl.nativeIsClientIdValid(Native Method)
at com.esri.core.runtime.LicenseImpl.a(Unknown Source)
at com.esri.android.a.b.b(Unknown Source)
Run Code Online (Sandbox Code Playgroud)
相关代码:
import com.esri.android.runtime.ArcGISRuntime;
public class MainActivity extends FragmentActivity implements NavigationDrawerFragment.NavigationDrawerCallbacks {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ArcGISRuntime.setClientId("xxxxxxxxxxxxxxxx");
......
Run Code Online (Sandbox Code Playgroud)
的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "xxx.xxxx.xxxxx"
minSdkVersion 17
targetSdkVersion 19
versionCode 1
versionName "1.0"
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
buildTypes {
release {
minifyEnabled …Run Code Online (Sandbox Code Playgroud) 我正在开发层,需要使用ArcGIS将dwg的格式更改为GeoJSON.我怎样才能做到这一点?
我正在尝试使用Esri地图.要在我的项目中包含地图,我发现这是:
require([
"esri/map",
"esri/dijit/Search",
"esri/dijit/LocateButton",
"esri/geometry/Point",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
Run Code Online (Sandbox Code Playgroud)
但是没有任何esri文件夹或npm包.因此,我在这里很困惑.如何在项目中导入esri?
我有两组带有多边形的 shapefile。一组 shapefile 只是我感兴趣的美国县,这因公司和年份而异。另一组 shapefile 是公司的业务领域,当然这因公司和年份而异。我需要每年为每个公司获得这两层的交集。到目前为止,函数 overlay(df1, df2, how = 'intersection') 实现了我的目标。但每个公司年需要大约 300 秒。鉴于我有很长的公司名单和很多年,这需要我几天才能完成。有什么办法可以提高这种性能吗?
我注意到,如果我在 ArcGIS 中做同样的事情,300 秒就会缩短到几秒钟。但是我是ArcGIS的新用户,还不熟悉里面的python。
我在将纬度和经度值转换为android esri arcGIS map Point时遇到了麻烦.这是我从GPS坐标获取纬度和经度值的代码:
LocationManager lm;
String towers;
double lat;
double longi;
TextView txt;
lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Criteria crit = new Criteria();
towers = lm.getBestProvider(crit, false);
Location location = lm.getLastKnownLocation(towers);
if(location != null)
{
lat = location.getLatitude();
longi = location.getLongitude();
}
Run Code Online (Sandbox Code Playgroud)
现在我有纬度和经度值.现在我需要的是将这些值转换为有效的esri arcGIS MapPoint.谁能帮我?
提前致谢.
我正在弄清楚如何在shape和多边形之间进行交点(空间连接).我的想法是获得最接近的点和那些在多边形内完全匹配的点.在ARGIS中,有一个名为CLOSEST的匹配选项函数,它们定义为:"最接近目标要素的连接要素中的要素是匹配的.两个或更多连接要素可能与目标的距离相同当出现这种情况时,随机选择一个连接特征作为匹配特征."
我有一个函数将点交叉成多边形,它是由Lyndon Estes在r-sig-geo列表中提供的,当所有多边形填满所有区域时代码工作得非常好.第二种情况称为空间连接距离,当match_option为CLOSEST时,在ArcGIS中称为INTERSECT,如ArcGIS所做的那样.因此,当区域未被所有多边形填充时,您可以修改点与多边形之间的最小距离.
这是第一个INTERSECT的数据和功能:
library(rgeos)
library(sp)
library(maptools)
library(rgdal)
library(sp)
xy.map <- readShapeSpatial("http://www.udec.cl/~jbustosm/points.shp")
manzana.map <- readShapeSpatial("http://www.udec.cl/~jbustosm/manzanas_from.shp" )
IntersectPtWithPoly <- function(x, y) {
# Extracts values from a SpatialPolygonDataFrame with SpatialPointsDataFrame, and appends table (similar to
# ArcGIS intersect)
# Args:
# x: SpatialPoints*Frame
# y: SpatialPolygonsDataFrame
# Returns:
# SpatialPointsDataFrame with appended table of polygon attributes
# Set up overlay with new column of join IDs in x
z <- overlay(y, x)
# Bind captured data to points dataframe
x2 <- …Run Code Online (Sandbox Code Playgroud) 我在C#中添加了arcmap的应用程序,我尝试连接我的文件地理数据库.所以当我试图运行它时,我收到了这个错误:
Error 1 Interop type 'ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactoryClass' cannot be embedded. Use the applicable interface instead.
Run Code Online (Sandbox Code Playgroud)
然后是添加的路径
我之前从未见过这个错误,我想知道出了什么问题.
这是它的主要代码:
public IWorkspace FileGdbWorkspaceFromPropertySet(string database)
{
IPropertySet propertySet = new PropertySetClass();
propertySet.SetProperty("DATABASE", database);
IWorkspaceFactory workspaceFactory = new FileGDBWorkspaceFactoryClass();
return workspaceFactory.Open(propertySet, 0);
}
Run Code Online (Sandbox Code Playgroud)
所以错误在这一行:
IWorkspaceFactory workspaceFactory = new FileGDBWorkspaceFactoryClass();
Run Code Online (Sandbox Code Playgroud)
我希望有人可以向我提供这个错误的解释,也可以解决我的问题.
出了什么问题?
我有这个简单的代码笔与Angular 4和arcgis地图,但我无法在IE 11中拖动.其他浏览器像往常一样工作.我无法升级或降级arcgis的JS库,因为它依赖于我们正在使用的其他小部件.
https://codepen.io/rbuenon/pen/NXNOww
<link rel="stylesheet" href="https://js.arcgis.com/3.23/esri/css/esri.css">
<script src="https://js.arcgis.com/3.23/"></script>
<script>
require(["esri/map", "dojo/domReady!"], function (Map) {
window.map = new Map("map", {
center: [-118, 34.5],
zoom: 8,
basemap: "topo"
});
});
</script>
<div id="map"></div>
<app-root></app-root>
Run Code Online (Sandbox Code Playgroud)
更新:
polyfill.ts
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'zone.js/dist/zone';
import 'classlist.js';
import 'web-animations-js';
import 'intl';
import 'intl/locale-data/jsonp/en';
Run Code Online (Sandbox Code Playgroud)
有谁知道我该如何解决这个问题?