POST
|
Hi, I'm trying to use the FV 3.1, and with that using a local geocode-service. When I use it in the header, it's like it's dropping off the earth, but if I use the same geocode-service in the locator-widget, it works like a charm. I've added the locator that I've used as a geocode-package, hope somebody can help.
... View more
12-18-2012
03:52 AM
|
0
|
20
|
1430
|
POST
|
Hi Kevin Well, back from EUC in Oslo and a well-deserved vacation... I've got the IT-dep. to make me a new server. I've then installed the desktop first, then the server, then the base-files with all the python modules you told about in another message, created a script like this: import os
import arcpy
import openpyxl
class Toolbox(object):
def __init__(self):
"""Define the toolbox (the name of the toolbox is the name of the
.pyt file)."""
self.label = "Toolbox"
self.alias = ""
# List of tool classes associated with this toolbox
self.tools = [Tool]
class Tool(object):
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "Tool"
self.description = ""
self.canRunInBackground = False
def getParameterInfo(self):
"""Define parameter definitions"""
param0 = arcpy.Parameter(
displayName = 'Filename',
name = 'filename',
datatype = 'String',
parameterType = 'Required',
direction = 'Input')
param0.value = 'TestFile'
params = [param0]
return params
def isLicensed(self):
"""Set whether tool is licensed to execute."""
return True
def updateParameters(self, parameters):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
return
def updateMessages(self, parameters):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
def execute(self, parameters, messages):
"""The source code of the tool."""
fn = parameters[0].value
wb = openpyxl.Workbook()
filename = 'C:/arcgisserver/directories/arcgisoutput/' + fn + '.xlsx'
arcpy.AddMessage('Filename : %s' % filename)
wb.save(filename)
return
And it works like a charm... All I have to do now i set up my server and move all my services from one server to another, and make my scripts run. I hope for the best. Thanks for all you help.
... View more
10-22-2012
02:10 AM
|
0
|
0
|
1773
|
POST
|
Hi Kevin This starts to give me a headache... so I uninstalled all ArcGIS and python, and removed all related to ArcGIS and Python in the registry. Installed only the Server this time, so I'm only running 64bit on the server now, so far so good. When I look in the registry there is only reference to python in these places : HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\Python10.1 = C:\Python27\ HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath = C:\Python27\ArcGISx6410.1\ The python (sys.version) is : 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] I installed the openpyxl module and the path to that on the server (os.path.dirname(openpyxl.__file__) is : C:\Python27\ArcGISx6410.1\lib\site-packages\openpyxl-1.5.8-py2.7.egg\openpyxl Now I've made a python toolbox like this : import arcpyimport os, sys
import datetime, time
import uuid
from arcpy import env
import openpyxl
class Toolbox(object):
def __init__(self):
"""Define the toolbox (the name of the toolbox is the name of the
.pyt file)."""
self.label = "Toolbox"
self.alias = ""
# List of tool classes associated with this toolbox
self.tools = [Tool]
class Tool(object):
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "Tool"
self.description = ""
self.canRunInBackground = False
def getParameterInfo(self):
"""Define parameter definitions"""
selectOwners = arcpy.Parameter(
displayName = 'This is test 1',
name = 'owner_selected',
datatype = 'Boolean',
parameterType = 'Optional',
direction = 'Input')
selectResidents = arcpy.Parameter(
displayName = 'This is test 2',
name = 'residents_selected',
datatype = 'Boolean',
parameterType = 'Optional',
direction = 'Input')
params = [selectOwners, selectResidents]
return params
def isLicensed(self):
"""Set whether tool is licensed to execute."""
return True
def updateParameters(self, parameters):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
return
def updateMessages(self, parameters):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
def execute(self, parameters, messages):
"""The source code of the tool."""
scriptPath = sys.path[0]
outfolder = os.path.join(scriptPath, 'Output')
arcpy.env.scratchWorkspace = scriptPath
wb = openpyxl.Workbook()
filename = '_ags_' + str(uuid.uuid4()) + '.xlsx'
arcpy.AddMessage('Filename : %s' % os.path.join(outfolder, filename))
wb.save(os.path.join(outfolder, filename))
Running this from the ArcMap on a remote computer gives me a file in the Output folder where the toolbox is located. It's running and doing what it should do. I'm then trying to publish the result as a Geoprocess on my reinstalled server, this is where it breaks down. I'm setting up the parameters, the tools and the Item Description, running Analyze = nothing... pressing Publish and it's running and running and running and running, I think you get it... It's been running for over 30 minutes and nothing. [ATTACH=CONFIG]18305[/ATTACH] As of now, I have to install the 32 bit python and the ArcMap again, so that my other gp-services will run again. Do you have any ideas ? I'm willing to show it live to you or one of your colleagues on the ESRI EU UC in Oslo this monday or tuesday, is that possible ?? Thanks
... View more
10-09-2012
11:33 AM
|
0
|
0
|
1773
|
POST
|
Hi Kevin Ok, I've been trying to get this to work most of sunday and monday as well. Got the Python up and running in 64 bit (killed my other scripts), but I'll look into that later. If I'm using the openpyxl module, all I get in ArcMap is a red cross over the toolbox. I then tried to make a new toolbox like this. import os
import arcpy
import sys
import xlwt
class Toolbox(object):
def __init__(self):
"""Define the toolbox (the name of the toolbox is the name of the
.pyt file)."""
self.label = "Toolbox"
self.alias = ""
# List of tool classes associated with this toolbox
self.tools = [Tool]
class Tool(object):
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "Tool"
self.description = ""
self.canRunInBackground = False
def getParameterInfo(self):
"""Define parameter definitions"""
params = None
return params
def isLicensed(self):
"""Set whether tool is licensed to execute."""
return True
def updateParameters(self, parameters):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
return
def updateMessages(self, parameters):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
def execute(self, parameters, messages):
"""The source code of the tool."""
arcpy.AddMessage('Version : %s' % sys.version)
arcpy.AddMessage('Path to module : %s' % os.path.dirname(xlwt.__file__))
arcpy.AddMessage('End')
print 'Version : %s' % sys.version
print 'Path to module : %s' % os.path.dirname(xlwt.__file__)
print 'End'
Running this in the 64 bit idle I get this: Version : 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] Path to module : c:\Python27\ArcGISx6410.1\lib\site-packages\xlwt-0.7-4-py2.7.egg\xlwt End When i run it from ArcMap I get this: Version : 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] Path to module : C:\Python27\ArcGIS10.1\lib\site-packages\xlwt-0.7.4-py2.7.egg\xlwt End But when I then share the result as a Service, it never finishes, it keeps on running at 175kb. This is my Pythonpath in the System Properties : C:\Python27\ArcGISx6410.1;C:\Python27\ArcGISx6410.1\DLLs;C:\Python27\ArcGISx6410.1\lib;C:\Python27\ArcGISx6410.1\lib\lib-tk;C:\Python27\ArcGISx6410.1\Scripts The PythonDir in HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ESRI\Python10.1 is C:\Python27\ The installpath in HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\2.7\InstallPath is C:\Python27\ArcGIS10.1\ Is that correct ?
... View more
10-08-2012
04:51 AM
|
0
|
0
|
1773
|
POST
|
Hi, thanks, but i'm sure that i'm running 32 bit python, and the reason is that the first time i installed the server i installed the 64 bit python. And i sure that i tried to make a gp-process on a 32 bit computer with arcmap basic installed, and then my 64 bit server would not run it, thats why i started over and installed 32 bit python. But i'm willing to try to install the 64 bit version of python again, to see if this will work. First thing monday morning i'm trying to reinstall the 64 bit python. I'm crossing my fingers that my other gp-process still will run without problems. But then I can't use the installed arcmap basic on the server to publish some of my scripts, because that will only run 32 bit python. will it not ??? I'll wait with the reinstall until i've gotten a response on this. Thanks Mads
... View more
10-05-2012
12:05 PM
|
0
|
0
|
1773
|
POST
|
Hi Andrew, That didn't work, I've come as far as to think it has something to do with the 3. party module, openpysl. I don't think it gets imported when the tool runs from the server. regards Mads
... View more
10-05-2012
03:04 AM
|
0
|
0
|
464
|
POST
|
Hi I'm trying to create a GP-service that uses the python openpyxl 3. party module. When i'm running it from arcmap(Standard), it works like a charm, publich the result as gp-service on the server. When i then sets up the flexviewer 3.0 using the gp-widget - i get an error 000816 tool is not valid, and nothing else. import osimport arcpy import uuid import openpyxl class Toolbox(object): def __init__(self): """Define the toolbox (the name of the toolbox is the name of the .pyt file).""" self.label = "Toolbox" self.alias = "" # List of tool classes associated with this toolbox self.tools = [Tool] class Tool(object): def __init__(self): """Define the tool (tool name is the name of the class).""" self.label = "Tool" self.description = "" self.canRunInBackground = False def getParameterInfo(self): """Define parameter definitions""" param0 = arcpy.Parameter( displayName="FileName", name="filename", datatype="String", parameterType="Required", direction="Input") param0.value = 'OpenPyXl' params = [param0] return params def isLicensed(self): """Set whether tool is licensed to execute.""" return True def updateParameters(self, parameters): """Modify the values and properties of parameters before internal validation is performed. This method is called whenever a parameter has been changed.""" return def updateMessages(self, parameters): """Modify the messages created by internal validation for each tool parameter. This method is called after internal validation.""" return def execute(self, parameters, messages): """The source code of the tool.""" wb = openpyxl.Workbook(optimized_write=True) ws = wb.create_sheet() wb_file = r'C:\arcgisserver\directories\arcgisoutput\_ags_' + str(uuid.uuid4()) + '_' + parameters[0].value + '.xlsx' ## arcpy.AddMessage(wb_file) wb.save(wb_file) this is the python toolbox i'm trying to publish, it's quite simple, the only thing it does is making a xlsx file in the c:\arcgisserver\directories\arcgisoutput folder with the name _ags_UUID_OpenPyXl.xlsx The output folder is set up in the Datastore on the server. I've tried to copy the openpyxl folder from the python folder to the same folder as the python toolbox, no luck at that. I've tried to add a sys.path.append and the path to the openpyxl folder, no luck at that. somebody please help me, my larger tool wont work before i've solved this problem.
... View more
10-05-2012
12:17 AM
|
0
|
9
|
3556
|
POST
|
Hi I'm trying to create a GP-service that uses the python openpyxl 3. party module. When i'm running it from arcmap(Standard), it works like a charm, publich the result as gp-service on the server. When i then sets up the flexviewer 3.0 using the gp-widget - i get an error 000816 tool is not valid, and nothing else. import osimport arcpy
import uuid
import openpyxl
class Toolbox(object):
def __init__(self):
"""Define the toolbox (the name of the toolbox is the name of the
.pyt file)."""
self.label = "Toolbox"
self.alias = ""
# List of tool classes associated with this toolbox
self.tools = [Tool]
class Tool(object):
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "Tool"
self.description = ""
self.canRunInBackground = False
def getParameterInfo(self):
"""Define parameter definitions"""
param0 = arcpy.Parameter(
displayName="FileName",
name="filename",
datatype="String",
parameterType="Required",
direction="Input")
param0.value = 'OpenPyXl'
params = [param0]
return params
def isLicensed(self):
"""Set whether tool is licensed to execute."""
return True
def updateParameters(self, parameters):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
return
def updateMessages(self, parameters):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
def execute(self, parameters, messages):
"""The source code of the tool."""
wb = openpyxl.Workbook(optimized_write=True)
ws = wb.create_sheet()
wb_file = r'C:\arcgisserver\directories\arcgisoutput\_ags_' + str(uuid.uuid4()) + '_' + parameters[0].value + '.xlsx'
## arcpy.AddMessage(wb_file)
wb.save(wb_file)
this is the python toolbox i'm trying to publish, it's quite simple, the only thing it does is making a xlsx file in the c:\arcgisserver\directories\arcgisoutput folder with the name _ags_UUID_OpenPyXl.xlsx The output folder is set up in the Datastore on the server. I've tried to copy the openpyxl folder from the python folder to the same folder as the python toolbox, no luck at that. I've tried to add a sys.path.append and the path to the openpyxl folder, no luck at that. somebody please help me, my larger tool wont work before i've solved this problem.
... View more
10-04-2012
01:17 PM
|
0
|
3
|
713
|
POST
|
Hi, is it possible to set the legend for the Web Print Task to use the Map Extent Option, so it only shows those classes that are currently visibly on the map ? If any has the solution for this, I would be glad to see something written with screendumps in it. 😉 Thanks Mads Gren Denmark
... View more
08-21-2012
05:08 AM
|
0
|
1
|
2075
|
POST
|
Hi Ben I've found a glitch in your widget, if I put a point in your map, delete it right away, I can then move one other point of my choice, I've moved some points together to show it.
... View more
05-21-2012
09:27 AM
|
0
|
0
|
583
|
POST
|
Hi Dave, I'v just installed the PreRelease version of server 10.1, and is looking at the FlexViewer 3.0 Beta, so i don'n know at this moment when i'll get the time to upgrade my code to 2.5, but when i'll look at it for the 3.0 i'll sure take the 2.5 into consideration. Hi Scott, Strange problem, not one i've run into myself, but I think that I've read something about it somewhere, I'll try to find it and see if I can come up with some ideas. Mads
... View more
03-07-2012
09:28 PM
|
0
|
0
|
562
|
POST
|
Hi Gabirel Sorry, but no, I've decided to return to Adobe FLEX and the FLEX viewer. Mads
... View more
01-10-2012
04:18 AM
|
0
|
0
|
303
|
POST
|
Hi Ben I had the same problem, but I have solved the problem, my problem was the connection to the data. If you try to publish the mxd to the server, it will tell you if there is problems with the connection. If you get an error like this, it's wrong [ATTACH=CONFIG]9770[/ATTACH] Try to resolve the connection error, and i think that is that. It worked for me. Mads
... View more
10-28-2011
01:44 AM
|
0
|
0
|
294
|
POST
|
Hi again I'm using ArcGIS server 10, that might be the problem, but I don't know. Mads
... View more
10-18-2011
11:32 PM
|
0
|
0
|
415
|
POST
|
Hi, I've managed to use a secure wms in FlexViewer 2.4. <layer label="KMS Høje målebordsblade" type="WMS" visible="true"
url="http://kortforsyningen.kms.dk/?servicename=topo20_hoeje_maalebordsblade&client=ArcGIS&request=GetCapabilities&bbox=435464,6234974,480777,6295447&login=XXXX&password=YYYY&"
skipgetcapabilities="true" version="1.1.1"
visiblelayers="dtk_hoeje_maalebordsblade"
wkid="25832"/> the URL includes the login and password, and if you can take the url and put it into a browser and get access to the xml-info of the WMS, then the rest should be straight on. Find the name of the layer you want to use, and put the name into visiblelayers="" and if you have more than one layer, seperate them by using visiblelayers="name1,name2,name3" remember no spaces. Hope it helps. Mads
... View more
10-05-2011
01:56 AM
|
0
|
0
|
110
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|