|
POST
|
I'm pretty sure what you're seeing within the script tool is by design. Once the tool is published to the server the custom validation logic will be removed. I don't really work with WebApp Builder, but if I were to use the JavaScript API I'd handle my tool validate within the client (i.e. on the JavaScript side). Could you provide more information on what your tool validator does?
... View more
09-02-2015
09:47 AM
|
1
|
1
|
1845
|
|
POST
|
Hi David, Not sure if you still have this question, but the tool from the Python Addin should become the active tool when you click on it. You shouldn't need a button to activate it. Are you still having this problem?
... View more
09-01-2015
03:49 PM
|
0
|
1
|
1062
|
|
POST
|
Hi Yamin, I'm not sure if you still have this question. I haven't seen any users that have already created a tool similar to what you're needing. Are you having trouble creating this tool on your end? If so, could you provide a code sample showing what you have so far? I would think that you would want to create a tool within a python addin that implements the following logic: Wire into the tool's onMouseDownMap event. This event will provide you with the xy location of where the user clicks. Implement logic that iterates through the layers in the TOC that you'd need to review and either use the selection Geoprocessing tools or cursors with a spatial filter to determine which layers have data that intersect where the user clicked. Use Geoprocessing to select the intersecting features and export them to a csv file via the TableToTable conversion tool or using python create the csv file and write the needed records to using cursors.
... View more
09-01-2015
03:27 PM
|
0
|
0
|
766
|
|
POST
|
Looking at your logic it appears that you're doing the following Geocode the table Delete a field in the table Empty the geocoding table (i.e. delete the results of geocoding step so that you have an empty table with the geocoding result schema) Make a feature layer against the empty geocoding result table Export the empty table to KML Could you explain why you're emptying the geocoded table? I'm guessing that some logic is missing and you're probably needing to delete certain rows that you don't need in the output table. I have pasted some logic below that should help you move forward with your task if you're still needing to do so, but I removed the logic you had in the middle because I don't fully understand what your business requirements are. import arcpy
from os import path
arcpy.env.overwriteOutput = True
locator = arcpy.GetParameterAsText(0)
addrTable = arcpy.GetParameterAsText(1)
out_class = arcpy.GetParameterAsText(2)
''' STEP ONE : Create your shapefile '''
# Geocode the table of addresses you've provided with your chosen locator
locations = arcpy.geocoding.GeocodeAddresses(table, locator, "", out_class)
''' STEP TWO : Create your kml file next to your shapefile '''
# Create a layer object from your shapefile
alias = path.basename(out_class).split(".")[0]
layer = arcpy.management.MakeFeatureLayer(locations, '{0} Layer'.format(alias)).getOutput(0)
# Create the kml file
arcpy.conversion.LayerToKML(layer, out_class.replace(".shp", ".kmz"),0, False, "DEFAULT", 1024, 96, "CLAMPED_TO_GROUND")
def userWorkflow(locator, table, out_class):
# create your shapefile
arcpy.geocoding.GeocodeAddresses(table, locator, "", out_class)
... View more
09-01-2015
09:57 AM
|
0
|
0
|
948
|
|
POST
|
Is this question a duplicate of https://community.esri.com/thread/164030 ?
... View more
09-01-2015
09:28 AM
|
0
|
1
|
1166
|
|
POST
|
Have you tried collecting the SpatialReference object of the feature class, exporting it to a string and parsing the string representation for the VERTCS? For example, I created some data that uses Web Mercator and MSL_Height vertical system and it's coordinate system string is shown below. PROJCS['WGS_1984_Web_Mercator_Auxiliary_Sphere',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Mercator_Auxiliary_Sphere'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],PARAMETER['Standard_Parallel_1',0.0],PARAMETER['Auxiliary_Sphere_Type',0.0],UNIT['Meter',1.0]],VERTCS['MSL_Height',VDATUM['Mean_Sea_Level'],PARAMETER['Vertical_Shift',0.0],PARAMETER['Direction',1.0],UNIT['Meter',1.0]];-20037700 -30241100 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision I would assume that most vertical coordinate systems would have these VERTCS and VDATUM tags. If I needed to parse this information I'd just build a regular expression to search for the needed tags or I'd just use python to slice the string to get the portion I need.
... View more
09-01-2015
09:21 AM
|
0
|
0
|
1689
|
|
POST
|
Does your output shapefile already exists in your output folder? If yes, then you would need to set the overwrite property to True or use python logic to check if the output shapefile exists and delete it if does prior to calling the tool that will generate it. I've shown two options for this below. # ## OPTION A ## #
import arcpy
from os import path
arcpy.env.overwriteOutput = True
arcpy.env.workspace = r"C:\reggie\stats\spatial"
idFeat = r""
outWS = r""
for fc in arcpy.ListFeatureClasses():
output = path.join(outWS, fc)
arcpy.analysis.Identity(fc, idFeat, output, relationship="NO_RELATIONSHIPS")
# ## OPTION B ## #
import arcpy
from os import path
arcpy.env.workspace = r"C:\reggie\stats\spatial"
idFeat = r""
outWS = r""
for fc in arcpy.ListFeatureClasses():
output = path.join(outWS, fc)
if arcpy.Exists(output):
arcpy.management.Delete(output)
arcpy.analysis.Identity(fc, idFeat, output, relationship="NO_RELATIONSHIPS")
... View more
09-01-2015
09:04 AM
|
2
|
1
|
2322
|
|
POST
|
Do you mean the ArcObjects .NET SDK for ArcGIS 9.3? (i.e. you're trying to create a customization for ArcGIS Desktop or ArcGIS Engine)
... View more
08-31-2015
09:06 AM
|
0
|
2
|
1088
|
|
POST
|
The easiest option would be to build a script tool to use the arcpy.da.walk method to walk through your geodatabase and delete each item found. arcpy.da.walk http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-data-access/walk.htm If you wanted to accomplish this in ModelBuilder you could build a series of submodels with the different iterators that could delete different types of data. A quick tour of using iterators http://desktop.arcgis.com/en/desktop/latest/analyze/modelbuilder/a-quick-tour-of-using-iterators-for-iteration-looping-.htm The catch with using the iterators within ModelBuilder with be that 1) not all types are available within the given set of iterators and 2) without using a script tool for the deletion logic it'd be hard to catch errors that would stop the model (i.e. deleting features that you don't have permissions to, items that can't be deleted because they participate in a relationship, etc.)
... View more
08-28-2015
09:56 AM
|
2
|
0
|
1007
|
|
POST
|
Hi Bill, 10.2.2 doesn't support VS 2013 so you shouldn't see the templates there by default. ArcObjects SDK 10.2.X System Requirements http://resources.arcgis.com/en/help/system-requirements/10.2/index.html#//01510000006n000000
... View more
08-24-2015
04:55 PM
|
0
|
0
|
2531
|
|
POST
|
How are you wanting your user to execute your code? Do you want them to execute it via a Script tool within the ArcGIS Desktop application? Are you wanting them to paste your code into the python window? Are you wanting to execute it standalone from a DOS prompt or python IDE?
... View more
08-21-2015
09:13 AM
|
0
|
0
|
2872
|
|
POST
|
Hi Jose, I've written up a quick sample to show what I believe you're running into. An image of the results is shown below. The image displays side by side maps within a Runtime for .NET application. The maps contain three layers. 1) ArcGIS Online Basemaps (left uses Web Mercator projection and right uses WGS84 projection) 2) FeatureLayer from Mobile Geodatabase (both use Web Mercator projection) 3) Graphics Layer When you run the application you'll notice that the FeatureLayer (the green polygon minus the red outline) only fails to display in the map that has a different coordinate system than the table in the mobile geodatabase. This is what the documentation is stating is an expected behavior.
... View more
08-17-2015
09:43 PM
|
2
|
1
|
3806
|
|
POST
|
I don't believe I have access to the map service you're using in your code, so I'm going to make assumptions based on the what I've seen in the code. So far it appears that the spatial reference of your map is set to 4326 (i.e. WGS84), whereas the layer you're adding from your mobile geodatabase uses 4269 (i.e. GCS NAD83). As per the documentation, "Your tables in the geodatabase must be in the same spatial references as the map you are adding them to because on-the-fly reprojection of data from these tables is not supported." I believe that this is why you're unable to see the second layer you've added to the map. Could you check the REST endpoint of your service to verify its coordinate system? Spatial References https://developers.arcgis.com/net/desktop/guide/spatial-references.htm
... View more
08-17-2015
05:53 PM
|
0
|
0
|
3806
|
|
POST
|
Hi Ameya, Have you tried implementing a script tool and within it using a tool validator to validate what you're needing? You should be able to parse the information you're needing from the Describe object in python. This logic would not be available in ModelBuilder from the GPDialog and would require either a script tool or python toolbox. If you wanted to do this during execution you could use If-The-Logic in ModelBuilder, but I don't believe this would provide the user experience you're wanting.
... View more
08-17-2015
05:18 PM
|
1
|
1
|
1294
|
|
POST
|
GeoNET should allow you to attach the code in a response if you use the advanced editor.
... View more
08-14-2015
09:56 AM
|
0
|
2
|
3806
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-19-2016 04:45 AM | |
| 1 | 09-24-2015 06:45 AM | |
| 1 | 09-15-2015 10:49 AM | |
| 1 | 10-12-2015 03:07 PM | |
| 1 | 11-25-2015 09:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|