POST
|
Okay, here is the solution I came up with. Thought I should post it seeing how many people have looked at this thread. It may not be the cleanest out there, but it works. I tried to clean it up in word before copying and pasting it so the tabs may be a bit out of whack... /// Listen for Click Events
map.on("load", function() {
map.on("click", showCoordinates);
});
function showCoordinates(evt) {
/// Project Map Coords (web mercator) in geographic (lat, long)
var mp = webMercatorUtils.webMercatorToGeographic(evt.mapPoint);
var pt_x = mp.x.toFixed(5);
var pt_y = mp.y.toFixed(5);
var longLat = pt_x + ", " + pt_y;
var fdName = null;
var rFire = null;
var pcCF = null;
var pcDE = null;
if(evt.graphic)
{
pcDE = evt.graphic.attributes.PC_DE;
fdName = evt.graphic.attributes.FD_NAME;
rFire = evt.graphic.attributes.RESPONDING_FS;
pcCF = evt.graphic.attributes.PC_CF;
}
else{
alert("Oops, your point did not register. Please try again.");
return;
}
console.log("Print PC DE: ", pcDE);
console.log("Print PC CF: ", pcCF);
map.graphics.clear();
var ptClick = esri.geometry.geographicToWebMercator(new esri.geometry.Point(pt_x, pt_y));
var ptClickSMS = new PictureMarkerSymbol(
'http://static.arcgis.com/images/Symbols/Basic/WhiteFlag.png',
35,
35
);
var font = new Font(
"12pt",
Font.STYLE_NORMAL,
Font.VARIANT_NORMAL,
Font.WEIGHT_BOLD,
"Calibri"
);
var textSymbol = new TextSymbol(
longLat,
font,
new Color("#000000")
);
textSymbol.setOffset(80,12);
var ptGraphic = new esri.Graphic(ptClick, ptClickSMS);
map.graphics.add(ptGraphic);
map.graphics.add(new Graphic(ptClick));
// map.graphics.add(new Graphic(ptClick, textSymbol));
/// JSON Object ///
var pcObj = {"nLong":pt_x, "nLat":pt_y, "nPC_DE": pcDE, "nPC_CF": pcCF, "nFD": fdName, "nFS": rFire};
// Call to Send PC JSON Object
sendData(pcObj);
/// Display JSON Object on Screen via Info Text in Lower LeftHand Corner
var pcValues = "Long/Lat = " + pcObj.nLong + ", " + pcObj.nLat + " | PC (PERS): " + pcObj.nPC_DE + ", PC (COMM): " + pcObj.nPC_CF + " | FD: " + pcObj.nFD + ", FS: " + pcObj.nFS;
dom.byId("info").innerHTML = pcValues;
}
... View more
02-25-2016
10:58 AM
|
0
|
0
|
707
|
POST
|
Rene, oddly enough I finally got it working by removing the line in question. Once I removed the following line, everything seemed to work correctly. map.popup.resize(200, 75);
... View more
02-27-2015
01:50 PM
|
0
|
0
|
764
|
POST
|
Rene, I'm still struggling with this one. I have modified my map code attempting to follow your examples. I am currently not getting any visual error when the web browser searches for the address, however nothing appears to be happening. I copied my code and pasted it below. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" /> <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices--> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>PC Map</title> <link rel="stylesheet" href="http://js.arcgis.com/3.11/esri/css/esri.css"/> <style> html, body, #mapDiv { padding: 0; margin: 0; height: 100%; } #BasemapToggle { position: absolute; top: 20px; right: 70px; z-index: 2; } #search { display: block; position: absolute; z-index: 2; top: 20px; left: 65px; } #HomeButton { position: absolute; z-index: 2; top: 95px; left: 20px; z-index: 50; } #logo { display: block; position: absolute; top: 16px; right: 10px; z-index: 3; width:45px; height:220px; background:url(http://fbms2091/flexviewers/_supportDocs/icons/pcLegend_small.png) top right no-repeat; } </style> <script src="http://js.arcgis.com/3.11/"></script> <script> var map, toggle, geocoder, locator; require([ "esri/urlUtils", "esri/map", "esri/dijit/BasemapToggle", "esri/dijit/Geocoder", "esri/dijit/HomeButton", "esri/dijit/Scalebar", "esri/graphic", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/Font", "esri/symbols/TextSymbol", "dojo/_base/array", "esri/geometry/screenUtils", "dojo/dom", "dojo/dom-construct", "dojo/_base/Color", "esri/dijit/InfoWindowLite", "esri/InfoTemplate", "esri/layers/FeatureLayer", "dojo/query", "esri/tasks/locator", "dojo/domReady!" ], ///Main Map function (urlUtils, Map, BasemapToggle, Geocoder, HomeButton, Scalebar, Graphic, SimpleMarkerSymbol, Font, TextSymbol, arrayUtils, screenUtils, dom, domConstruct, Color, InfoWindowLite, InfoTemplate, FeatureLayer, query, Locator) ///Map Frame Extent { map = new Map("mapDiv", { basemap: "satellite", center: [-112.44822, 42.87543], zoom: 12 }); ///Add Basemap Toggle toggle = new BasemapToggle({ map: map, basemap: "topo" }, "BasemapToggle"); toggle.startup(); ///Add GeoCoder geocoder = new Geocoder({ arcgisGeocoder: { placeholder: "Enter Address" }, autoComplete: true, map: map }, dom.byId("search")); geocoder.startup(); geocoder.on("select", showLocation); ///Add HomeButton var home = new HomeButton({ map: map }, "HomeButton"); home.startup(); ///Add Scalebar var scalebar = new Scalebar({ map: map, scalebarUnit: "english" }); ///Add Address Location to Map function showLocation(evt) { map.graphics.clear(); var point = evt.result.feature.geometry; var ptSymbol = new SimpleMarkerSymbol() .setStyle("square") .setColor(new Color([255,0,0,0.5])); var ptGraphic = new Graphic(point, ptSymbol); map.graphics.add(ptGraphic); map.infoWindow.setTitle("Search Result"); map.infoWindow.setContent(evt.result.name); map.infoWindow.show(evt.result.feature.geometry); }; ///Popup Window var popup = new InfoWindowLite(null, domConstruct.create("div", null, null, map.root)); popup.startup(); map.setInfoWindow(popup); var template = new InfoTemplate(); template.setTitle("<b>FD: ${GRADID} - ${FD_NAME}</b>"); template.setContent("<p> BUFFER TYPE: ${BUFFERTYPE} <br/>" + "PC (COM): ${PC_CF} <br/>" + "PC (PER): ${PC_DE} <br/>" + "FIRE STATIONS: ${RESPONDING_FS} <br/>" + "</p>"); ///Add PC Layer to Map var featureLayer = new FeatureLayer("http://arcgis.idfbins.com/arcgis/rest/services/FB_ProtectionClass/proClass_cScheme/MapServer/0", { mode: FeatureLayer.MODE_ONDEMAND, opacity: 0.4, infoTemplate:template, outFields: ["BUFFERTYPE","GRADID","PC_CF","PC_DE","RESPONDING_FS","FD_NAME"] }); map.addLayer(featureLayer); map.popup.resize(200, 75); ///Set Locator Settings locator = new Locator("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"); locator.on("address-to-locations-complete", showResults); ///Get URL Parameters map.on("load", function() { // get the URL parameters var params = urlUtils.urlToObject(document.location.href); // check that parameters exist in the URL if (params.query && params.query.address) { var address = params.query.address; map.graphics.clear(); // build address params var addressParams = { "SingleLine": params.query.address }; locator.outSpatialReference = map.spatialReference; var options = { address: addressParams, outFields: ["Loc_name"] }; locator.addressToLocations(options); } }); function locate() { map.graphics.clear(); var address = { "SingleLine": dom.byId("address").value }; locator.outSpatialReference = map.spatialReference; var options = { address: address, outFields: ["Loc_name"] }; locator.addressToLocations(options); } function showResults(evt) { var symbol = new SimpleMarkerSymbol(); var infoTemplate = new InfoTemplate( "Location", "Address: ${address}<br />Score: ${score}<br />Source locator: ${locatorName}" ); symbol.setStyle(SimpleMarkerSymbol.STYLE_SQUARE); symbol.setColor(new Color([153,0,51,0.75])); var geom; arrayUtils.every(evt.addresses, function(candidate) { console.log(candidate.score); if (candidate.score > 80) { console.log(candidate.location); var attributes = { address: candidate.address, score: candidate.score, locatorName: candidate.attributes.Loc_name }; geom = candidate.location; var graphic = new Graphic(geom, symbol, attributes, infoTemplate); //add a graphic to the map at the geocoded location map.graphics.add(graphic); //add a text symbol to the map listing the location of the matched address. var displayText = candidate.address; var font = new Font( "14pt", Font.STYLE_NORMAL, Font.VARIANT_NORMAL, Font.WEIGHT_BOLD, "Helvetica" ); var textSymbol = new TextSymbol( displayText, font, new Color("#666633") ); textSymbol.setOffset(0,8); map.graphics.add(new Graphic(geom, textSymbol)); return false; //break out of loop after one candidate with score greater than 80 is found. } }); if ( geom !== undefined ) { map.centerAndZoom(geom, 12); } } }); </script> </head> <body> <div id="search"></div> <div id="HomeButton"></div> <div id="logo"></div> <div id="mapDiv"></div> <div id="BasemapToggle"></div> </body> </html>
... View more
02-19-2015
03:00 PM
|
0
|
0
|
764
|
POST
|
Rene, I'm fairly new to JavaScript. I had been customizing the Flex Viewer in the past by tweaking the xml files. However now I am needing to make the transition to JavaScript API. While the gist of what you are saying is starting to come together I am struggling to figure out exactly what to write and were to place it. Can I send you my current code or post it and get some more in-depth advice on what to write and were to place it? Thanks,
... View more
02-18-2015
12:44 PM
|
0
|
10
|
1853
|
POST
|
Okay, so looking at the code example I beginning to see how I could do this for an attribute search, but what about an address search? The sample code shows the url hardcoded. How do I type it so that it knows to automatically grab the URL string that is typed into web browser? The sample code: var myObject = esri.urlToObject(http://www.myworld.com?state_name=Ohio&city_name=Akron); I'm thinking that I would add this code, but modified somehow to capture the original URL string, then pas the myObject variable to either the Locator or Geocode widget. Does this sound correct or am I making it more difficult than it needs to be? Or, if I typed the following into the web browser: http://www.myworld.com?search=123 Main St, Pocatello, Idaho would this be automatically passed to the search/geocode widget like it was in the Flex Viewer because of the 'search=' text or do I need a different term instead of 'search=' ? Or do I need to manually write code to pass the 'search=' variable to the geocode widget within the javascript doc? I miss the well documented Flex Viewer website... Thanks again for your assistance.
... View more
02-18-2015
09:59 AM
|
0
|
12
|
1853
|
POST
|
I am using the latest version of the ESRI JavaScript API to build a basemap template. What I would like to do is pass an address parameter into my map so that when it opens the map is zoomed into the address in question. I am currently doing this with the Viewer for Flex using the following code: Viewer for Flex: (link not active) http://myserver.com/flexviewers/actmap/index.html?search=15 Fordham St, Pocatello, Idaho I came across this example for ArcGIS Online: http://www.arcgis.com/home/webmap/viewer.html?find=380 new york st,redlands,ca How do I do this with the JavaScript API for ESRI ArcGIS? Do I need to define parameters within the code or can I simply pass URL parameters to the map like in the above examples to the geocode or locator widgets? Thanks in advance,
... View more
02-18-2015
09:38 AM
|
0
|
16
|
10497
|
DOC
|
I think he is referring to something like the tools Arc2Earth has for desktop software. http://www.arc2earth.com/software/arc2earth/ It would be awesome if someone could make this possible for web mapping platforms such as the old Viewer for Flex or the new WAB.
... View more
02-02-2015
09:41 AM
|
0
|
0
|
12742
|
POST
|
I always distrust line continuation flags (especially as they are deprecated in python...) When I have a long string argument, I prefer to build it from a list Just because it is easier for me to see and debug, and because it gets re-assembled as I expect. for example fieldsLyrList = [
"KEY KEY VISIBLE NONE;",
"INSURED INSURED HIDDEN NONE;",
"LINE LINE VISIBLE NONE;",
"LATITUDE LATITUDE HIDDEN NONE;",
"LONGITUDE LONGITUDE HIDDEN NONE;",
"CONFIDENCE CONFIDENCE HIDDEN NONE;",
"SOURCE SOURCE HIDDEN NONE;",
"NOTES NOTES HIDDEN NONE;",
"PHYSADDRESS PHYSADDRESS HIDDEN NONE;",
"PHYSCITY PHYSCITY HIDDEN NONE;",
"BLDGTYPE BLDGTYPE HIDDEN NONE;",
"CSTR CSTR HIDDEN NONE;",
"CSTRYR CSTRYR HIDDEN NONE;",
"SIZE SIZE HIDDEN NONE;",
"EXPDATE EXPDATE HIDDEN NONE;",
"AGCY AGCY HIDDEN NONE;",
"AGT AGT HIDDEN NONE;",
"CIS CIS HIDDEN NONE;",
"FORMAE FORMAE HIDDEN NONE;",
"FORMC FORMC HIDDEN NONE;",
"VALAE VALAE HIDDEN NONE;",
"VALC VALC HIDDEN NONE;",
"DED DED HIDDEN NONE;",
"LIM LIM HIDDEN NONE;",
"PC PC HIDDEN NONE;",
"CORRECTPC CORRECTPC HIDDEN NONE;",
"ANOMALIES ANOMALIES HIDDEN NONE;",
"DISRKEY DISRKEY VISIBLE NONE"
]
fieldsLyr = ''.join(fieldsLyrList) FYI, When I used a list I received the following error: [INDENT]PYTHON ERRORS: Traceback Info: File "C:/arcgisserver/gisData/services/claimsMap/toolsNscripts/runClaimsMap_v2.py", line 125, in <module> arcpy.MakeFeatureLayer_management(gcPolicies, "gcPolicies_lyr", queryLyr, "", fieldsLyr) Error Info: <type 'exceptions.RuntimeError'>: Object: Error in executing tool[/INDENT] However when I dropped the commas and change the list to a continued line using () it ran up to the FC to FC conversion point and then gave me the same old error... I was looking up reference for the line continuation issue and a Python wedsite implied that you can use the () instead of the \ character to continue long lines. Are their plans to drop support for all line continuation characters after 2.7 or just the '\' one in question?
... View more
06-12-2014
08:07 AM
|
0
|
0
|
653
|
POST
|
I always distrust line continuation flags (especially as they are deprecated in python...) When I have a long string argument, I prefer to build it from a list Just because it is easier for me to see and debug, and because it gets re-assembled as I expect. for example fieldsLyrList = [
"KEY KEY VISIBLE NONE;",
"INSURED INSURED HIDDEN NONE;",
"LINE LINE VISIBLE NONE;",
"LATITUDE LATITUDE HIDDEN NONE;",
"LONGITUDE LONGITUDE HIDDEN NONE;",
"CONFIDENCE CONFIDENCE HIDDEN NONE;",
"SOURCE SOURCE HIDDEN NONE;",
"NOTES NOTES HIDDEN NONE;",
"PHYSADDRESS PHYSADDRESS HIDDEN NONE;",
"PHYSCITY PHYSCITY HIDDEN NONE;",
"BLDGTYPE BLDGTYPE HIDDEN NONE;",
"CSTR CSTR HIDDEN NONE;",
"CSTRYR CSTRYR HIDDEN NONE;",
"SIZE SIZE HIDDEN NONE;",
"EXPDATE EXPDATE HIDDEN NONE;",
"AGCY AGCY HIDDEN NONE;",
"AGT AGT HIDDEN NONE;",
"CIS CIS HIDDEN NONE;",
"FORMAE FORMAE HIDDEN NONE;",
"FORMC FORMC HIDDEN NONE;",
"VALAE VALAE HIDDEN NONE;",
"VALC VALC HIDDEN NONE;",
"DED DED HIDDEN NONE;",
"LIM LIM HIDDEN NONE;",
"PC PC HIDDEN NONE;",
"CORRECTPC CORRECTPC HIDDEN NONE;",
"ANOMALIES ANOMALIES HIDDEN NONE;",
"DISRKEY DISRKEY VISIBLE NONE"
]
fieldsLyr = ''.join(fieldsLyrList) Thanks, that's an interesting idea. I hadn't thought about using a list. I did get it to work going about it the 'extra mile' method. I added new temp text fields, then populating them prior to the FC to FC conversion, then adding another set of date fields and populating them using the newly created text fields, similar to what Ian suggested. Its extra code, but it appears to be working. I'll give your method a try to see if that can reduce the amount of code I have.
... View more
06-12-2014
07:25 AM
|
0
|
0
|
653
|
POST
|
That was my suggestion yes, but now looking at it again, I'm doubting it will do anything. It seems to be hanging up on the fact that it is a date field. I really have no experience using them, so not sure how best to handle it. Would it be possible to create a new text field to store the date data in during the feature class to feature class, then afterwards convert it back to a date field? I know that is a bit of a workaround, but I'm not sure why date fields won't work with it. Edit: I tried a fc to fc conversion with field mapping on a test gdb feature class with a date field, and ran into no errors, both in ArcGIS and as a stand-alone script. How did your field mapping code look for the date field in question? I posted my separately in my first post. Did it follow a join? It is interesting that I can run it in a model, and in a stand alone script after removing the date fields. If I add a Copy FC prior to the FC to FC conversion then it works with the date fields, however I seem to loose the ability to change the specs on the new fields when I use this work around...
... View more
06-11-2014
03:54 PM
|
0
|
0
|
653
|
POST
|
If you aren't actually using the field mapping for anything, you could just not include it in the feature class to feature class conversion, since it is optional. The other thing I was thinking is it is crashing on a joined field from the look of things, perhaps it would be best to create a new field, and hard code those joined values in, instead of using the joined field. It says it is a field type error, so that might be what the problem is. Thanks Ian, I am using the Field Mapping to remove unwanted fields and rename both the field names and aliases. When I remove the two Date type fields, then everything runs correctly within the script. Why do you think it is crashing on the Join field when using date formatted fields, but not crashing when the fields in question are removed? Also, are you suggesting that I add two new Date fields and then use the field calculator to populate them prior to the feature to feature class conversion?
... View more
06-11-2014
12:57 PM
|
0
|
0
|
653
|
POST
|
I recently built a model in model builder that converts a feature layer joined to a table into a new feature class. While everything appears to work smoothly when ran the model via the model builder, I get the following error when I run a similar python script via the Python IDLE tool. Note that I exported my working model from the model builder environment into a (.py) Python script, and used that as a reference when I wrote my new script. This portion of the code is used in the optional "Field_Mapping" variable of the arcpy.FeatureClassToFeatureClass_conversion(). Below is the code line in question as exported from the model builder: LOSSDATE \"LOSS DATE\" true true false 8 Date 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.LOSSDATE,-1,-1 The error message states: [INDENT]ARCPY ERRORS: ERROR 000278: Field mapping error: field type invalid for output field LOSSDATE and input field claimsTemp.LOSSDATE Failed to execute (FeatureClassToFeatureClass). PYTHON ERRORS: Traceback Info: File "C:\arcgisserver\gisData\services\claimsMap\toolsNscripts\runClaimsMap.py", line 75, in <module> arcpy.FeatureClassToFeatureClass_conversion("gcPolicies_lyr", claims_gdb, "claimsPersTemp", "", fieldsFC) Error Info: <class 'Queue.Empty'>: [/INDENT] Thanks for any assistance, Haskett ArcGIS 10.2 Here is the complete code: # Import arcpy module
import arcpy,sys,traceback
from arcpy import env
print "...establishing variables and parameters"
# Set Geoprocessing environments
arcpy.env.scratchWorkspace = "C:/arcgisserver/gisData/services/claimsMap/data/claims_1.gdb"
arcpy.env.workspace = "C:/arcgisserver/gisData/services/claimsMap/data/claims_1.gdb"
# Set overwrite option
arcpy.env.overwriteOutput = True
#########################################################
##### Local variables #####
inputData = "C:/arcgisserver/gisData/services/claimsMap/data/CatastropheDetails.xlsx"
claimsTemp = "C:/arcgisserver/gisData/services/claimsMap/data/claims_1.gdb/claimsTemp"
gcPolicies = "C:/arcgisserver/gisData/services/pcMap/data/actuarial.gdb/gcPoliciesDB"
claims_gdb = "C:/arcgisserver/gisData/services/claimsMap/data/claims_1.gdb"
locator = "D:/arcgisserver/gisData/data/streetmapData/Locators/USA"
fieldsLyr = "KEY KEY VISIBLE NONE;INSURED INSURED HIDDEN NONE;LINE LINE VISIBLE NONE;LATITUDE LATITUDE HIDDEN NONE;LONGITUDE LONGITUDE HIDDEN NONE; \
CONFIDENCE CONFIDENCE HIDDEN NONE;SOURCE SOURCE HIDDEN NONE;NOTES NOTES HIDDEN NONE;PHYSADDRESS PHYSADDRESS HIDDEN NONE;PHYSCITY PHYSCITY HIDDEN NONE; \
BLDGTYPE BLDGTYPE HIDDEN NONE;CSTR CSTR HIDDEN NONE;CSTRYR CSTRYR HIDDEN NONE;SIZE SIZE HIDDEN NONE;EXPDATE EXPDATE HIDDEN NONE;AGCY AGCY HIDDEN NONE; \
AGT AGT HIDDEN NONE;CIS CIS HIDDEN NONE;FORMAE FORMAE HIDDEN NONE;FORMC FORMC HIDDEN NONE;VALAE VALAE HIDDEN NONE;VALC VALC HIDDEN NONE; \
DED DED HIDDEN NONE;LIM LIM HIDDEN NONE;PC PC HIDDEN NONE;CORRECTPC CORRECTPC HIDDEN NONE;ANOMALIES ANOMALIES HIDDEN NONE;DISRKEY DISRKEY VISIBLE NONE"
fieldsFC = "KEY \"KEY\" true true false 26 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,gcPoliciesDB.KEY,-1,-1; \
LINE \"LINE\" true true false 4 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,gcPoliciesDB.LINE,-1,-1; \
DISRKEY \"DISRKEY\" true true false 20 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,gcPoliciesDB.DISRKEY,-1,-1; \
CATEGORY \"CATEGORY\" true true false 4 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.CATEGORY,-1,-1; \
CLAIMGROUP \"CLAIM GROUP\" true true false 9 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.CLAIMGROUP,-1,-1; \
ADJUSTER \"ADJUSTER\" true true false 25 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.ADJUSTER,-1,-1; \
AGENT \"AGENT\" true true false 25 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.AGENT,-1,-1; \
POLICYNUMBER \"POLICY NO\" true true false 15 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.POLICYNUMBER,-1,-1; \
CLAIMNUMBER \"CLAIM NO\" true true false 25 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.CLAIMNUMBER,-1,-1; \
LOB \"LOB\" true true false 25 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.LOB,-1,-1; \
LOSSDATE \"LOSS DATE\" true true false 8 Date 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.LOSSDATE,-1,-1; \
LOSSTYPE \"LOSS TYPE\" true true false 25 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.LOSSTYPE,-1,-1; \
LOSSCAUSE \"LOSS CAUSE\" true true false 25 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.LOSSCAUSE,-1,-1; \
CLAIMSTATUS \"CLAIM STATUS\" true true false 6 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.CLAIMSTATUS,-1,-1; \
DESCRIPTION \"DESCRIPTION\" true true false 255 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.DESCRIPTION,-1,-1; \
ITEMNUMBER \"ITEM NO\" true true false 3 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.ITEMNUMBER,-1,-1; \
ITEMPART \"ITEM PART\" true true false 50 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.ITEMPART,-1,-1; \
ADDRESSLINE1 \"ADDRESS\" true true false 100 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.ADDRESSLINE1,-1,-1; \
CITY \"CITY\" true true false 50 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.CITY,-1,-1; \
STATENM \"STATE\" true true false 5 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.STATENM,-1,-1; \
CLAIMSTRATEGY \"CLAIM STRATEGY\" true true false 15 Text 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.CLAIMSTRATEGY,-1,-1; \
CLOSEDATE \"CLOSE DATE\" true true false 8 Date 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.CLOSEDATE,-1,-1; \
RESERVE \"RESERVE\" true true false 4 Long 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.RESERVE,-1,-1; \
RECOVERY \"RECOVERY\" true true false 4 Long 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.RECOVERY,-1,-1; \
PAYMENT \"PAYMENT\" true true false 4 Long 0 0 ,First,#,C:\\arcgisserver\\gisData\\services\\pcMap\\data\\actuarial.gdb\\gcPoliciesDB,claimsTemp.PAYMENT,-1,-1"
try:
# Process: Excel To Table
print "...converting spreadsheet"
arcpy.ExcelToTable_conversion(inputData, claimsTemp, "Page1_1")
# Process: Make Feature Layer
print "...making feature lyr"
queryLyr = '"LINE" = \'Pers\''
arcpy.MakeFeatureLayer_management(gcPolicies, "gcPolicies_lyr", queryLyr, "", fieldsLyr)
# Process: Add Join
print "...joining tables"
arcpy.AddJoin_management("gcPolicies_lyr", "DISRKEY", claimsTemp, "DISRKEY", "KEEP_COMMON")
# Process: Feature Class to Feature Class
print "...creating primary FC copy"
arcpy.FeatureClassToFeatureClass_conversion("gcPolicies_lyr", claims_gdb, "claimsPersTemp", "", fieldsFC)
# Process: Remove Join
print "...removing joined tables"
arcpy.RemoveJoin_management("gcPolicies_lyr", "")
# Process: Copy Features
print "...copying features"
arcpy.CopyFeatures_management("claimsPersTemp","claimsPERS")
# Process: Geocode Addresses
print "...GeoCoding policies"
arcpy.GeocodeAddresses_geocoding(claimsTemp, locator, "Address ADDRESSLINE1 VISIBLE NONE;City City VISIBLE NONE;Region STATENM VISIBLE NONE;Postal '' VISIBLE NONE", "claimsGeoCoded", "STATIC")
print ""
except:
tb = sys.exc_info()[2]
tbinfo = traceback.format_tb(tb)[0]
pymsg = "PYTHON ERRORS:\nTraceback Info:\n" + tbinfo + "\nError Info:\n " + str(sys.exc_type) + ": " + str(sys.exc_value) + "\n"
msgs = "ARCPY ERRORS:\n" + arcpy.GetMessages(2) + "\n"
print msgs
print pymsg
print arcpy.GetMessages(1)
... View more
06-11-2014
11:51 AM
|
0
|
8
|
1162
|
POST
|
Okay, can you clarify a few things for me? My Viewer for Flex webmap is located on the same server as my ArcGIS Server software and data. At the current time we are only running one server for both as the GIS program, in general, is still in beta mode for the entity I work for. We are producing internal webmaps for company consumption using both services we create and services created by others. In the case of the GeoMac GeoRSS feed, it appears that they don't have a crossdomain file, and as such I will need to create a proxy page in order to consume their data. Is this correct thus far? Quickly reading over the following statement, I was under the understanding that the proxy page cannot run on the same server as the ArcGIS Server. The proxy runs on your local web server, not on an Esri server or on the computer where ArcGIS Server is installed (unless your web server also hosts the ArcGIS Server instance). However after reading it again, it appears that I can download and set up the proxy page on my ArcGIS server seeing how both my webmap and my ArcGIS Server instance is on the same server. Is that correct? I'm not a server guy, so please let me know if I am understanding you correctly. Thanks, George
... View more
06-09-2014
10:25 AM
|
0
|
0
|
299
|
POST
|
Thanks, Looks like I might need the IT section to look into this seeing how it appears that I cannot host the proxy on my ArcGIS server. Hopefully I can get this resolved in the next week or so... Thanks again, I'll update the forum when I've managed to get through this. George
... View more
06-09-2014
09:49 AM
|
0
|
0
|
299
|
POST
|
No, I'm not too familiar with using proxy pages. I was trying to figure out how to use their feed service. I had hoped, seeing how they both (earthquake and wildfire feeds) appear to be associated with the federal govt. that I would be able to use them both in a similar manner. Do I need to access them via a proxy page? Thanks George
... View more
06-09-2014
09:32 AM
|
0
|
0
|
299
|
Title | Kudos | Posted |
---|---|---|
1 | 09-28-2013 09:11 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|