POST
|
David and Don, you are right. I was using a State Plane Coordinate System, which is a projected coordinate system, but using Lat/Long coordinates I need a geographic coordinate system like NAD 83. Thank you!
... View more
09-28-2021
11:06 AM
|
0
|
0
|
1523
|
POST
|
Thank you for the suggestion David. I changed the code to add the first coordinate pair again at the end, however I am getting the same result.
... View more
09-28-2021
08:04 AM
|
0
|
1
|
1596
|
POST
|
I'm having a problem with the following script. It writes the feature successfully with all of the attributes, but it does not draw the polygon, as the shape length and area are both zero. This script worked previously with ArcPro 2.5, but that project became corrupted so I re-created it in ArcPro 2.8. I'm not sure that has anything to do with the issue. In reading other posts, it appears the two most significant factors for this script to work are setting the spatial reference and also using "Shape@" to write the polygon coordinates from the array. The spatial reference of the map and the feature class are the same- "NAD 1983 (2011) StatePlane Illinois East FIPS 1201 (US Feet)." Any help is very much appreciated. import arcpy NWLongitude = 41.936811 NWLatitude = -88.754027 NELongitude = 41.936811 NELatitude = -88.750635 SWLongitude = 41.934087 SWLatitude = -88.754027 SELongitude = 41.934087 SELatitude = -88.750635 Item = "Test Area" fc = r'G:\Arc\ArcPro\Public Works\MyProject6\MyProject6.gdb\Test_Polygon' # Important: the spatial reference must be set, or the geometry will not locate properly. sr = arcpy.Describe(fc).spatialReference # ***Since Lat/Long Coordinates are provided, need Geographic print("{0} : {1}".format(fc, sr.name)) # Define the coordinate array for the 4-point polygon that is passed to the feature to map it. # Note that the feature is plotted with the 4 points in a clockwise direction - NW, NE, SE, SW. coordinateArray = arcpy.Array([arcpy.Point(NWLongitude, NWLatitude), arcpy.Point(NELongitude, NELatitude), arcpy.Point(SELongitude, SELatitude), arcpy.Point(SWLongitude, SWLatitude)]) polygon = arcpy.Polygon(coordinateArray, sr) # Create Insert Cursor to write feature using polygon coordinateArray above. # "SHAPE@" is a special designation that passes through the polygon geometry statement directly above. # Note that these are the exact field names in the Test_Polygon feature. cursorFC = arcpy.da.InsertCursor(fc, ["SHAPE@", "NWlat", "NWlong", "NElat", "NElong", "SWlat", "SWlong", "SElat", "SElong", "Item"]) # Loading the variables cursorFC.insertRow( [polygon, NWLatitude, NWLongitude, NELatitude, NELongitude, SWLatitude, SWLongitude, SELatitude, SELongitude, Item]) # Delete cursor object del cursorFC
... View more
09-28-2021
07:40 AM
|
0
|
5
|
1632
|
POST
|
Molly, Could you please share a link to the ESRI technical documentation for the tool WebLayerSharingDraft that you referred to? I've done some searches and found similar tools, but not that particular one. Thanks, Doug
... View more
08-03-2020
07:03 AM
|
0
|
1
|
369
|
POST
|
Molly, Thank you very much. I will try that tool instead and I like the idea of looping through the content to ensure a correct match with the feature service name as well. Doug
... View more
07-31-2020
08:02 AM
|
0
|
0
|
1448
|
POST
|
I'm having the same issue, but with the "enable_editing" parameter. Even though I have it set to true (my code is below), it seems to ignore that setting, as it does not allow editing. When I publish the feature layer manually, editing works fine. Any ideas? arcpy.mp.CreateWebLayerSDDraft(map_or_layers=mp,
out_sddraft=sddraft,
service_name=sd_fs_name,
server_type="MY_HOSTED_SERVICES",
service_type="FEATURE_ACCESS",
folder_name="JULIE_FOLDER",
overwrite_existing_service=True,
copy_data_to_server=False,
enable_editing=True,
allow_exporting=False,
enable_sync=False,
summary=None,
tags=None,
description=None,
credits=None,
use_limitations=None)
... View more
07-29-2020
08:47 AM
|
0
|
4
|
1448
|
Online Status |
Offline
|
Date Last Visited |
02-01-2023
02:34 PM
|