|
POST
|
That was explained by Luke earlier. In case it finds the layer with the name you specify you try to pass a layer object to the arcpy.mapping.Layer() that expects a string...
... View more
08-07-2014
07:50 PM
|
1
|
0
|
1907
|
|
POST
|
Thanx Luke, for adding an example and the good explanation. This saves me some time
... View more
08-07-2014
07:48 PM
|
0
|
0
|
3217
|
|
POST
|
Just had a "short" look at the code, and from the error message I see you're using version 10.1 of ArcGIS. Any service packs installed? At 10.1 you can use lot's of the goodies provided like the data access module, but you're using the old and slow cursors. Code normally does the same thing each time over and over. If it doesn't then normally something of the environment it runs in (ArcGIS, underlying data, state of elements in your MXD, etc) changed. Just to respond to the discussion on whether to use quotes around the field name or field values not. Don't think about this to much, since arcpy can do the work for you. As you know the way you have to specify the field with single quotes, square brackets or just without, depends on the data source. Arcpy comes with a tool ("AddFieldDelimiters") that will do the work for you. Have a look at the snippet below:
fc = r"C:\some\path\to\a\folder\or\fgdb.gdb\myFeatureClass"
fld_name = "myField"
a_value = 123456
qdef = "{0} = {1}".format(arcpy.AddFieldDelimiters(fc, fld_name), a_value)
When you want to append text into one string try to avoid this:
"CROWN_LANDS_FILE = '" + str(fileNum) + "'"
... rather use the string format syntax like:
"CROWN_LANDS_FILE = '{0}'".format(fileNum)
This makes it easier to construct complex strings. If you want to zoom to a feature, you can also use the extent of the feature geometry, as I have explained in this thread: https://community.esri.com/message/393455#393455 Then there's this thing about classes; the fact that you want to run a piece of code 350 times, for me isn't a reason to create a class for it. Sure you can, but the idea of classes (IMHO) is that they should contain reusable generic code and not all kinds of specifics as is the case in your code. It makes it very hard to read your code. Kind regards, Xander
... View more
08-07-2014
07:45 PM
|
0
|
9
|
2700
|
|
POST
|
I see you are trying to create a new MXD through python by just accessing a non existing mxd file in a just created folder. That will not work. See the blog post below with an example of using ArcObjects inside Python for that purpose. Create a new MXD through Python. This is rather complex. You might want to consider creating an empty mxd file and copy that file for creating a new MXD. Kind regards, Xander
... View more
08-06-2014
02:48 PM
|
1
|
0
|
3217
|
|
POST
|
Hi Filip, Thanx for sharing. I will look into it. Kind regards, Xander
... View more
08-06-2014
02:39 PM
|
0
|
0
|
3172
|
|
POST
|
Not sure what you are trying to do with this code. You loop through the layers in an MXD and check if the name equals "CNNDB". If that's the case you try to set a variable "addlayer". I don't think you should try to create a layer from a layer object. Next you try to add the layer to the dataframe (where the layer already exists), although the code does not run that far. And you intent to export the map to PDF. Is the loop through your layer really useful? Kind regards, Xander
... View more
08-06-2014
02:33 PM
|
0
|
5
|
3218
|
|
POST
|
The addresses you have, are they already geocoded? Do you have X, Y coordinates or Latitude, Longitude coordinates?. If not, you should first geocode the addresses. If you already have X, Y coordinates or Lat, Long attributes, you can use Add XY Events to convert the X, Y or Lat, Long values to a geolocation. Note that this information does not need to be in an Excel file. Once you have your 600.000 points you can visualize them or perform some spatial analysis. It is important to know the difference between a Heatmap visualization and spatial analysis like Point Density or Kernel Density. Heatmaps are often used in viewer like JavaScript, Silverlight and Flex viewer, or using Maps for Office. Heat map in esri Maps for Office http://doc.arcgis.com/en/maps-for-office/help/add-a-heat-map.htm Hot Spot Analysis Getis-Ord Gi* (Spatial Statistics) http://resources.arcgis.com/en/help/main/10.2/index.html#/Hot_Spot_Analysis_Getis_Ord_Gi/005p00000010000000/ Kernel Density (Spatial Analyst) http://resources.arcgis.com/en/help/main/10.2/index.html#//009z0000000s000000 Point Density (Spatial Analyst) http://resources.arcgis.com/en/help/main/10.2/index.html#/Point_Density/009z0000000v000000/ Kind regards, Xander
... View more
08-06-2014
09:05 AM
|
1
|
0
|
1132
|
|
POST
|
When working with Excel it is very important to realize that Excel is a not a database. In Excel you can do a lot of things that are not allowed in a table to be used in ArcGIS. Maybe you can post (part of) the Excel file, so we can see if this problem can be reproduced.
... View more
08-05-2014
09:35 AM
|
1
|
0
|
2230
|
|
POST
|
I totally agree with Dan, this is not a bug, but a feature. It allows you to create models or through code to make selections and apply geoprocessing on that selection only. It's a very powerful feature, but as with all thing you have to be aware of what you are doing. As many, I have made that error too. Learn from it and benefit from it in the future.
... View more
08-05-2014
05:57 AM
|
1
|
0
|
1632
|
|
POST
|
Yes please do report back, since you might not be the only one that will face that problem. Thanks and good luck! Xander
... View more
08-02-2014
09:56 PM
|
0
|
0
|
2828
|
|
POST
|
Hi Barbara, I'm think that might not be so easy. As far as I remember and understand, the template uses a Server Object Extension (ElevationsSOE) that provides additional functionality on top of several datasets as described in the posts below: Elevation Server Object Extension | Applications Prototype Lab Using the new Elevation Profile app template | ArcGIS Blog ... although I'm not sure if these are the most recent posts on this field. Kind regards, Xander
... View more
08-02-2014
09:51 PM
|
1
|
2
|
3396
|
|
POST
|
Hi Greg, You can use ArcGIS Online for sharing map packages and layer packages. The other viewer would still need show Esri software to actually see the content of the package. This can be achieved by ArcGIS Explorer (which is free). Another option is to export the map to PDF. The PDF supports layers, which means that the end user can switch layers in the PDF on and off. Kind regards, Xander
... View more
08-02-2014
09:05 PM
|
3
|
1
|
1168
|
|
BLOG
|
Steve, thanks for sharing. Might be a nice idea to upload the entire presentation (once updated) as PDF document. Kind regards, Xander
... View more
08-02-2014
08:56 PM
|
0
|
0
|
2599
|
|
POST
|
Did you install any other python libraries after installing ArcGIS 10.2.2? Might be some conflict?
... View more
08-02-2014
08:49 PM
|
1
|
2
|
2828
|
|
POST
|
Hi Dan, It works perfectly for me (only tried the sequential with scatter graph). I am using 10.2.2.3552 (Advanced). Hope you figure it out (I can't think of a reason why it doesn't work at your machine). Kind regards, Xander
... View more
08-02-2014
08:27 PM
|
2
|
4
|
2828
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-09-2020 09:26 AM | |
| 6 | 12-20-2019 08:41 AM | |
| 1 | 01-21-2020 07:21 AM | |
| 2 | 01-30-2020 12:46 PM | |
| 1 | 05-30-2019 08:24 AM |
| Online Status |
Offline
|
| Date Last Visited |
Tuesday
|