[INDENT]You must first load the �??os�?? Python library (using: �??import os�??) at the beginning of your Python session. To call GME from the command line you use the following generic syntax: os.system(�?�path\\SEGME.exe commands�?�)[/INDENT]
snappoints(in, snap, out, tol, [where]);in --> the input point data source snap--> the input feature source to which points are snapped out--> the output point data source tol--> the maximum snap distance in coordinate system units [where] the selection statement that will be applied to the point feature data source to identify a subset of points to process (see full Help documentation for further details)Example 1: snappoints(in="C:\data\locs.shp", snap="C:\data\roads.shp", out="C:\data\snappedlocs.shp", tol=5000);
# --------------------------------------------------------------------------- # gis_Test1.py # Description: Snap Point to Feature (Spatial Ecology) # --------------------------------------------------------------------------- import os import arcpy #Read Parameters #1 inpoint --> the input point data source #2 snap --> the input feature source to which points are snapped #3 outpoint --> the output point data source #4 tol --> tbe maximum snap distance in coordinate system units inpoint = arcpy.GetParameterAsText(0) snap = arcpy.GetParameterAsText(1) outpoint = arcpy.GetParameterAsText(2) os.system("C:\\Program Files (x86)\\SpatialEcology\\GME\\SEGME.exe -c snappoints(in=\\\"%s\\\", snap=\\\"%s\\\", out=\\\"%s\\\", tol=500);" %(inpoint, snap, outpoint))
# --------------------------------------------------------------------------- # gis_Test1.py # Description: Snap Point to Feature (Spatial Ecology) # --------------------------------------------------------------------------- import os import arcpy #Read Parameters #1 in --> the input point data source #2 snap --> the input feature source to which points are snapped #3 out --> the output point data source #4 tol --> tbe maximum snap distance in coordinate system units inpoint = arcpy.GetParametersAsText(0) snap = arcpy.GetParametersAsText(1) outpoint = arcpy.GetParametersAsText(2) tol = arcpy.GetParametersAsValue(3) os.system("C:\\Program Files (x86)\\SpatialEcology\\GME\\SEGME.exe -c snappoints(in=\\\"%s\\\", snap=\\\"%s\\\", out=\\\"%s\\\", tol=%s);" %(inpoint, snap, outpoint, tol))
#Import library modules import os arcpy # Read parameter values # 1 in --> the input point data source # 2 snap--> the input feature source to which points are snapped # 3 out--> the output point data source # 4 tol--> the maximum snap distance in coordinate system units in = arcpy.GetParameterAsText(0) snap = arcpy.GetParameterAsText(1) out = arcpy.GetParameterAsText(2) tol = arcpy.GetParameterValue(3) #Loading GME and running GME-Tool os.system(�?�path\\SEGME.exe -c snappoints(in, snap, out, tol)�?�)
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.