|
POST
|
David, I would think that either method should work fine. I personally prefer to reference in the spatial reference from an existing feature class just so I know it will keep things in the same system. What instability issues are you seeing? Are you getting error messages?
... View more
04-28-2016
09:59 AM
|
0
|
1
|
1844
|
|
POST
|
Hi Tom, What I have done when I ran nightly update scripts is that I made Python email me what the results were each night. I imagine the same can be done with writing to a text file. Though, emailing may help you keep a better log? Here is an example of using Python to email yourself: http://naelshiab.com/tutorial-send-email-python/ Here you would just create a variable that would hold your GetCount and other variables you wanted to see and have that be the body of the email message. Plus, you could have the subject of the email indicate whether or not the geoprocess was a success or not. I hope this helps.
... View more
04-28-2016
09:43 AM
|
0
|
0
|
1215
|
|
POST
|
Neil, that's a good point. Seems that once you dabble in Esri's basemaps, things will project to their liking. But if you host this yourself and close it off to AGOL, then you can do essentially what you want (custom coordinates and all).
... View more
04-28-2016
08:51 AM
|
0
|
1
|
3022
|
|
POST
|
Adam, I do not think that you can make your own WKID. These are standards that are created in order to index a large range of coordinate systems. Here is a list of WKIDs for projected coordinate systems: ArcGIS REST API Here is a list of WKIDs for geographic coordinate systems: ArcGIS REST API However, since WKT is just the text string of your projection file, maybe you can get this yourself? If you open a .prj file in a text editor like Notepad, you can see this string. I apply custom coordinate systems to the GIS data that I publish on the web. But, since the web maps are in WGS 84 Web Mercator projection, I think my data gets reprojected on the fly (at least, that is what I understand is happening). So I am not sure that you can 'publish' this custom coordinate system.
... View more
04-28-2016
07:39 AM
|
0
|
3
|
3022
|
|
POST
|
Hi Filmon, It doesn't look like it. Prepare your data—ArcGIS Open Data | ArcGIS In here it says: Field aliases—Change complex GIS data field names to a more user-friendly description of the content of the field. Dataset downloads will supply the field name, not the field alias. It doesn't mention coordinate systems but it is likely the same issue. What transformation is happening with coordinate systems?
... View more
04-28-2016
06:29 AM
|
1
|
0
|
1367
|
|
POST
|
Not insulting here! It's just that this is the ONLY thing that would work for me due to me needing to creating CUSTOM projection files. If I could have used out-of-the-box projections, then utilizing the WKID would have been ideal. But, you're right, it is a major pain! I have it more "programmatic" than just a giant string of text, though. Each of the changing variables in that string (like units, projection, scale factor, etc.) is a variable that I created earlier in the script that programmatically accesses user input so then the string looks more like this: projString = ('PROJCS["' + str(PIN) + '_' + ProjName + '",GEOGCS[' + GeoCS + '],PROJECTION["' + ProjectionName + '"],PARAMETER["False_Easting",' + str(FalseEasting) + '],PARAMETER["False_Northing",' + str(FalseNorthing) + '],PARAMETER["Central_Meridian",' + str(CentralMeridian) + '],PARAMETER["Standard_Parallel_1",' + str(StandardParallel1) + '],PARAMETER["Standard_Parallel_2",' + str(StandardParallel2) + '],PARAMETER["Scale_Factor",' + str(ScaleFactor) + '],PARAMETER["Latitude_Of_Origin",' + str(LatOfOrigin) + '],UNIT["' + LinearUnit + '",' + str(MetersPerFoot) + ']]') But, then again, this works for me and may not be the best choice for your dataset.
... View more
04-28-2016
06:04 AM
|
1
|
3
|
3216
|
|
POST
|
Matt, From my experience of working with the SpatialReference class in Python, there are issues that have not been addressed. Certain properties that are SUPPOSED to be Read/Write are actually Read only. I had to go a complete back door approach in order to create my .prj file. This is what I had to do: prj = open(r"C:\junk\my_new_prj_file.prj", "w") crs_string = 'PROJCS["NAD_1983_UTM_Zone_10N",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]]' prj.write(crs_string) prj.close()
... View more
04-27-2016
09:42 AM
|
1
|
11
|
3216
|
|
POST
|
Great! I am glad this helped. Please mark the response as "Correct Answer" for the one that helped the most.
... View more
04-27-2016
09:10 AM
|
2
|
0
|
3750
|
|
POST
|
To simplify Darren's link, here is the code sample on creating a polygon: import arcpy
# A list of features and coordinate pairs
feature_info = [[[1, 2], [2, 4], [3, 7]],
[[6, 8], [5, 7], [7, 2], [9, 5]]]
# A list that will hold each of the Polygon objects
features = []
for feature in feature_info:
# Create a Polygon object based on the array of points
# Append to the list of Polygon objects
features.append(
arcpy.Polygon(
arcpy.Array([arcpy.Point(*coords) for coords in feature])))
# Persist a copy of the Polyline objects using CopyFeatures
arcpy.CopyFeatures_management(features, "c:/geometry/polygons.shp")
... View more
04-27-2016
09:09 AM
|
0
|
1
|
5983
|
|
POST
|
Oh, take a look at this. This should solve the issue: Using the general label settings to rotate labels with the data frame—Help | ArcGIS for Desktop On the Labeling toolbar, click Labeling > Options. Click the General tab. Check the Rotate point and polygon labels when data frame is rotated check box. Click OK.
... View more
04-27-2016
08:49 AM
|
2
|
2
|
3750
|
|
POST
|
Mamadou, Did you use the Data Frame Toolbar to rotate your data frames? Either way, please follow these steps, I believe this will help: Setting rotation for data frame rules—Help | ArcGIS for Desktop
... View more
04-27-2016
08:28 AM
|
1
|
3
|
3750
|
|
POST
|
Hi Mamadou, Why are you needing to rotate the layer? Rotating the Data Frame is mainly used for cartographic and visualization purposes. Can you give some more details of what you are needing to do?
... View more
04-27-2016
08:06 AM
|
1
|
5
|
3750
|
|
POST
|
Ernesto, Just add it to the top of the code block scripting area like you would in a standalone script. Here are some examples: Calculate Field—Data Management toolbox | ArcGIS for Desktop import arcpy
arcpy.env.workspace = "C:/data"
arcpy.AddField_management("vegtable.dbf", "VEG_TYP2", "TEXT", "", "", "20")
arcpy.CalculateField_management("vegtable.dbf", "VEG_TYP2", '!VEG_TYPE!.split(" ")[-1]', "PYTHON_9.3") EDIT: I have not tested this. I am just kind of going off of the documentation.
... View more
04-27-2016
08:01 AM
|
0
|
0
|
4239
|
|
POST
|
Anja, If you click on Edit at the top of your original post, you can then 'change' the place in which to post this.
... View more
04-27-2016
07:58 AM
|
1
|
0
|
2646
|
|
POST
|
Ernesto, Did you import arcpy into your Field Calculator? I see it in your stand alone script but I am wondering about the field calculator portion. Or is the exact script above the same you used in Field Calculator?
... View more
04-27-2016
07:54 AM
|
0
|
2
|
4239
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-04-2026 08:44 AM | |
| 4 | 07-06-2026 08:32 AM | |
| 2 | 07-05-2026 10:12 AM | |
| 1 | 02-09-2026 03:32 PM | |
| 2 | 02-05-2026 07:06 AM |
| Online Status |
Offline
|
| Date Last Visited |
Tuesday
|