Tag Info

New answers tagged

0

This worked for me: import arcpy contours = r'C:\TEMP\Contours.shp' con2 = r'C:\TEMP\Contours2.shp' d = {'a': 1, 'b': 2} _list = [1,2,3] string = 'test' lyr1 = arcpy.MakeFeatureLayer_management(contours, 'contours1').getOutput(0) lyr2 = arcpy.MakeFeatureLayer_management(con2, 'contours2').getOutput(0) layers = [globals()[v] for v in dir() if ...


0

You can use Load > Load Data in ArcCatalog. Right click the feature class to get the Load menu item. You get field mapping options as needed. Assumes you have a pre-existing feature class with appropriate fields.


0

Have you tried ListLayers()? I don't see where in-memory is specifically addressed in the Help File, but worth a shot.


0

ArcGIS can't import pipe-delimited data (at least not that I am aware of). Do a quick search-and-replace on the source data to delimit with either commas (and save as a .csv file), or tabs if some fields have data with commas (and save as a .tab file). Once you've got acceptably delimited data, you can add an "XY Event Layer" through the File menu -> Add ...


0

Sorry for a late response and thank you everyone for getting back to me! I really appreciate it! The version I am using is 10.2.0.3348. Unfortunately the files are heavy (each over 2GB, there are 7) to upload. Besides, they are from the Provincial Ministry and I am not sure if I could put them in the public domain. I received the data as a geodatabase ...


4

Use the field calculator. Either Select by Attributes where YourField = 0 and then calculate that field for all selected records to 0.0001, or with all or no records selected use: Parser: VB Script Show Codeblock: checked Pre-Logic Script Code: Output = [YourField] If IsNull(Output) Then Output = 0.0001 ElseIf Output = 0 Then Output = 0.0001 End If ...


0

An alternative would be to deploy your script in a toolbox, which you could access from ArcCatalog.


-1

I experienced the same problem. This is what I did. I exported the output to a different grid which solved the issue!


2

Here are some options: Cartogram geoprocessing tool v2 http://arcscripts.esri.com/details.asp?dbid=15638 How to make area cartogram maps in ArcGIS http://www.gislounge.com/how-to-make-area-cartogram-maps-in-arcgis/


0

Without knowing all the information (as you have already mentioned above like Version, steps you did etc.), it seems like a general problem I have had many times: The problem (maybe) is the shape itself. It´s an old buggy format, for example sometime when I have to use shapes and erase geometries when I get the same error. If you want to work with shapes ...


3

Your code won't work because the calculation is just completely wrong. You also expressed you question backwards. You want to set Indice_R=Valor, not Valor=Indice_R. This is a simple calculation if all you want to do is calculate the Valor value to the Indice_R field through a join. Add field indexes to the MATERIALES fields on both datasets prior to ...


1

The ADD XY coordinates tool in geoprocessing tools in ArcGIS 10.1 does the trick!


1

The only success I have had after using UnionAggregate to use QGIS to move the feature from SQL Server to a shapefile and then ArcGIS can read it.


5

Your steps are the minimum if you are appending to an existing feature class in an Edit session using manual Editor tools. In fact, you are not doing 2 manual steps, you are doing 4 manual steps after selecting the lines you want to use. Step 1 copy lines, Step 2 paste lines, Step 3 initiate Merge, Step 4 choose one line from the selected set of lines that ...


0

How about you write them all to in_memory as you are then the next step is to write out the final dataset, you know what %n% is so it should be fairly easy to export out. Hornbydd Oct 24 at 7:51 @Hornbydd Months later, I finally understand your reply. I could not think how to get n, realized that for this specific purpose, I'm using a FOR loop, with a ...


0

You can do this using arcpy geometry objects and cursors. Each of PointGeometry, Polyline, and Polygon have a distanceTo(other geometry) method.


0

I would guess there's something wrong with your geometry. Try using RepairGeometry_management prior to your field calculation. If this doesn't do the trick, a workaround is probably needed. I would use FeatureToPoint_management, followed by AddXY_management, followed by SpatialJoin_analysis. Edit: The best method might be via an UpdateCursor. Then you ...


0

I know this can be done in R, but am not yet sure how. Different packages exist for doing it between points and (points, lines, polygons). This one does points to line, for example.


0

Esri software does not have a built-in transformation to convert between NAD 1983 and NAD 1983 CSRS in Ontario. The Ontario Ministry of Natural Resources and Forestry provides an NTv2 file to convert between NAD 1983 (original) and NAD 1983 CSRS. You can download it from COSINE. You have to apply, but it's not onerous, and the NTv2 files are free to ...


1

Quick and dirty way would be to translate the XY points into a distance from river mouth, use that for river distance, and then graph the temperature as the Y value..If all you're doing is trying to get it to plot properly for that graphic. If you're trying to do something 3D, look into z values. If all you need to do is join grid to shapefile, convert ...


2

Following on Phloem's comment about using arguments in the printPages() method, and echoing Emil's answer as well: My gut reaction says we need to select the desired active page by setting the currentPageID property in the mxd.dataDrivenPages object, and then run the mxd.dataDrivenPages.printPages() method to send the active page to the printer. I'm ...


2

Here's a snippet of code that might work for you. the variable 'pageName' is the name of the page to be printed. pageName = "page1" mxd = arcpy.mapping.MapDocument (r"M:\CCAO_GIS_Projects\Library_Districts\MXD\Lib_Test_new.mxd") pageIndex = mxd.DataDrivenPages.getPageIDFromName (pageName) mxd.DataDrivenPages.printPages ("HP Color LaserJet 2600n (Copy 1)", ...


1

The reason is probably in ArcMap unable to recognize a NoData value set by the IDW tool as either 3.40282e+038 or -3.40282e+038. I'd recommend using SetNull tool for these two values on the result and see if that gets rid of any senseless values (should set them correctly to NoData). If not, a flaw in the input data might be present (I'm unsure if IDW ...


2

You can shift the data into the correct position using these GDAL commands: gdal_translate -a_srs EPSG:4326 -a_ullr 0 0 360 -90 NETCDF:"sic_average_nclimate.nc":SIC_Change change360.tif gdalwarp -t_srs WGS84 change360.tif change180.tif -wo SOURCE_EXTRA=1000 --config CENTER_LONG 0 (with a little help by Frank Warmerdam: How to reproject raster from 0 360 ...


2

It is a well-studied problem, to estimate curvature from a digitized curve. There is no simple answer. See this paper for a comparison of several algorithms: Simon Hermann and Reinhard Klette. "A Comparative Study on 2D Curvature Estimators." CITR, The University of Auckland, New Zealand, 2006. (Author link).           ...


0

The lower left corner is at (0,0) coordinates, but for me (0,0) is the coordinate of the upper right corner in your case and I don't know any geographic coordinate system with its origin at -90. As you work in ArcGIS, you could use the georeferencing toolbar to move your data at the right location. Move the upper right to (0,0) and the lower left to (-360, ...


1

(This isn't an answer, but rather a process suggestion that is too long to be a comment) You could geo-reference it in QGIS using the GeoReferencer tool as you appear to be able to identify common points on both rasters. This would generate a GDAL script with a set of GCP points, and transformation parameters. You could add this script with a sample of ...


3

Arc 10.1 gives you access to the Maplex Labeling Engine which is pretty powerful and should allow you to automatically place your labels. There is a wide range of options for you to tweak and adjust but I would recommend starting with the point placement options and then look at the weighting: In the placement properties you can give the city labels ...


0

It sounds like you're on the right track. Services are published by adding relevant datasets to an .MXD and clicking File > Share as a service. http://desktop.arcgis.com/en/desktop/latest/map/publish-map-services/publishing-a-map-service.htm Conversely, its also possible to add data published as services back into ArcMap via the Catalog window after ...


2

As Michael suggested, first creating a layer file of populated rows should do the trick. Before your code, create a variable with the proper SQL query, and then create your layer file. Execute your time conversion on your layer file. code: sql = '"START_DATE" IS NOT NULL' arcpy.MakeFeatureLayer_management (SA_TEN_GOV_els, "lyr", sql) ...


4

I think your question is pure Python rather than GIS but I put together a simple Python script called test.py below to prove that it can be easily done. import arcpy arcpy.CreateFeatureclass_management("C:/temp","test.shp") I placed test.py in C:\temp and used Windows Explorer to double-click it. A DOS window appeared for about 10-15 seconds, and then ...


2

This is fairly simple to achieve using QGIS (I think any version will do) and a very simple SQL statement in DB manager. But for that your that must be in some kind of spatial database (Postgis or spatialite). Since it's more accessible to most people, I will assume using spatialite, but the SQL statements are the same for Postgis. Create a new Spatialite ...


0

I came across this problem after an "IIS Web Platform" installer silently installed a separate version of Python27; uninstalling it of course didn't fix anything. Creating+running a registry patch file (i.e., text file with .reg extension) with the following contents fixed the issue for me: Windows Registry Editor Version 5.00 ...


1

This code will do the trick I think. It looks for any line with $PHOTO_NUM, and when it finds one it checks three lines below with the use of the linecache module. If $TERRAIN_HEIGHT : is found three lines down, the script performs a cursor to find the replacement value, and calculates the index of the line to do the replacement in. Once this index is ...


0

Here's what I would do Using the XML document they sent you, create a geodatabase and then a new feature class to the specifications of the XML by right-clicking in the GDB and choosing Import > XML Workspace Document. This creates a new feature class in the schema you have to match. Then I would create a new feature class from your CSV data, building a ...


0

This can be done with the spatial join tool. You need to select the JOIN_ONE_TO_ONE option. Of course, you might have to run this tool several times if your stressors are not in the same feature class (or you first merge them if they are all of the same type) JOIN_ONE_TO_ONE —If multiple join features are found that have the same spatial relationship ...


4

As stated in GIS-Jonathan's answer this can be accomplished by setting the file permissions to Read-only. In windows 7 you can accomplish this by navigating to the file in windows explorer, right clicking the file with the .shp extension and clicking 'properties'. There should be two checkboxes near the bottom of the properties window that say 'Read-only' ...


0

Strictly speaking this isn't really a GIS question because this is done outside of the GIS using the Operating System. For that, try something like this: http://www.geekpolice.net/t4010-how-to-set-or-unset-the-read-only-folder-attribute-in-windows-7


1

With some help from colleagues and lots of googling I found the answer. If you choose "Insert" --> Model only tools --> Parse Path, and connect the Raster Dataset to this, choose Parse type = Name, and Rename the "Value" output from the ParsePath tool to "RasterName", you will get JUST the Raster name if you change the expression (blue, in jpeg above) to ...


3

Super simple. Change side type to 'Outside Only' and you got it:


6

You're almost there! Using the standard buffer tool, enter your desired distance as a negative value, then set the line_side parameter to OUTSIDE_ONLY. This will generate areas inside of each polygon, giving the nice look of country borders on a political map when combined with a transparency setting: Taken from my other answer


2

This question is a well known cartographic problem, and there are several ways to implement: 1) Offset. Like the underground/tube maps of cities, lines running o same set of tracks appear next to one another, like these example in NYC. This is only applicable if you have a limited number of overlapping lines. 2) Color-based. Changing the color of the ...


1

If you don't have too many lines, you could make the lines underneath other lines thicker than ones above them. Symbolize the colors appropriately so they're visible, e.g. darker underneath, lighter on top. Another method would be to set upper lines to be dashed in some way, again with appropriate colors for visibility. I've seen, but not a fan of, lines ...


0

Finally I solved this problem. I have to use a short python-script: ---------- import arcpy myFeature = arcpy.GetParameterAsText(0) myrows = arcpy.SearchCursor(myFeature) myrow = myrows.next() MyField = myrow.getValue("Offset_Y") arcpy.SetParameter(1, MyField) arcpy.SetParameter(2, True) ----------- Where Parameter 0 as Input is the feature where the field ...


0

Thanks Amarinel, that works. import arcpy import os from arcpy import env # Set local variables inWorkspace = "Q:\\NHD project\\Connection to Oracle.sde" inFeatures = "Q:\\NHD project\\Connection to Oracle.sde\\ARCFM.Landbase\\ARCFM.Towns" outFeatures = "Q:\\NHD project\\Towns\\towns.shp" tempLayer = "townsLayer"


1

you can also modify the environment settings (bottom of your tool) of your tool and set a pixel size (raster analysis tab) of 6 m or select "minimum of input"(the default is maximum of input). This way you don't have to create a new raster. Of course, the advantage of resampling by yourself is that you have full control on the resampling method (within ...


2

You need to resample your 12m raster to 6m in order for the division to work. The basic way is to use Resample tool in the Data Management library.


1

Create numeric field (double) in the table of ballots and try this with field calculator. Code block: def TotalDist(shp ): p=shp.firstPoint mxd = arcpy.mapping.MapDocument("CURRENT") layers=arcpy.mapping.ListLayers(mxd, "facilities") lr=layers[0] g=arcpy.Geometry() geometryList=arcpy.CopyFeatures_management(lr,g) s=0 for f in geometryList: ...


0

If your file is an .xls or .xlsx file these should open correctly in ArcMap. Clearly this isn't happening though, but my experience of using Excel is that it simply stuffs up csv exporting and the resulting file isn't usable. Does opening the .xls or .xlsx file in LibreOffice Calc then saving as a text csv (with commas as a field separator) and importing ...


2

The data type of the columns I wished to pass to the spatial analyst kriging function where of type "text"... text can not be passed to kriging functions, and I needed to change these to integer values... I suppose a double would have also worked but I prefer long integer as some of the data was in the range of e^-5... two possible methods to solve this ...



Top 50 recent answers are included