This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def selectUTMZone(self, longitude, latitude): | |
''' | |
return UTM/UPS Zone spatial reference based on longitude and latitude | |
* Datum is GCS_WGS_1984 | |
Based on gis.stackexchange.com referenced on 1/24/2017: | |
http://gis.stackexchange.com/questions/13291/computing-utm-zone-from-lat-long-point | |
Inputs: | |
longitude: latitude (assume GCS WGS 1984) of UTM zone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import traceback | |
except arcpy.ExecuteError: | |
# Get the tool error messages | |
msgs = arcpy.GetMessages() | |
arcpy.AddError(msgs) | |
print(msgs) | |
except: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
''' | |
------------------------------------------------------------------------------ | |
Copyright 2016 Esri | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
''' | |
------------------------------------------------------------------------------ | |
Copyright 2016 Esri | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def GetApplication(): | |
'''Return app environment as ARCMAP, ARCGIS_PRO, OTHER''' | |
try: | |
from arcpy import mp | |
return "ARCGIS_PRO" | |
except ImportError: | |
try: | |
from arcpy import mapping | |
mxd = arcpy.mapping.MapDocument("CURRENT") | |
return "ARCMAP" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
''' | |
------------------------------------------------------------------------------ | |
Copyright 2016 Esri | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |