Is there a way to configure / edit the default coordinate widget to show elevation (Z) along the X, Y values just as is possible in a 3D application but in a 2D application? If possible, this would be the ideal solution.
See capture 1 showing default OOTB coordinate widget in a 2D web appp.
See capture 2 for closeup of the widget with a coordinate placed on map.
Alternatively, can I obtain XYZ values from a DEM service? We've tried this and although we can get the elevation value from in a popup we don't seem to be able to get the cell X and Y coordinate as well as the elevation cell value in one popup.
See capture 3 for a popup showing an elevation (Z) value obtained from a DEM exported to server as image service.
Having to obtain XY values using a widget then getting the Z value from a popup is a bit cumbersome so I am basically looking for a solution that will allow me to obtain all 3 values (X,Y,Z) from a single click on a map.
Answer
I created a workaround to get the results I needed.
I basically created a vector version of the raster:
- Converted a raster to points which gave me the points with elevations
- Run "Add XY Coorinates" tool to add the XY so I had points with X,Y,Z coordinates.
- I needed the same raster as polygon cells identical to the input raster so to get around the limitation of the "Raster to Polygon" tool which merges cells of the same value together I converted the point feature class to raster using the unique OBJECTID for value then once created I converted this raster back to polygons which worked (33,000,000 features)
- I now attempted to run a spatial join on 33 million features to bring the X,Y,Z values from the points into the polygons. This bombed out a few times with background geoprocessing turned off (a known bug as i found out later) so i turned backround geoprocessing on and after 10 hours the spatial join completed only 6% of the features. If it succeed it would take 10 days to run. Stopped the processing and back to square 1. well 2.
- Built my own addin with VS .Net and ArcObjects to convert points to square polygon cells (tool takes a size of cell as parameter and also allows user to control how often the cursor is flushed - default 10,000 to ensure stable performance) I also put in some ligic to automatically copy over the attributes. I succesfully converted all 33 million features into polygons with all necessary XYZ attributes.
- Because I am no longer limited to how many attributes i have, I added Lat and Long as well and also a XYZ concatinated string the end used can copy in one shot instead of copying 3 values seperately. I noticed the feature class drew very slowly in ArcMap so I copied it to a new FGDB and compressed the database since it ws not going to be edited anyway. Peformace improved very significantly and the size of the geodatabase went down to 500MB from the original ~ 6GB.
- Uploaded the map service (no cache) to my web server and added to my web maps. WE only allow the end users to use the map service in beyond 1:2000 but I was very suprised how well and quickly it works:
No comments:
Post a Comment