Hot answers tagged

5

I agree with @Paul above - the best way to optimise this code is to ensure that it never runs. If you're happy to install third party packages I'd also take a look at the the formic package, which is a ... Python implementation of Apache Ant FileSet and Globs including the directory wildcard ** (Credit to this answer on SO for pointing me at the ...


5

Given your parameters, remember that The fastest code is the code that never runs! Unless your folder hierarchy is very complex, chances are there are some directories you know you can skip. For example, my D: drive, which houses quite a bit of data (~40k files, 1.3k folders, 240GB), contains mostly file geodatabases. We don't need to search those ...


2

If you still want to work in QGIS then you can do it by importing the shapefiles to GRASS and then exporting them back out again to shapefile. This should convert them both to polygon geometry and the merge will work. Make sure the two layers are loaded into QGIS before you start. To import into GRASS: 1. Load the GRASS plugin and the toolbars. Open the ...


2

You can merge this layers in Geomedia (tested with your data). save .mif like a shapefile (in QGis) open this two shapefiles in Geomedia create new access warehouse output first shapefile to new access warehouse output second shapefile to access warehouse with append option export merged to one shape file


2

I think the error message tells you pretty clear what the problem is! Just make sure that both files have an attribute column with unique values. Edit at least on of your files and change keys in column IL for example by adding the number 1000. IL (old) IL (new) 1 1001 10 1010 11 1011 12 1012 13 1013 ... ...


2

The ZCTA5(Zip Code Tabulation Area) shapefile from the Census Bureau should have what you are looking for. 2010_ZCTA5 Here are single state files, although 2010 Version. Click on the State name, then the 2 digit State FIPs code, then ZCTA510.zip should be at the bottom.


1

I think your first troubleshooting step should be to quantify the time taken for your IDE to import ArcPy (which ArcMap already has imported by default) because you will not be able to eliminate that time from your IDE workflow. You can use a code snippet like this to do that: import time start = time.clock() import arcpy elapsed = (time.clock() - start) ...


1

I could not download "original boundaries" (it seems the link is broken), but this is what I got (I think the same as @cengel) with data provided on second link (+ the .dbf file link): require(rgdal) require(maptools) require(ggplot2) require(plyr) # Reading municipal boundaries esp = readOGR(dsn="C:\\...\\boundaries", layer="...


1

You should use the Dissolve tool. By default, this will create multipart features where your stands are separated by a small gap. This is what you want for your case. You can elect to dissolve everything or by a common attribute. After dissolving you will get an accurate areas calculation. Dissolve is available in all licence types. Aggregate Polygons ...


1

Here is one way to set up the City Matrix in Excel so that you can get the Destination City row to report the Origin City with the maximum trip rate. The formula for column G is simply: =Max(B3:F3) for cell G3 and copied down. Column H is a number for the number of rows down from the current row to find the City name at the bottom. In the case of a ...


1

You will have to go through several process. Here are a few indications to help your out. First create a new column in your layer BIG_ID_COLUMN. Update this column with the Id of each parishes Create a new shapefileBIG_SHAPEFILE with the largest parishes and one for the small ones SMALL_SHAPEFILE Use a closest neighbor tool (v.distance ; grass) or follow ...


1

Rather than merge them manually with an attribute selection, you can Dissolve on multiple fields - not just one. So once you've Intersected your catchment and landuse layers, you should have attributes for both in a single shape. By Dissolving on catchment ID and landID (or whatever field has perviousness noted), everything that is impervious within a ...


1

I think you have two issues here. The first may be misleading. The warning that you're getting when you start editing is only that--a warning. It means that one or more of the data layers are in a different coordinate reference system than the map's. You can check what's going on by opening the data frame's property page (one method is to right-click ...


1

you can create a list of many shapefiles using the glob module or os.walk, then you can use this list directly in the merge tool. import arcpy, glob yourlist = glob.glob(r"O:\ABC\DEF\*\project_nu\*.shp) arcpy.Merge_management(yourlist, r"C:\output.shp")



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