Tag Info

Hot answers tagged

10

All of the trigonometric functions you need are in the math module. I presume you'll want atan2() which is the equivalent of atan(y/x). For the mod function, you'll need to use the percent symbol. Each function also has a simplified version (a) since you are calculating some constants. They're identical functions but will be faster. Parser: Python ...


8

Threading doesn't work with most UI manipulation in Windows as UI elements have thread affinity, which is probably why the map view is failing to refresh. I've got a Python project that does this in ArcGIS without threading on Github. It uses the Win32 event loop in the main thread to do timed calls in an add-in extension. You can also use it independently ...


6

You'll need to use the xlrd module to read Microsoft Excel files (I think it's limited to .xls files only). To open your spreadsheet and read cell A2, you would use the following: import xlrd book = xlrd.open_workbook(r"C:\MMO_Model_Test\testdata.xlsx") # may not work with .xlsx file sh = book.sheet_by_index(0) # opens the first worksheet val = ...


6

What you want to do is not a clip, a clip operation would mean you are removing geometry from a layer using another layer as the clipping boundary. You want to do a Join. To do it in ArcGIS, which I assume you're using because you mention modelbuilder: Add the shapefile to your project. Right-click the layer's name, click Joins and Relates > Join... Choose ...


6

Given a list of geographic coordinate pairs, you can implement the Haversine formula directly in Excel. The simplest way to use this (or a more accurate, but I think it's not your case) formula consists into press Alt+F11 to open the VBA Editor, click Insert --> Module and then (copy and) paste e.g. the code kindly suggested by blah238. There will be a ...


5

One of the great things about structured text like this (generally fixed width data) is that it is pretty easy to parse out using a programming language. I used almost the same approach that @congrene used, but I wrote it with Python, which is widely used in the GIS community. You'll note that in many cases the City and State are not fully populated. ...


4

If it's a .csv file you can edit the schema.ini file so that it includes a custom date format string: DateTimeFormat=YYYY-MM-DD HH:mm:s


4

If you open the attribute table, open an empty excel spreadsheet, Select all or some of the records in the attribute table. to select all the button in upper left gives this pulldown to accomplish that. right click on the left edge (on a box). copy selected. Switch to the spreadsheet. right click in the upper left cell (just one cell) ctrl+V ...


3

The Table To Excel (Conversion) tool which was new at ArcGIS 10.2 has the usage below. TableToExcel_conversion (Input_Table, Output_Excel_File, {Use_field_alias_as_column_header}, {Use_domain_and_subtype_description}) As you can see it writes to an Excel file and does not provide an option to specify a worksheet within an Excel file as output. ...


3

If I understand this correctly the yellow fields contain X and Y values, and all the other cells contain some other value like elevation? If I was you I'd convert the data to a text file following this general pattern: X-coordinate;Y-coordinate;elevation You can do this within with a formula like this: The upper table is my test data, with 11, 22, 33 ...


3

This is expected behavior. The ESRI Maps for Office help references this: Heat map layers and layers that are clustered cannot be shared to ArcGIS Online as a layer, but can be shared as part of a map. In the ArcGIS.com Map Viewer, the heat map layer displays as a point layer instead of rendering as a heat map. Source


3

Adding to @Rob Lodge 's answer above. you can directly convert excel file to .csv format and there is a plugin called mmqgis here you can add attributes join from .csv file . i think this may help you if your shapefile dosent have latitude and longitude as seprate fields in excel.


3

Try saving as CSV and see all the answers and comments on How to best prepare csv files for use in arcgis. Once it is imported into ArcGIS you can export/convert to dbf or gdb or other table format.


3

It works with 10.1, so it's looks like a bug of 10.2. If you are in this situation: ArcMap crashes when an XY event layer is in the data frame and the Get Point Features dialog box is opened from the Find Route tool you appear to be encountering bug NIM094607 which is due to be fixed at ArcGIS 10.2.1. Maybe you could try to export your data in ...


2

Your data are in a rectangular array. Their locations are not explicitly given, but are implicit in their positions within the array (their row and column indexes). You need to rearrange them with one value per record and you need to compute coordinates for each record. The spreadsheet is the place to do this, not the GIS. Here is an Excel example (using ...


2

You do not mention what version of ArcGIS for Desktop you are using or where your data is stored but there is a Modifying field properties page that describes how, using ArcGIS 10.2: Some field properties can be changed after the table or feature class is created ... but reading between the lines it sounds like this may apply only to Enterprise ...


2

You can't change the data type of a field in ArcGIS, you'll have to create new fields with the data types you want and populate them with the values from your current fields. See: How to change field formats in ArcGIS 10.1 geodatabase?


2

From Esri grid - Wikipedia: So your example should be converted like this: NCOLS 7 NROWS 3 XLLCORNER xxxxxxx YLLCORNER yyyyyyy CELLSIZE 1 NODATA_VALUE -9999 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 where xxxxxxx and yyyyyyy are the coordinates of the lower left corner of your raster. ...


2

I know you asked for a solution using excel, but here is a short ruby script to parse this data. To use, you'll have to install ruby (https://www.ruby-lang.org/en/downloads/). Once set up, put the data and the script in the same folder and run: ruby munge.rb My result from running this on a portion of the sample data provided: ...


2

Given the fields that are of interest to you are in 3 different typical lines, and given your lack of programming skills, I might suggest you make a first pass at removing useless lines. You may be able to do that with a better text editor. As an example, the following command in Vim or GVim will delete all lines not containing either of these 3 conditions: ...


2

You can use the XY Tools QGIS plugin to load .XLS files just fine on the Mac. You do, however, need to install some required Python libraries. Open a Terminal window and enter: sudo easy_install xlrd You'll need to give your admin password, then the xlrd Python library will install. Then: sudo easy_install xlwt You can then open an XLS file (but not ...


2

You can use: arcpy.MakeFeatureLayer_management() and arcpy.SelectLayerByAttribute_management() to select the features you want. Then use: arcpy.GetCount_management tool to get a count of the selected objects. Using XLRD you can write to excel or just use: outfile = open('OUT_TEXT_FILE.txt','w') outfile.write("write the first line here" + "\n") ...


2

You need a unique field between your shapefile and your excel spreadsheet. This is done using a Join in QGIS, done from the Joins tab from a layers properties, a bit dated guide but functional: http://maps.cga.harvard.edu/qgis/wkshop/join_csv.php Although based on the question I think you will need to either split your single line into the segments ...


1

You save the sheet as a CSV file (Comma Separate Values format) and then import the layer as Delimited Text. In older versions of QGIS this feature was available as an installed plugin. Now it is available directly from the Layer menu. see How to add csv file in QGIS 2.0 using Delimited Text Layer Plugin? QGIS 2.0 text delimited layer importing data as ...


1

When you add any table to a layout you are simply converting its current content and appearance into a picture. There is no dynamic link maintained. There is a possible workaround in the @RyanDalton Answer to this Question but is not easy to implement and has some limitations.


1

Use your 'Bld_Locations_lyr' Feature Layer as your "input feature class" instead of the dbf file... import arcpy arcpy.env.workspace = "Z:\GIS TEST\Select_by_Location" arcpy.MakeFeatureLayer_management('Bld_Locations.shp', 'Bld_Locations_lyr') arcpy.SelectLayerByLocation_management('Bld_Locations_lyr', "WITHIN_A_DISTANCE", 'Breakout_Location.shp', "2000 ...


1

I've been thinking about it and it's possible I've found a novel solution. You set up a python script in a toolbox with two user parameters, firstly the location of the Excel EXE. This could even be smartly coded to check a list of hardcode likely filepath locations (Office12, Office13 etc). Next use the subprocess.call function. There some really neat ...


1

This sounds like you need to develop more of a custom Python tool than a model in ModelBuilder. xlwt or xlutils at http://www.python-excel.org/ will let you write to your Excel file (XlsxWriter will handle xlsx files). If the edits are minor, you could probably incorporate this in a standard ArcToolbox tool (with some creativity). If you are using 10.1+, ...



Only top voted, non community-wiki answers of a minimum length are eligible