POST
|
Thanks to AnneFitz and UndralBatsukh both. The solutions worked, though they do generate a bunch of font errors in the console.
... View more
04-26-2023
09:08 AM
|
0
|
0
|
294
|
POST
|
I am trying to use the National Geographic Style basemap in a JavaScript-coded webpage. The only value for the basemap property listed on https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html gives the property value of "national-geographic" and then says that this is the deprecated version. It provides a link to the ArcGIS.com page hosting the updated version of the map, National Geographic Style. However, no matter how far I dig I cannot see what value to use for that updated "basemap" property." I have tried several variations on "national-geographic" but none have worked. Any ideas?
... View more
04-26-2023
08:04 AM
|
0
|
3
|
343
|
POST
|
Thank you, you got it in one. I had to change one other bit of code: row[0] = nbhdName.Title() became row[0] = nbhdName.title() Everything works now. Thank you!
... View more
11-13-2018
12:48 PM
|
0
|
0
|
1580
|
POST
|
My Python script uses two feature classes in a file geodatabase in ArcGIS Pro. I select several polygons from the Parcels fc and start the script. The script copies the polygons to the Neighborhoods fc, merges them into one polygon (using Dissolve) and should copy the script parameter entries into several fields of the new Neighborhoods polygon. I have tried many variations on the syntax for the "where clause" in the ArcPy SelectLayerByAttribute function, but always get an Invalid Expression failure on line 41: arcpy.SelectLayerByAttribute_management (fc_out, "NEW_SELECTION", whereclause) Any help would be greatly appreciated. Here is the code: # # Python Script # This script copies polygons from the Lancaster County Parcels feature # class into the Neighborhoods feature class and processes them into a # single neighborhood, complete with identifying attributes. import arcpy # Set the current workspace from arcpy import env env.workspace = "CURRENT" import datetime # Read the input parameter values: # 0: Neighborhood Name: NbhdName # 1: Plan Number part 1: PlanNum1 # 2: Plan Number part 2: PlanNum2 # 3: Plan Density: PlanDensity # 4: Plan Date: PlanDate nbhdName = arcpy.GetParameterAsText(0) planNum1 = arcpy.GetParameterAsText(1) planNum2 = arcpy.GetParameterAsText(2) planNum = planNum1[0] + '-' + planNum1[-3:] + '-' + planNum2[-3:] planDensity = float(arcpy.GetParameterAsText(3)) temp = arcpy.GetParameterAsText(4) tempList = temp.split('/') planDate = datetime.date(int(tempList[2]),int(tempList[0]),int(tempList[1])) planYear = int(temp[-4:]) # extract the year from the date # Copy the currently selected features in the parcels layer fc_in = "Parcels_2016" fc_tempin = "in_memory/Neighborhoods_in" fc_tempout = "in_memory/Neighborhoods_out" fc_out = "Neighborhoods_2016" arcpy.CopyFeatures_management(fc_in, fc_tempin) # Merge the copied parcels before adding to Neighborhoods fc arcpy.Dissolve_management(fc_tempin, fc_tempout) schema_type = "NO_TEST" arcpy.Append_management(fc_tempout, fc_out, schema_type) arcpy.SelectLayerByAttribute_management (fc_in, "CLEAR_SELECTION") whereclause = '"Neighborhoods_2016.NBHD_NAME" = "NEW NBHD"' arcpy.SelectLayerByAttribute_management (fc_out, "NEW_SELECTION", whereclause) # result = arcpy.GetCount_management(fc_out) fields = ["NBHD_NAME", "SUBPLAN", "DENSITY_Plan", "SubPlanDate", "SubPlanYear"] # Create update cursor for feature class with arcpy.da.UpdateCursor(fc_out, fields) as cursor: for row in cursor: # DOES NOT execute on only the new neighborhood row[0] = nbhdName.Title() row[1] = planNum row[2] = planDensity row[3] = planDate row[4] = planYear cursor.updateRow(row) #
... View more
11-13-2018
12:01 PM
|
0
|
2
|
1740
|
POST
|
Thank you. I finally got it working. My script code is: # Python Script # This script copies polygons from the Lancaster County parcels feature # class into the Neighborhoods feature class and processes them into a # single neighborhood. import arcpy # Set the current workspace from arcpy import env env.workspace = "CURRENT" # Copy the currently selected features in the parcels layer fc_in = "Parcels_2016" fc_tempin = "in_memory/Neighborhoods_in" fc_tempout = "in_memory/Neighborhoods_out" fc_out = "Neighborhoods_2016" arcpy.CopyFeatures_management(fc_in, fc_tempin) # Merge the copied parcels before adding to Neighborhoods fc arcpy.Dissolve_management(fc_tempin, fc_tempout) schema_type = "NO_TEST" arcpy.Append_management(fc_tempout, fc_out, schema_type)
... View more
10-12-2018
05:42 PM
|
1
|
0
|
969
|
POST
|
Sorry, I replied via e-mail but it is not showing up here. Yes, but by "grouped" I mean turning a set of, for example, 30 parcel polygons into one neighborhood polygon. My expectation is that I will select the parcels in Pro and then run my custom tool.
... View more
10-09-2018
05:07 PM
|
0
|
0
|
969
|
POST
|
Thanks for your quick reply. I looked at both of those, but Merge seems to be focused on merging entire feature classes, while Dissolve requires an attribute field which, at that stage in the process, doesn't exist yet. When I perform the task manually, the tools are in the "Modify Features" tools on Pro's Edit menu, but they don't seem to have Python equivalents.
... View more
10-09-2018
11:46 AM
|
0
|
2
|
969
|
POST
|
I am relatively new to Python, but have a workflow in which I select a group of contiguous parcels in my Parcels feature class, copy them, paste (special) them into another existing feature class called Neighborhoods and, when they are in the Neighborhoods feature class, merge them into one polygon (the neighborhood). I am trying to decide between the CopyFeatures_management and Append_management ArcPy tools for the first part, and I cannot find any ArcPy tool for the merge.
... View more
10-09-2018
11:33 AM
|
0
|
7
|
1079
|
POST
|
Thank you, Robert. It does turn out that the method featureLayer.setDefinitionExpression(...) will in itself remove any previous definition expression, so that wasn't my issue after all. It was, as Robert showed, the need to refresh the feature layer. I can, in fact add the feature layer as soon as I removed the previous one, the refresh just has to happen after I change the definition expression. Thanks again.
... View more
12-11-2017
01:24 PM
|
0
|
0
|
428
|
POST
|
A semi-working copy of the page is at http://mapmaker2.millersville.edu/pamaps/PA_CountyHistories/. The goal is to have the user click on the tabs to the left of the map. The right two tabs include nested unordered lists, and each list item is a <button>. In the function called by the button click, the current feature layer is removed and the new feature layer added. At more detailed levels of the nested lists the added feature layer should have a subset of the features visible, by virtue of a setDefinitionExpression method. I believe that the definition expression is not working because the previous definition expression is not being cleared before the new one is added. The API Reference is very vague about that behavior, and the only methods there are "get..." and set..." . There is no "clear" or "remove." Any ideas?
... View more
12-11-2017
11:51 AM
|
0
|
3
|
931
|
POST
|
I, too, am struggling to convert older code to AMD, and echo many of the earlier posts in this thread, especially requesting that Esri show examples in both legacy and AMD format to help us with the transition. My particular question is why all of the examples involving dynamic map service layers are still in legacy code. Is there some move to separate dynamic map services from tiled and feature services?
... View more
09-02-2013
12:03 PM
|
0
|
0
|
569
|
POST
|
Sorry for infrequent posts. It's not the range of LODs that's the issue for me. I want to default to a map that fits Pennsylvania well and then have 8-10 LODs down to local level (my current smallest scale, 1:5,000,000 isn't right yet, but close; my current largest scale, 1:2,500 is about right). With the standard LODs, the largest one that shows all of Pennsylvania makes the state too small, and the next larger scale LOD cuts off too much. I'm sure they did a lot of research before settling on their zoom levels, and found the best all-around solutions, but they just don't fit my needs. Maybe Esri could come up with a few alternative LOD sets?
... View more
08-30-2013
04:40 PM
|
0
|
0
|
407
|
POST
|
Thanks to both of you. The links don't precisely answer my question, but it is clear that I haven't followed "best practices." Unless I hear otherwise, it looks like I will have to create entire cached basemap services of my own in order to best represent the state-to-local LODs needed for my project.
... View more
08-29-2013
04:49 PM
|
0
|
0
|
407
|
POST
|
I created a tiled map service (http://mapmaker.millersville.edu/ArcGIS/rest/services/PAoutline/MapServer) in order to create a map better suited to local zoom levels (lods). I hoped to be able to add a ArcGIS Online tiled service (http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer) after my service loads so that my service determines the lods, but the AGO service shows its better graphics. The AGO map service will not draw. Is it because you can't overlay two services with different lods, or is it because my spatial reference (102113) is slightly different than the AGO map service (102100)? (or is it something else altogether?)
... View more
08-28-2013
06:19 PM
|
0
|
5
|
769
|
POST
|
Perfect! Thank you so much! I had had a more generic popup close function, from the sample, but it wasn't tied to the particular evt for that featureLayer This fixed it perfectly.
... View more
03-29-2013
05:10 AM
|
0
|
0
|
380
|
Title | Kudos | Posted |
---|---|---|
1 | 10-12-2018 05:42 PM |
Online Status |
Offline
|
Date Last Visited |
02-15-2024
04:32 PM
|