POST
|
I have a feature layer in SDE with 41 points and 181 pictures and each picture is about 3-5 MB. When I use the arcpy.da.SearchCursor to export attachments to local folder, I found the first loop time is too long, for example, for my data, the time is about 90s, but the next loops is about 0.5s. So, my question is why the first loop takes a lot of time ? And is there a good way to solve it ? Thanks a lot.
... View more
11-27-2018
06:04 PM
|
0
|
0
|
259
|
POST
|
Hi, Shiva, I have meet a similar problem recently, and I found a solution for this. I agree with Shelly Gill’s point of view, and you maybe meet the permissions issues of over Android 6.0. You should get dynamic permissions in you code, like the following code. private void InitializePermissions() {
if (!CheckPermission()) {
RequirePermission();
}
}
private boolean CheckPermission() {
for (String permission : PERMISSIONS) {
if (ActivityCompat.checkSelfPermission(this, permission) !=
PackageManager.PERMISSION_GRANTED) {
return false;
}
}
return true;
}
private void RequirePermission() {
ActivityCompat.requestPermissions(this, PERMISSIONS, 1);
} The PERMISSIONS is private final String[] PERMISSIONS = new String[] {
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
}; And your onCreate function maybe like:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
InitializePermissions();
/* Write you code there */
} Hopt to help you.
... View more
08-08-2018
01:15 AM
|
0
|
0
|
436
|
POST
|
With your help, I sovle the problem, thany you very much.
... View more
11-08-2016
05:27 PM
|
0
|
2
|
608
|
POST
|
Hi, Dan Patterson, Thanks for your answer.But I don't know how to get the geometry of the na result layer, how to do that? I get the Route_Layer1 after solve , the Routes has a attribute table .
... View more
11-06-2016
08:55 PM
|
0
|
4
|
608
|
POST
|
I use arcpy.na.MakeRouteLayer build a layer, and use arcpy.na.AddLocations add two stop points, and use arcpy.na.Solve get the shortest route. But how can I get the length of the shortest route.
... View more
11-06-2016
07:21 AM
|
0
|
6
|
1345
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|