POST
|
The results were slightly off and it took me a bit to figure out why. xllcenter & yllcenter provide the coordinates at the center of the most lower left ASC cell. In order to find the coordinates at the lower left corner of the lower left cell, you need to subtract half of the cell size from both coordinates. So, with a cell size of 15 meters xllCenter = xllCenter - 7.5 yllCenter = yllCenter - 7.5
... View more
02-13-2013
12:57 PM
|
0
|
0
|
824
|
POST
|
Column = (CurrentXcoordinate - XLLcenter) / Cellsize Row = (nrows -1) - (CurrentYcoordinate - YLLcenter) / Cellsize Why did you include "(nrows-1) -" to calculate the row? I used the script in my previous post to find the row and column. To check my work, I changed the value in the resulting ASCII row & column to something unique and set ArcMap to display that value with a unique color. I expected the point to fall in that cell, but it was way off (more than "nrows-1"). What could be causing this?
... View more
02-13-2013
09:58 AM
|
0
|
0
|
824
|
POST
|
That's exactly what I ended up doing. Now I just need to figure out what to do with interpreting the decimal result. Ex. is 37.604 in the 37th row or the 38th row? I'm thinking 38th. file = open(r"C:\WorkSpace\Grid.asc") nCols = file.readline() nRows = file.readline() xllCenter = file.readline() yllCenter = file.readline() cellSize = file.readline() file.close() nCols = re.sub('ncols', '', re.sub('\s','',nCols)) nRows = re.sub('nrows', '', re.sub('\s','',nRows)) xllCenter = float(re.sub('xllcenter', '', re.sub('\s','',xllCenter))) yllCenter = float(re.sub('yllcenter', '', re.sub('\s','',yllCenter))) cellSize = float(re.sub('cellsize', '', re.sub('\s','',cellSize))) # subtract half the cell size to get the coordinates at the lower left corner of the cell, not the exact center xllCenterAdjust = xllCenter - 7.5 yllCenterAdjust = yllCenter - 7.5 pointX = 534557.7644 pointY = 3248152.003 xColumn = ((pointX - xllCenterAdjust)/cellSize) yColumn = ((pointY - yllCenterAdjust)/cellSize) print xColumn print yColumn
... View more
02-13-2013
04:58 AM
|
0
|
0
|
824
|
POST
|
I have a point shapefile and an ascii grid. When you view an ascii grid in a text editor the header tells you the xy coordinates of the center then the values are all displayed in neat rows and columns. What I am trying to find out is what column and row those points fall in. When both are added to ArcMap I can find out the value of the cell, but I want the column and row number. Anyone have any clue how this can be accomplished? ncols 1926 nrows 2752 xllcenter 533993.691804 yllcenter 3247644.275250 cellsize 15.000000 NODATA_value -9999 -9999 -9999 -9999 -9999 -9999 ... -9999 -9999 -9999 0.0 0.0 ... -9999 -9999 -9999 0.0 0.0 ... -9999 -9999 -9999 123.4 123.4 ... ...
... View more
02-12-2013
11:50 AM
|
0
|
5
|
1550
|
POST
|
I am trying to convert a MySQL table to a personal geodatabase table using TableToGeodatabase and MySQLdb (to connect to the db). I'm able to successfully connect to the database and query it, I am just not able to correctly select the table to be converted. Although I am using an .mdb instead of a .gdb, this does not throw an error. The only error I receive is "ERROR 000735: Input Table: Value is required" # Import system modules
import arcpy
from arcpy import env
import MySQLdb
import sys
# open a database connection
try:
connection = MySQLdb.connect(host="host.org", user="abcde", passwd="12345", db="waterdb")
if connection.open:
print "open"
# Set environment settings
# I believe this should reference the MySQL database but I don't know how
env.workspace = ""
# the table I want to convert
table = arcpy.ListTables(["vwComboFlows"])
# Set local variables
outLocation = "C:/output/output.mdb"
try:
# Execute TableToGeodatabase
print "Importing tables to mdb: " + outLocation
arcpy.TableToGeodatabase_conversion(table, outLocation)
except:
print arcpy.GetMessages()
... View more
02-07-2013
10:21 AM
|
0
|
1
|
3549
|
POST
|
Thank you for your responses. map is a global variable The map has successfully loaded and works fine. The error appears when I click on the tool. I've constructed a toolbar Ext.define('app.view.mainToolbar',{
extend: 'Ext.toolbar.Toolbar',
alias: 'widget.mainToolbar',
border: 0,
items: [
{ itemId: 'zoomin', iconCls: 'icon-nav-zoomin', tooltip: 'Zoom In' },
{ itemId: 'zoomout', iconCls: 'icon-nav-zoomout', tooltip: 'Zoom Out' },
{ itemId: 'pan', iconCls: 'icon-nav-pan', tooltip: 'Pan' }
)}; and a controller to handle the clicks. Ext.define('app.controller.toolbarController', {
extend: 'Ext.app.Controller',
init: function () {
this.control({
'mainToolbar > #zoomin': {
click: this.ClickNavBtn
},
'mainToolbar > #zoomout': {
click: this.ClickNavBtn
},
'mainToolbar > #pan': {
click: this.ClickNavBtn
}
});
},
///execute different methods of navToolbar(esri.toolbars.Navigation) depending on which button user has clicked
ClickNavBtn: function (btn, e) {
switch (btn.itemId) {
case 'zoomin':
app.map.navToolbar.activate(esri.toolbars.Navigation.ZOOM_IN);
break;
case 'zoomout':
app.map.navToolbar.activate(esri.toolbars.Navigation.ZOOM_OUT);
break;
case 'pan':
app.map.navToolbar.activate(esri.toolbars.Navigation.PAN);
break;
}
}
});
... View more
01-29-2013
07:48 AM
|
0
|
0
|
257
|
POST
|
Developing using ExtJS 4 and ArcGIS Javascript API v3.3 I am trying to implement a navigation toolbar similar to the one in this Esri sample: http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/toolbar_navigation When I click a button to select a navigation tool, I receive this error in the console: "TypeError: map.disableDoubleClickZoom is not a function" (line 34 from http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.3 is referenced) Can anyone explain what might be causing this error?
... View more
01-29-2013
06:06 AM
|
0
|
4
|
358
|
Online Status |
Offline
|
Date Last Visited |
07-21-2023
09:57 PM
|