arcpy

spatial join arcgis pro

痴心易碎 提交于 2020-03-28 06:40:44
问题 I got this shape files Highway1,Highway2,Highway3 etc... The attribute tables are the same, they contain info about latitude, longitude , direction, shape_length and speed_allowed. I want to make a script in python that would allow me to make a spatial join between every shape file that intersect other . For example if Highway1 intersect Highway2 , Highway12 and Highway22 i want 3 spatial join, every join should contain all the data from Highway 1 and where intersect the other highway, to

How to use arcpy module in Anaconda's install of Spyder?

北城以北 提交于 2020-01-15 12:14:07
问题 I recently installed Anaconda's Python distribution, which includes Spyder IDE. I am interested in importing the ArcGIS 10.3 arcpy module in Spyder. Unfortunately, running import arcpy results in the following error: import arcpy Traceback (most recent call last): File "<ipython-input-2-50d283eebbb3>", line 1, in <module> import arcpy File "C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy\arcpy\__init__.py", line 21, in <module> from arcpy.geoprocessing import gp File "C:\Program Files (x86)

Make a loop that will take the same name pairs from two folders?

纵然是瞬间 提交于 2020-01-06 04:51:12
问题 One main folder that has one folder named old and another called new The old has some folders. The new has a few of these folders with same names and nothing more. I want to delete the folders of the old that are not present in the new first and then: make a loop that will take each file -same name -pair, and put it in the the following line: arcpy.Append_management(["shpfromonefolder.shp", "shpfromsecondfolder.shp"],"NO_TEST") for example: land.shp from one folder with land.shp from the

Assign differing values to list generator results

社会主义新天地 提交于 2020-01-05 22:17:52
问题 I am using list generators as shown below. I would like to know how I can assign different text or values to the individual list generators. In the sample code, I can only assign values for all the list generators at once. For example, I would like to assign for v , row1[3]="value 1" , for k , row1[3]="value 2" and for m , row1[3]="value 3". How can I acheive that? v = (item for item in propadd if item[0]==row1[8] and harversine(custx,custy,item[2],item[3])<1500) k = (item for item in custadd

Assign differing values to list generator results

依然范特西╮ 提交于 2020-01-05 22:15:32
问题 I am using list generators as shown below. I would like to know how I can assign different text or values to the individual list generators. In the sample code, I can only assign values for all the list generators at once. For example, I would like to assign for v , row1[3]="value 1" , for k , row1[3]="value 2" and for m , row1[3]="value 3". How can I acheive that? v = (item for item in propadd if item[0]==row1[8] and harversine(custx,custy,item[2],item[3])<1500) k = (item for item in custadd

how to create datetime from a negative epoch in Python

孤街醉人 提交于 2019-12-30 17:58:30
问题 First timer on StackExchange. I am working with ArcGIS Server and Python. While trying to execute a query using the REST endpoint to a map service, I am getting the values for a field that is esriFieldTypeDate in negative epoch in the JSON response. The JSON response looks like this: { "feature" : { "attributes" : { "OBJECTID" : 11, "BASIN" : "North Atlantic", "TRACK_DATE" : -3739996800000, } , "geometry" : { "paths" : [ [ [-99.9999999999999, 30.0000000000001], [-100.1, 30.5000000000001] ] ]

how to create datetime from a negative epoch in Python

心不动则不痛 提交于 2019-12-30 17:58:10
问题 First timer on StackExchange. I am working with ArcGIS Server and Python. While trying to execute a query using the REST endpoint to a map service, I am getting the values for a field that is esriFieldTypeDate in negative epoch in the JSON response. The JSON response looks like this: { "feature" : { "attributes" : { "OBJECTID" : 11, "BASIN" : "North Atlantic", "TRACK_DATE" : -3739996800000, } , "geometry" : { "paths" : [ [ [-99.9999999999999, 30.0000000000001], [-100.1, 30.5000000000001] ] ]

How to run external executable using Python?

落花浮王杯 提交于 2019-12-30 03:48:08
问题 I have an external executable file which i am trying to run from a Python script. CMD executable runs but without generating output. Probably it exit before output can be generated. Any suggestion about how to delay exit until outputs are generated? import subprocess, sys from subprocess import Popen, PIPE exe_str = r"C:/Windows/System32/cmd C:/temp/calc.exe" parent = subprocess.Popen(exe_str, stderr=subprocess.PIPE) 回答1: use subprocess.call , more info here: import subprocess subprocess.call

wxPython and ARCGIS

微笑、不失礼 提交于 2019-12-25 00:06:58
问题 I am working on an Desktop application built with wx Python. I would like the application to visualize maps(shapefiles) like a GIS software and provide interactions with the map. I was looking through arcpy and arcgisscripting but I am not sure if it help me render the shapefile on the Panel. Please do let me know if it is possible? 回答1: There is an application created with wxPython for GIS here: http://thuban.intevation.org/ There's also one for GRASS: http://grass.osgeo.org/wiki/WxPython

installing pip on python 2.7.8 on windows

眉间皱痕 提交于 2019-12-23 19:16:56
问题 I am trying to install the module pip to python 2.7.8 the one that arcGIS installs for you. I am doing the bootstrap method of installing pip and I am running into an error when I run the get-pip.py with cmd. I get the following error: Warning (from warnings module): File "c:\users\vlaw\appdata\local\temp\tmpzamnrk\pip.zip\pip_vendor\requests\packages\urllib3\util\ssl_.py", line 122 InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL