|
POST
|
Set up, ArcSDE Feature class of facilities as points, in another oracle database facility information. My task is to join them and server as an ArcServer REST service when I can click on a point in Leaflet and see the relative information from both tables. So I joined them in ArcMap and it works fine. However when I go to create the Service it falls apart. I get an error "00062: Data frame contains data that does not use the same connection to an enterprise geodatabase (featureService). The Help file says the solution is just copy both the Feature and Table into one database. In the ideal world that might be nice but it can't happen here. Anyone know of a work around? OK I was able to create a Oracle View and push it into the SDE instance, Now in theory they are both in the same database. I can now create a dynamic Map Service, However NOT a feature service, as I get " 00135: Standalone table's data source is not supported" I think it recognizes that it's looking at a view not table. For now I'll work with the dynamic service. Message was edited by: Bill Chappell
... View more
02-23-2016
08:27 AM
|
0
|
0
|
1948
|
|
POST
|
I originally started with Geojson so the coords had to be lat/longs. Found this GitHub - Esri/geojson-layer-js: An easy way to load GeoJSON data into your ArcGIS map But was unable to use the ClassBreaksRenderer,as it is not yet supported. So back to the drawing board had me with the Esri Json format.. Ran into the goofy error messages, posted this and jumped to Leaflet, where I can read the Geojson and plot the points but stuck there for the moment rendering circlemarkers by classbreaks. I can't tell what's up or down today and overlooked the old obvious map projection issue. Thanks for you help.. If you have any extra snow, ship some up, my snowmobiles are sitting in the garage waiting for some.. Albany, NY..
... View more
02-03-2016
12:14 PM
|
0
|
0
|
2530
|
|
POST
|
Hi, Trying to get Esri Json to show up as a FeatureLayer. I've looked at posts like: Re: FeatureLayer from JSON but that's not AMD style or 3.15 JS API. FeatureLayer creating in javascript ArcGIS API - Geographic Information Systems Stack Exchange shows fragments of code but I'm still stuck. My code failed in firebug with a "a is null error". in the API. Chrome screams Uncaught TypeError: Cannot read property 'id' is null init.js So I'm stuck, any ideas? <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"> <title>FeatureLayer</title> <link rel="stylesheet" href="http://js.arcgis.com/3.15/esri/css/esri.css"> <script src="http://js.arcgis.com/3.15/"></script> <!--<script src="travel6.json" type="text/javascript"></script> --> <style> html, body, #map { padding: 0; margin: 0; height: 100%; width: 100%; } </style> <script> require([ "esri/map","esri/symbols/SimpleMarkerSymbol", "esri/layers/FeatureLayer", "esri/InfoTemplate", "dojo/domReady!" ], function( Map, SimpleMarkerSymbol, FeatureLayer,InfoTemplate,createFeatureLayer ) { var map = new Map("map", { basemap: "streets", center: [-73.762713,42.8], zoom: 12 }); // function createFeatureLayer() { map.on('load', function(e) { var jsonFS = { "geometryType": "esriGeometryPoint", "features": [ { "attributes": { "Name": "Point2", "ObjectID": 2 }, "geometry": { "x" : -73.739996666387981, "y" : 42.758039999677138 } }, { "attributes": { "Name": "Point3", "ObjectID": 3 }, "geometry": { "x" : -73.737916666754941, "y" : 42.757533332975761 } } ] }; alert("Can you get this to fire off?"); var fs = new FeatureSet(jsonFS); var fsCollect = new FeatureSet(); var featuresList = fs.features; var layerDefinition = { "displayFieldName" : "", "fieldAliases" : { "FID" : "FID", "OBJECTID" : "OBJECTID", "LATITUDE" : "LATITUDE", "LONGITUDE" : "LONGITUDE", "ALTITUDE" : "ALTITUDE", "UTCDATE" : "UTCDATE", "UTCTIME" : "UTCTIME", "SOG" : "SOG", "COG" : "COG", "SATS_USED" : "SATS_USED", "PDOP" : "PDOP", "QUALITY" : "QUALITY", "LOCALTIME" : "LOCALTIME", "TIME" : "TIME", "SPEED" : "SPEED" }, "geometryType" : "esriGeometryPoint", "spatialReference" : { "wkid" : 4326, "latestWkid" : 4326 }, "fields" : [ { "name" : "FID", "type" : "esriFieldTypeOID", "alias" : "FID" }, { "name" : "OBJECTID", "type" : "esriFieldTypeInteger", "alias" : "OBJECTID" }, { "name" : "LATITUDE", "type" : "esriFieldTypeDouble", "alias" : "LATITUDE" }, { "name" : "LONGITUDE", "type" : "esriFieldTypeDouble", "alias" : "LONGITUDE" }, { "name" : "ALTITUDE", "type" : "esriFieldTypeDouble", "alias" : "ALTITUDE" }, { "name" : "UTCDATE", "type" : "esriFieldTypeDate", "alias" : "UTCDATE", "length" : 8 }, { "name" : "UTCTIME", "type" : "esriFieldTypeString", "alias" : "UTCTIME", "length" : 6 }, { "name" : "SOG", "type" : "esriFieldTypeSingle", "alias" : "SOG" }, { "name" : "COG", "type" : "esriFieldTypeSingle", "alias" : "COG" }, { "name" : "SATS_USED", "type" : "esriFieldTypeSmallInteger", "alias" : "SATS_USED" }, { "name" : "PDOP", "type" : "esriFieldTypeSingle", "alias" : "PDOP" }, { "name" : "QUALITY", "type" : "esriFieldTypeSmallInteger", "alias" : "QUALITY" }, { "name" : "LOCALTIME", "type" : "esriFieldTypeString", "alias" : "LOCALTIME", "length" : 9 }, { "name" : "TIME", "type" : "esriFieldTypeString", "alias" : "TIME", "length" : 16 }, { "name" : "SPEED", "type" : "esriFieldTypeDouble", "alias" : "SPEED" } ] }; var featureCollection = { layerDefinition: layerDefinition, featureSet: fs }; alert(featureCollection.featureSet.features.length); //nothing... featureLayer = new FeatureLayer(featureCollection); var symbol = new esri.symbol.SimpleMarkerSymbol().setColor(new esri.Color([255,0,0,0.5])); var renderer = new esri.renderer.SimpleRenderer(symbol); featureLayer.setRenderer(renderer); map.addLayer(featureLayer); }); }); </script> </head> <body class='claro'> <div id="map" style="width:900px; height:600px; ></div> </body> </html>
... View more
02-03-2016
09:48 AM
|
0
|
2
|
8126
|
|
POST
|
Sometimes the simplest answer is the best, I'm not sure why I was trying to do this the hard way.
... View more
01-20-2016
10:36 AM
|
0
|
0
|
2532
|
|
POST
|
I have an County ArcServer REST mapservice, and I want to label the polygons.
Esri shows an nice example for a feature service but no examples for a dynamic Service.
Anyone know of an example?
... View more
01-20-2016
10:18 AM
|
0
|
6
|
7999
|
|
POST
|
It was a quote problem, The fix: + "<br/> <button onclick=\"ClickMe(\'+ ${GCADDRESS}+ \');\">Google</button>") Now my button click passes the value in this field to a function. Steve, for the record I did like your method and may use it in the future, however this was a quick and simple fix on a tight deadline. Thanks,
... View more
01-06-2016
10:20 AM
|
2
|
1
|
1579
|
|
POST
|
It has to be inside as it’s part of the html tag. The whole HTML string is quotes, thus the last closing quote. However I tried it just to confirm it. Thanks, Bill
... View more
01-06-2016
08:37 AM
|
0
|
0
|
1579
|
|
POST
|
I have a button on a popup, if the attribute field is numeric, it passes the value to my function, if it's a string it fails. infoTemplate: new InfoTemplate("CI Data", "Facility ID: ${ID} <br/> Facility Name: ${NAME} " + "<br/> County Name: ${CNTYNAME} <br/> City or Town: ${CITYTOWN}" + "<br/> Location Verified Date: ${VERDATE}" + "<br/> <button onclick='" + "ClickMe(${CNTYNAME});'" + ">Google</button>") if the value is Albany, firebug says "Albany is not defined" if I pick a text field like address I get "missing ) after argument list". I scoured google and it looks like it doesn't like unquoted values, I've tried the string() and toString functions with out luck. Any ideas? Thanks..
... View more
01-06-2016
07:54 AM
|
0
|
6
|
3702
|
|
POST
|
This ran for me using your data.. import arcpy, os from arcpy import env from arcpy.sa import * arcpy.env.overwriteOutput = True arcpy.CheckOutExtension("Spatial") arcpy.env.workspace = "C:/test" ink = "C:/test" fcList = arcpy.ListFeatureClasses("Pnt*", "Point") ras = "clippol" i = 1 for fc in fcList: ras = ras + str(i) print "Point is: " + fc + " the DEM is: " + ras outViewshed = Viewshed(ras, fc) outViewshed.save("C:/test/out/outvwshd"+ str(i)) ras = "clippol" i=i+1 print "Done"
... View more
12-01-2015
07:36 AM
|
2
|
0
|
2498
|
|
POST
|
Walk through the process manually, is do it with out the scripts, see if you get an error manually on the third one.. It may be the data or the name of the third one. Bill Chappell ITS Group - GIS Developer 800 North Pearl Street- Room 222 Menards, NY 12204 518-408-0185 William.Chappell@Its.ny.gov
... View more
11-25-2015
01:59 PM
|
1
|
1
|
2498
|
|
POST
|
Oops, I screwed up , change my working script to: fcList = arcpy.ListFeatureClasses("Pnt*", "Point") #rasList = ras = arcpy.ListRasters("*", "All") ras = “dem” i = 1 for fc in fcList: ras = ras + str(i) print "Point is: " + fc + " the DEM is: " + ras outViewshed = Viewshed(ras, fc) outViewshed.save("C:/test/out/outvwshd"+ str(i)) ras = “dem” i=i+1 print "Done" Sorry I messed up I do a lot of point intersects with polygons, and I often step through 2 lists..
... View more
11-25-2015
06:18 AM
|
0
|
1
|
1731
|
|
POST
|
You had DEMi and DEM below, as written it would always just use the first dem, your next dem is not used.. So your second viewshed may not have a point1 in it. If your running this from the IDLE or pythonwin, I’d use print commands to see what your variables are, so if it errors off you have a better clue. I wrote what I’d use in blue below. I also shortened your output string. One big potential problem is if your typing in the workspace path, it’s so easy to confuse the forward and back slash. Are the points and dems in the same projection? Since I had some time, I rewrote the code, see below in green. It works, my e-mail is William.Chappell@its.ny.gov<mailto:William.Chappell@its.ny.gov> if you want the script I used, in case copy/paste messes with the indent formats. Good Luck, Bill
... View more
11-25-2015
06:07 AM
|
2
|
3
|
2498
|
|
POST
|
It’s your logic that’s tripping you. • import arcpy, os • from arcpy import env • from arcpy.sa import * • arcpy.env.overwriteOutput = True • • env.workspace = arcpy.GetParameterAsText(0) • out = arcpy.GetParameterAsText(1) • fc = arcpy.ListFeatureClasses("Pnt*", "Point") • ras = arcpy.ListRasters("dem*", "GRID") • point = "Pntclip_pol1" • dem = "dempol1" • i = 1 • for shp in fc: <<< First time in loop this is Pntclip_pol1???? 2nd time it’s Pntclip_pol2 ?? If it’s Pntclip_pol1 why did you define it?? It’s the first item in your fc list. • for raster in ras: first time it’s dempol1?? Is that also the first item in your dem list? • # if (shp == point and raster == dem): ???WHY??? Not needed.. • #inRaster = raster # not needed • # inObserverFeatures = shp #not needed • #outViewshed = Viewshed(inRaster, inObserverFeatures, "") outViewshed = Viewshed(raster, shp) • outViewshed.save(out + " " + "view" + str(i)) • i = i + 1 #already an int as declared above.. • #point = "Pntclip_pol" + str(i) • # dem = "clippol" + str(i) Just say you have 3 points and 5 dems For i in pointlist: For dem in demlist: theViewshed = viewshed(dem, i) the Viewshed.save (xxxxxx+ str(1)) Here the loop would use the same i and run through the next dem Once finished it would loop the next i and toss you back into the dem loop 1 pt 1 dem Viewshed (1 dem, 1 pt) Now loop 2 dem Viewshed( 2 dem, 1 pnt) Now loop 3 dem Viewshed( 3 dem, 1 pt) Now loop Etc.. until finished with dems then kick to 2nd point 2 pt 1 dem Viewshed (1 dem, 2 pt) Now loop 2 dem Viewshed( 2 dem, 2 pnt) Now loop 3 dem Viewshed( 3 dem, 2 pt) Now loop You don’t need to name the items in each list as they will always advance to the next item in each list. Leave i =1 and have I = i+1 inside the dem loop so your new views are numbered..
... View more
11-23-2015
11:12 AM
|
0
|
5
|
1731
|
|
POST
|
Forgot in a list (pnta, pntb, pntc) To get the second item list[1] , you would have to remember the index or make count start at zero. In your example you could have it just process one right after the other and not worry about the list index number..
... View more
11-23-2015
10:14 AM
|
0
|
7
|
1731
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-05-2016 09:27 AM | |
| 1 | 06-12-2020 07:41 AM | |
| 1 | 12-23-2016 05:32 AM | |
| 1 | 11-23-2015 08:44 AM | |
| 1 | 11-25-2015 01:59 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-22-2021
12:31 PM
|