|
POST
|
Hello, The underlying DBMS is Oracle 11g (11.2.0.4.0 - 64 bit). There are some dates in the feature class but they are valid dates or null. Joe, I tried your suggestions and I get the following error roughly at the the point where the loading could reach the first failing feature. Does it make any sense to you? Have I run out of space? That would seem odd. Filip.
... View more
06-26-2015
01:41 AM
|
0
|
3
|
3731
|
|
POST
|
Hi, that is pretty much what I had in mind except that I thought you could supply the extent from map.extent in JavaScript. That would be like using "current map display" but I don't know how to do this in Web App Builder out of the box (or any other way). Filip
... View more
06-25-2015
12:56 PM
|
0
|
0
|
873
|
|
POST
|
How strange... Can you tell us more details? What version of ArcGIS do you have? How many features are involved approximately? What are roughly the areas of the small polygons and of the large polygons? Are there multi-part polygons or just single-part polygons? Have you tried CheckGeometry and RepairGeometry?
... View more
06-25-2015
12:49 PM
|
1
|
0
|
1569
|
|
POST
|
Hi Brendad, Yes, parameters with direction set to "output" can be accessed with both GetParameter and SetParameter methods (and their "AsText" variants). It is a bit contra-intuitive at first but it does make sense. In the case of FeatureClasses for example, you use GetParameter at the beginning of the script to obtain the value defined by the user, which would be a path where the output feature class should be stored, and then you use SetParameter in the end to actually set the output value for that parameter. Filip,
... View more
06-25-2015
12:41 PM
|
1
|
10
|
3901
|
|
POST
|
Hello Can you help me solve a problem which has the following symptoms please? I export a feature class from our ArcSDE Enterprise Geodatabase to a local file geodatabase (using FeatureClassToFeatureClass) and then I want to import the feature class back from the local file geodatabase to the SDE geodatabase (using FeatureClassToFeatureClass) as a new feature class with a new name but I get the following kind of response (with a point feautre class): Executing: FeatureClassToFeatureClass C:\dt\tmp.gdb\fc "Database Connections\THEDB.sde" fc_import # "ID "ID" true true false 4 Long 0 0 ,First,#,C:\dt\tmp.gdb\fc,ID,-1,-1;SRC_ID "SRC_ID" true true false 4 Long 0 0 ,First,#,C:\dt\tmp.gdb\fc,SRC_ID,-1,-1;NAME "NAME" true true false 50 Text 0 0 ,First,#,C:\dt\tmp.gdb\fc,NAME,-1,-1;COUNTRY_CODE "COUNTRY_CODE" true true false 30 Text 0 0 ,First,#,C:\dt\tmp.gdb\fc,COUNTRY_CODE,-1,-1;EASTING "EASTING" true true false 4 Long 0 0 ,First,#,C:\dt\tmp.gdb\fc,EASTING,-1,-1;NORTHING "NORTHING" true true false 4 Long 0 0 ,First,#,C:\dt\tmp.gdb\fc,NORTHING,-1,-1;HYDROMETRIC_AREA "HYDROMETRIC_AREA" true true false 2 Short 0 0 ,First,#,C:\dt\tmp.gdb\fc,HYDROMETRIC_AREA,-1,-1;ELEVATION "ELEVATION" true true false 8 Double 0 0 ,First,#,C:\dt\tmp.gdb\fc,ELEVATION,-1,-1;GEOG_PATH "GEOG_PATH" true true false 50 Text 0 0 ,First,#,C:\dt\tmp.gdb\fc,GEOG_PATH,-1,-1;FIRST_DAY "FIRST_DAY" true true false 8 Date 0 0 ,First,#,C:\dt\tmp.gdb\fc,FIRST_DAY,-1,-1;FIRST_YEAR "FIRST_YEAR" true true false 2 Short 0 0 ,First,#,C:\dt\tmp.gdb\fc,FIRST_YEAR,-1,-1;LATEST_DAY "LATEST_DAY" true true false 8 Date 0 0 ,First,#,C:\dt\tmp.gdb\fc,LATEST_DAY,-1,-1;LATEST_YEAR "LATEST_YEAR" true true false 2 Short 0 0 ,First,#,C:\dt\tmp.gdb\fc,LATEST_YEAR,-1,-1" #
Start Time: Thu Jun 25 10:23:17 2015
WARNING 000597: Failed to insert input record with FeatureID 3966.
WARNING 000595: C:\foo\bar.fid contains the full list of features not able to be copied.
WARNING 000597: Failed to insert input record with FeatureID 3967.
...
WARNING 000597: Failed to insert input record with FeatureID 4000.
ERROR 000224: Cannot insert features
ERROR 000224: Cannot insert features
Failed to execute (FeatureClassToFeatureClass).
Failed at Thu Jun 25 10:23:27 2015 (Elapsed Time: 10.80 seconds)
It has happened with more than one feature class but it does not happen with every feature class. Everything I found about this problem suggests that this problem can occur if the feature that is being inserted has a geometry or attribute value that is not suitable for the data type in the output geodatabase but I cannot find any mismatch (or don't know how to find it) and I would expect ArcGIS to handle this when it's a transfer "from ArcGIS to ArcGIS". Some features get inserted OK. I looked at some of the features listed in the warning messages but I cannot see anything wrong with them.I tried CopyFeatures but it produced the same result. All parts are at version 10.2.2. Any hint welcome! Filip.
... View more
06-25-2015
08:30 AM
|
0
|
8
|
10308
|
|
POST
|
Hi Mody, I don't think there is a really easy way to that but this is what I would try. Add another parameter to your service to specify processing extent of the geoprocessing service and implement it internally in the script/model used for the service. Alternatively, if you are sending in the lines to buffer as a parameter, bounce them off the server's geometry service clip operation to clip them before you send them to the buffer service. Some client side APIs should support the clip operation so you could do the clipping on the client side. All this is of course viable only if you are dealing with fairly few and simple features. Filip.
... View more
06-24-2015
02:27 PM
|
1
|
2
|
873
|
|
POST
|
Hi Brendan, You don't need to start a new service with each result. The key is to make sure that your output is passed properly to the tool and that is has the right data type. Here are some pointers to start with and/or double check. By the end of your script when you end up with your polygon feature class (say out_fc), make sure you use arcpy.SetParameter to make ArcGIS aware that out_fc is a result of your tool. When you are adding the script to a toolbox so you can use it in ArcMap, make sure you set the parameter direction to "Output" and type to "FeatureClass". After that, run the tool. Does the result get added to the map? It is a good sign if it does. Publish the geoprocessing result as a service. Then connect to the server and run the tool from the server. Does the result get added to the map? Note that depending on your settings, geoprocessing results may not add to the map automatically so it is more reliable to check the content of the result object in Geoprocessing Results window. Often it helps me if I add in some messages with arcpy.AddMessage while debugging tools. Here is a "skeleton" of a basic script that can be added to ArcGIS as a script tool. import arcpy
def main(in_points, out_fc):
"""Main function that does the magic"""
out_fc = arcpy.analysis.Buffer(in_points, out_fc, 100).getOutput(0)
return out_fc
if __name__ == "__main__":
in_points = arcpy.GetParameter(0)
out_fc = arcpy.GetParameter(1)
result = main(in_points, out_fc)
arcpy.SetParameter(1, result) Let us know how you get on. Filip.
... View more
06-24-2015
02:13 PM
|
1
|
1
|
3901
|
|
POST
|
Hi Steve, Since 10.0 or so the Auto-Complete Polygon editing tool has been working pretty well for me. And if that tool is not enough then topological editing is the way to go. Filip.
... View more
06-17-2015
02:00 PM
|
0
|
0
|
3049
|
|
POST
|
Hello Christer, I've seen some examples that converted between GeoJSON and EsriJSON (i.e. ArcGIS REST API JSON) using a JavaScrip library called Terraformer. You could also try to bounce your GeoJSON off one of my services: https://omnimion.com/om/services/geojson-esrijson/ You should be able to post your geojson for example using jquery: $.ajax( {
url: "https://omnimion.com/om/services/geojson-esrijson"
data: {"q": JSON.stringify(geojson)},
method: 'POST',
dataType: 'json'
}).done( function(data){
console.log(data); // data should contain esrijson
}).fail( function(err){
console.log(err);
}); You could certainly add the converted feature to a GraphicsLayer, but I don't know how to create a full fledged FeatureLayer from it (which is a subtype of GraphicsLayer). I would really like to know if it works for you or how you eventually solve this. Filip.
... View more
06-13-2015
11:43 AM
|
0
|
0
|
1660
|
|
POST
|
Hello Niraj, The only examples of dynamically generating a shapefile and offering it for download (or sending it by email) I have seen relied on custom geoprocessing tasks built with tools from the Data Extraction Toolset. This use case is often called "Clip and Ship" and there are some examples for server side and for client side. As far as I know, there is no simple option like saying "f=shp" in the REST API Query task. It could be very useful if it was possible to enable it as another capability of a service. At one point I though the GeoDataServer service would be able to offer easy data extraction interface, but I have no experience with the GeoDataServer type and I am not sure what the future plans around it are. Filip.
... View more
06-12-2015
01:48 PM
|
0
|
0
|
729
|
|
POST
|
Hi Mike, I have seen examples of controlling which website can use a service based on ArcGIS | Online and registering apps (websites) in ArcGIS for Developers. Hopefully somebody else can tell us more. Filip.
... View more
06-12-2015
01:29 PM
|
0
|
0
|
611
|
|
POST
|
Hi, Darren is right, I overlooked that. All put together this should work: import arcpy
import os
from arcpy import env
Routesworkspace = arcpy.GetParameterAsText(2)
env.workspace = Routesworkspace
cases = ['RCc10_3_S', 'RCc20_3_S', 'RCc30_3_S', 'RCc40_3_S', 'RCc50_3_S']
SUMDISTANCE = 0
C = 0
for fc in arcpy.ListFeatureClasses():
for case in cases:
if fc.startswith(case):
fields = ['DISTANCE', 'DURATION']
fieldList = [f.name for f in arcpy.ListFields(fc)]
if fields[0] in fieldList and fields[1] in fieldList:
with arcpy.da.SearchCursor(fc, fields, "FID = 0") as cursor:
a = fc
for row in cursor:
DISTANCE = row[0]
DURATION = row[1]
SUMDISTANCE = SUMDISTANCE + DISTANCE
C = C + 1
if C > 0:
AVGDISTANCE = SUMDISTANCE / C
outFile.write('' + str(int(round(AVGDISTANCE))) + '\n')
else:
outFile.write('' + str(0) + '\n') That should do what your original code did except that it will ignore feature classes that do not have both columns DISTANCE and DURATION. If you wanted to make this more generic, you should consider checking field names in case agnostic way (e.g. convert all field names to lowercase for comparison) and perhaps using set operations if you wanted to check for presence of more than 2 columns. F.
... View more
06-10-2015
04:31 PM
|
2
|
1
|
2673
|
|
POST
|
Hi Kon, The word "terminates" sounds mysterious indeed so any more details about what you can see would help. Anyway, I think you can fix your code if you simply replace your line 13 with this: fieldList = [f.name for f in arcpy.ListFields(fc)] If you are not familiar with list concatenation (the suggestion above), you can write it using a map function too: fieldList = map(lambda a: a.name, arcpy.ListFields(fc)) The bottom line is that the arcpy.ListFields function returns a list of Field objects, not list of names of fields in the feature class. To get list of names, you need to loop through the list of field objects and retrieve the name propery. Hope this helps. Filip.
... View more
06-10-2015
03:50 PM
|
1
|
5
|
2673
|
|
POST
|
Hi Brendan, Unfortunately I don't have a solution, I just remember I had the same problem. If I remember correctly I eventually used something like arcpy.env.scratchWorkspace instead of "in_memory" workspace. Or was it arcpy.env.scratchGDB? Or was it %scratchworkspace% ? Sorry I can't remember. Luckily in my case the performance of the service was still pretty good. I'll need to publish some services soon so I'm eager to know how you get on. Best regards, Filip
... View more
06-08-2015
01:56 PM
|
0
|
0
|
3659
|
|
POST
|
Thank you for the explanation Lance Shipman, it is good to understand what's going on. I can't help myself from thinking that this is quite a serious issue. For many users possibly a show-stopper when it comes to migration from 10.2.x to 10.3.x. Do you know if there are any recommendations or knowledge-base articles related to this issue? Any details and suggestions welcome! Kind regards, Filip.
... View more
06-08-2015
01:29 PM
|
2
|
4
|
4709
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-05-2014 04:40 AM | |
| 1 | 02-08-2015 12:49 PM | |
| 1 | 07-20-2014 12:41 PM | |
| 1 | 03-23-2017 01:48 PM | |
| 1 | 08-18-2014 04:14 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|