|
POST
|
Robert, Is it possible to include a caption or title for each link? I have 4 photos looking each way at rail crossings that display fine, but I would like each of them to be labeled (see attachment below). I've gone over the documentation and I'm not seeing anything that will facilitate this. Am I missing something? Code (snippet of the links area): <field name="PicForwardLink" alias="Pic Forward" visible="false"/>
<field name="PicRightLink" alias="Pic Right" visible="false"/>
<field name="PicBackLink" alias="Pic Back" visible="false"/>
<field name="PicLeftLink" alias="Pic Left" visible="false"/>
</fields>
<links>
<link alias="FRA Rail Crossing Site" disablelinksifnull="false" disableinpopups="false">
<![CDATA[http://safetydata.fra.dot.gov/OfficeofSafety/PublicSite/Crossing/Crossing.aspx]]>
<icon><![CDATA[assets/images/FRA.png]]></icon>
</link>
<link alias="Looking Forward" includeinresults="true" field="PicForwardLink" disablelinksifnull="true" disableinpopups="false" >
<![CDATA[{PicForwardLink}]]>
<icon><![CDATA[assets/images/w_link_U.png]]></icon>
</link>
<link alias="Looking Right" includeinresults="true" field="PicRightLink" disablelinksifnull="true" disableinpopups="false" >
<![CDATA[{PicRightLink}]]>
<icon><![CDATA[assets/images/w_link_R.png]]></icon>
</link>
<link alias="Looking Back" includeinresults="true" field="PicBackLink" disablelinksifnull="true" disableinpopups="false" >
<![CDATA[{PicBackLink}]]>
<icon><![CDATA[assets/images/w_link_D.png]]></icon>
</link>
<link alias="Looking Left" includeinresults="true" field="PicLeftLink" disablelinksifnull="true" disableinpopups="false" >
<![CDATA[{PicLeftLink}]]>
<icon><![CDATA[assets/images/w_link_L.png]]></icon>
</link>
</links> [ATTACH=CONFIG]25305[/ATTACH] Thanks for all your great code......
... View more
06-17-2013
07:37 AM
|
0
|
0
|
2009
|
|
POST
|
Done! Thanks for the reminder. Michael, Be sure to go back to the widget download and Rate the Widget (by clicking on the number of stars you what to give it).
... View more
06-13-2013
01:26 PM
|
0
|
0
|
3382
|
|
POST
|
Ok, that makes sense and is easily dealt with. Thanks again Robert! Michael, That is just the current design/intended behavior right now as I have to open the window before I get the Pano and this is the message that is under the Pano. Thanks for the feedback I will look into changing this in the next release.
... View more
06-13-2013
01:05 PM
|
0
|
0
|
3382
|
|
POST
|
Thanks Robert!! One question, upon initial load of the Flex app and opening of the StreetView widget I receive a "No Street View Image Available or you have not yet dragged the Google Street View man onto the map to set your location" (see below). I've never had a chance to drag the man to the map, it just opens with this. If you dismiss it and then drag the man onto the map, it works great. Why would it show this message upon initial load? [ATTACH=CONFIG]25257[/ATTACH] All, Here is the next installment to my long list of widgets. I never really wanted to add to the list of several Street View Widgets, but as it's predecessors have lacked updating when new version of Flex Viewer are released and me wanting to add more features, I finally decided to do one myself. The Google Street View Widget version 3.3 for Flex Viewer 3.3 allows you to view Google Street View Panoramas in a popup window. The widget use Google Maps API Version 3 and has almost all the API options for the Street View Panorama that are available in the API configurable in the widgets xml. A lot of attention has gone into the UI (User Inferface) and UX (User Experience) of this widget and a lot of cross browser testing has been done. Tested on Safari for windows 5.1.7, Internet Explorer 9, Opera 12.15, FireFox 21.0, and Chrome 27.0.1453.110 m. Configurable features include: * hidestreetviewvwidowwhenminimized - This is a true or false value and determines if the graphic on the map and the Google Street View window are hidden when the widget is minimized. * width - The width of the popup widow that is opened. * height - The height of the popup widow that is opened. * apikey - The Google Maps API Key that you must obtain to use this widget. https://developers.google.com/maps/documentation/javascript/tutorial#api_key * addresscontrol - is a true or false value and determines if the Google Street View Address Control is visible. It has an attribute of controlposition that defines where in the popup window the control is placed. * clicktogo - is a true or false value and determines if the Google Street View will move to the location clicked. * disabledoubleclickzoom - is a true or false value and determines if the Google Street View will zoom into the location on the panorama where the user double clicks. * imagedatecontrol - is a true or false value and determines if the Google Street View will display the date of the panorama image was taken along the bottom of the window with the copyright info. * linkscontrol - is a true or false value and determines if the Google Street View will display the movement arrows and street names on the panorama for navigation purposes. * pancontrol - is a true or false value and determines if the Google Street View pan Control is visible. It has an attribute of controlposition that defines where in the popup window the control is placed. * zoomcontrol - is a true or false value and determines if the Google Street View zoom Control is visible. It has an attribute of controlposition that defines where in the popup window the control is placed and a controlstyle attribute that determines the size of the control. * All text that the widget uses is configurable in the xml to allow for internationalization of the widget. So here it is: http://www.arcgis.com/home/item.html?id=b4259b1cf73e4fa3b04e7bdf75fee29b
... View more
06-13-2013
12:50 PM
|
0
|
0
|
3382
|
|
POST
|
Thanks Chris, appreciate the tip! I like cursors too, but your original code was actually almost there. Rember that the '\\' is the Python path delimiter in Windows, and an index of [-1] will grab the last item. !PicForward!.split('\\')[-1] so regardless of how many folders deep your file is, if the field value is 'C:\temp\myimage.jpg', the code above will return 'myimage.jpg'.
... View more
06-04-2013
06:00 AM
|
0
|
0
|
1971
|
|
POST
|
Caleb, You sold me! Thanks for the help Yeah, that is strange indeed. Another good reason not to use the field calculator! I just copied and pasted your variable "\\ITDNAS\MapLibrary\Photos\RRpics\058721Nn.jp" into a field and ran this code in the python window of ArcMap and it worked perfectly. I would switch to the cursor if I were you because that worked for me.
>>> import os
>>> rows = arcpy.UpdateCursor("projected")
>>> for row in rows:
... row.name = str(os.path.basename(row.path))
... rows.updateRow(row)
...
>>>
Here's a screenshot of the attribute table afterwards [ATTACH=CONFIG]24867[/ATTACH] and here is my python window in ArcMap [ATTACH=CONFIG]24868[/ATTACH]
... View more
05-31-2013
09:32 AM
|
0
|
0
|
1971
|
|
POST
|
Caleb, Thanks for pointing out the os path syntax and using cursors suggestion. In this case I just wanted to use the field calculator in ArcMap and it is working somewhat using your solution. Problem is it's returning for example "RRpics 8712Pn.jpg" instead of "058712Pn.jpg", from "\\ITDNAS\MapLibrary\Photos\RRpics\058712Pn.jpg". Similar results for all records......kinda strange. Screenshot of Field Calculator code: [ATTACH=CONFIG]24863[/ATTACH] You can use the os.path module to return the basename (filename).
import os
Input = r'\\ITDNAS\MapLibrary\Photos\RRpics\058721Nn.jpg'
filename = os.path.basename(Input)
the filename variable will return '058721Nn.jpg' In this case it would be much better to use an update cursor than the field calculator. In fact, I don't ever use the field calculator because cursors are way easier.
import arcpy, os
fc = r'path\to\your\featureClass'
rows = arcpy.UpdateCursor(fc)
for row in rows:
row.FieldToUpdate = str(os.path.basename(row.PicForward))
rows.updateRow(row)
Make sure to change the FieldToUpdate to your field name that you want to update.
... View more
05-31-2013
09:02 AM
|
0
|
0
|
1971
|
|
POST
|
I have an attribute that contains the entire path of some photos and I would like to extract just the file name with extension. Example: Input: \\ITDNAS\MapLibrary\Photos\RRpics\058721Nn.jpg Output: 058721Nn.jpg Attempting to use the following in the field calculator, but I'm getting hung up on the escape chars (\) in the path. !PicForward!.split('\')[2] Could someone point out the correct way to go about this, please.
... View more
05-31-2013
08:23 AM
|
0
|
7
|
2345
|
|
POST
|
Robert, Thanks for your quick reply. When I say auto-populate, the drop down selection box is populated with values that are contained in that field. It seems that the issue is intermittent as it works sometimes, but other times nothing is populated in the box and it is blank. Here is an example of it working. Permitted, Producing, Proposed are all be populated from a Geodatabase. [ATTACH=CONFIG]22351[/ATTACH] Next time I run the SFV, I might just get blanks. Thank you, Matt I thought you had to use uniquevalsfromfield= to force values to appear in a dropdown?
... View more
03-04-2013
09:34 AM
|
0
|
0
|
1153
|
|
POST
|
What version of ArcGIS are you using? Can you describe the target feature class you're trying to load data into? Is it in a Topology, Geometric Network or other advanced dataset? Does it have relationship classes, if so what kind? thanks, It's ArcGIS 10.0 and there is no topologym etc. Straight SDE dataset with a bunch of domains. I think the problem stems from the XML file I'm trying to load doe snot have the exact same schema as the schema I attempting to load it into. I'll confirm once I receive the new XML file form the developer. Thanks
... View more
02-25-2013
11:19 AM
|
0
|
0
|
572
|
|
POST
|
You are using GetParameter(), which returns an arcpy Field object, not a field name -- if you set it up as a script tool. From the command line, or IDLE, etc., the parameter is always a string, but from a toolbox, ArcGIS can pass the argument as a bona-fide arcpy object. If this is a Field parameter you should use GetParameterAsText() if you want the field name as text - for example, for use in a Calculate Field expression. Python's sys.argv and arcpy.GetParameterAsText are fairly equivalent, although I am pretty sure GetParameterAsText can handle a longer string. (In code examples, you usually see GetParameterAsText because this allows the script to used easily inside or outside ArcGIS.) Note, there is a new tool in 10x that does DMS to DD conversion, at least many of the conversions you'd want: ConvertCoordinateNotation_management. (I had been asking for this tool since the 1980's!) What data types are you passing as parameters? You may want to consider using astext instead of parameter. Code: arcpy.GetParameterAsText() I'd wager your problem as more to do with your latField variable than your latTemp variable. Matt and Curtis, Thank you very much for pointing this out to me. Yes, it now works as expected. Thanks again. Also, Curtis thanks for pointing out the new tool to do this and much much more.
... View more
02-25-2013
10:49 AM
|
0
|
0
|
1571
|
|
POST
|
I assume it is this line you are having the problem with? arcpy.CalculateField_management(fc, latTemp, latField, "PYTHON") Have you tried doing that manually in ArcMap to see if your results vary? Matt, Yes, that's the line. I was successful running the entire script using the same test data set before converting to a script tool. Seems to be behaving differently in the script tool. Strange that if the latTemp filed is already in the attribute table it will work.
... View more
02-25-2013
09:12 AM
|
0
|
0
|
1571
|
|
POST
|
Anyone tell me why this code is returning this error? It creates the latTemp field, and I can see it after it crashes, but it will not calculate it. ERROR: <class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid. ERROR 000728: Field latSTR does not exist within table Failed to execute (CalculateField). Failed to execute (ConvertDMS2DD). Failed at Mon Feb 25 11:25:18 2013 (Elapsed Time: 9.00 seconds) CODE: import arcpy, sys, os arcpy.env.overwriteOutput = 1 # select the feature class fc = arcpy.GetParameter(0) # select the latitude field to convert latField2 = arcpy.GetParameter(1) latField = "%s%s%s" % ('!', latField2, '!') arcpy.AddMessage("latField2 = " + str(latField2) +" latField = " +latField) lonField2 = arcpy.GetParameter(2) lonField = "%s%s%s" % ('!', lonField2, '!') arcpy.AddMessage("lonField2 = " + str(lonField2) +" lonField = " +lonField) # set lattitude output field latFieldDD = "latDD" # set longitude output field lonFieldDD = "lonDD" # set temp lattitude field, used to store lat field as string used in function latTemp = "latSTR" # set temp longitude field, used to store lon field as string used in function lonTemp = "lonSTR" latExp = "lat(%s%s%s)" % ('!',latTemp,'!') codeblockLAT = """def lat(dms): latdeg = float(dms[0:2]) latmin = float(dms[2:4]) latsec = float(dms[4:6]) latdd = latdeg + (latmin / 60) + (latsec / 3600) return latdd""" lonExp = "lon(%s%s%s)" % ('!',lonTemp,'!') codeblockLON = """def lon(dms): londeg = float(dms[0:3]) lonmin = float(dms[3:5]) lonsec = float(dms[5:7]) londd = (londeg + (lonmin / 60) + (lonsec / 3600)) * -1 return londd""" #copy the lat numeric to a string arcpy.AddField_management(fc, latTemp, "TEXT", "", "", 16) arcpy.AddField_management(fc, latFieldDD, "FLOAT", 16, 6, 16) arcpy.AddMessage("added lat fields: %s and %s" % (latTemp, latFieldDD)) #copy the lon numeric to a string arcpy.AddField_management(fc, lonTemp, "TEXT", "", "", 16) arcpy.AddField_management(fc, lonFieldDD, "FLOAT", 16, 6, 16) arcpy.AddMessage("added lon fields: %s and %s" % (lonTemp, lonFieldDD)) # do calculations arcpy.CalculateField_management(fc, latTemp, latField, "PYTHON") arcpy.CalculateField_management(fc, latFieldDD, latExp, "PYTHON", codeblockLAT) arcpy.DeleteField_management(fc, latTemp) arcpy.CalculateField_management(fc, lonTemp, lonField, "PYTHON") arcpy.CalculateField_management(fc, lonFieldDD, lonExp, "PYTHON", codeblockLON) arcpy.DeleteField_management(fc, lonTemp)
... View more
02-25-2013
08:32 AM
|
0
|
5
|
2031
|
|
POST
|
I am attempting to load data into a feature class schema that resides in SDE. After right clicking on the empty feature class. I select Load>Load XML recordset document and it displays an error "Cannot lad xml recordset to non simple feature class or table in ArcCatalog." How do I interpret this error message? What is a "non simple feature class? Are there other methods that I'm not aware of to accomplish loading data into a schema only feature class?
... View more
02-22-2013
09:18 AM
|
0
|
2
|
2870
|
|
POST
|
Unfortunately, you can't order layers any way you want. Some layers are drawn as graphics by the browser, so they're always on top. Map Notes, shapefiles and CSVs added to the map, feature services all get drawn by the browser and will display over map services and wms services. You can order all the 'graphic layers' within the group of layers drawn by the browser and order the map services within the group of map services. Thanks, Mike Thanks for the explanation Mike. I'd say this limits the functionality of using AGO as an online interactive mapping platform. I guess I'm a little less than impressed with the flexibility of AGO. Mike
... View more
01-02-2013
08:38 AM
|
1
|
0
|
2771
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-29-2012 10:22 AM | |
| 2 | 09-17-2018 05:38 AM | |
| 1 | 03-23-2016 06:25 AM | |
| 1 | 06-30-2016 09:13 AM | |
| 1 | 11-23-2015 08:40 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|