Tag Info

Hot answers tagged

10

The way to do this is to create a map package: Map packages (.mpk) make it easy to share complete map documents with others. A map package contains a map document (.mxd) and the data referenced by the layers it contains, packaged into one convenient, portable file. The downside of this will be that with the inclusion of raster data sources, your ...


8

Have you tried simply copying and pasting features? You can do this by adding both shapefiles to the map TOC, then choose "Editing-> Start Editing", and choose the DESTINATION shapefile workspace to edit. Next, choose the "Edit Tool" (small arrowhead by the Editor dropdown), select the SOURCE feature to copy, right-click and choose "Copy". Right-click and ...


8

I recommend using the Select_analysis tool which will accept a where clause. arcpy.Select_analysis("C:/CGDP.shp", "C:/New.shp", ' "GDP_TOP10" = 1 ')


6

The reason you cannot edit these layers is because it is not a file. It is a map service. What you are seeing is a web service. A web service is data that is hosted on a server elsewhere, that is not your computer. Your computer is going out and getting the data live from OLIVER when you look at it in ArcMap. In this case the data you want to edit is ...


5

It's difficult, though possible, to corrupt a file geodatabase. You should certainly delete the table that was loading when the application was terminated. 22k points doesn't seem like a lot, so there may be other issues at play here (and these issues may increase the probability of corruption).


5

You could automate this using a python/arcpy script. The script flow would go something like this: Generate xy coordinates for all your address features using the Add XY Coordinates tool/code Create a new address field to hold new address value using Add Field Use a SearchCursor to iterate through your address feature class/address field and look for ...


5

There is an existing ArcGIS Idea covering this functionality that you can vote for. In the meantime a workaround may be as follows: This will work only on a feature class NOT a table so if you need a table create a feature class with the same number of records and use Join Fields to make a temporary feature class that you can turn back to a table later. ...


5

You can open layers contained in a project into the current QGIS session by using the Import Layers to Project plugin. This will let you choose which layers you would like to load into your current QGIS session. You could also take a look at the Embed Layers and Groups functionality. This allows you to open layers from a project. It stops you from ...


4

You want to use the Append_Management tool. If you know the attribute tables will match up (including data type), use schema_type NO_TEST anyway (even though the documentation would suggest TEST). If the attribute tables do not match up you will have to deal with field mappings, which can be a huge pain in arcpy. (If you are using NO_TEST and a subtype, ...


4

In ArcMap - you could do the following: Select the polygon you want to copy. Open the Python window and type in the following code: cur,row = None, None cur = arcpy.SearchCursor("NAME OF THE LAYER HERE") x = 113 for row in cur: shp = row.getValue("SHAPE") cur,row = None, None cur = arcpy.InsertCursor("NAME OF THE LAYER HERE") for i in range(0,x): ...


4

There are 3 issues in your code: indentation under the for fc block as @recurvata says useless line after the else output not valid for the CopyFeatures tool. Here is the corrected code: #Loop through shapfiles in folder and reproject for fc in fcList: fcspatialRef = arcpy.Describe(fc).spatialReference.name if fcspatialRef != spatialRef: ...


3

Why not make everything relative to your MXD? This approach only works if what you are doing can have all the data stored in sub-folders relative to your MXD. This works well with small projects. But you don't say where your data is? If they are spread across multiple drive spaces then as suggested by @PolyGeo the map package is probably your only option. ...


3

If you are only dealing with a few polygons, I would use the Replace Geometry tool on the Advanced Editing toolbar. See http://resources.arcgis.com/en/help/main/10.1/index.html#//01m80000001s000000 Alternately for a few polygons you could copy and paste the polygon(s) into layer B and then use the attribute transfer tool on the Spatial Adjustment toolbar ...


3

I would consider using the arcpy.da.UpdateCursor and SHAPE@ token for representing the geometry object. First, you have iterate through the rows to find if the value in some unique ID field matches, and if yes > replace the source geometry with the target one.


3

Normally the files created by SEXTANTE toolsets like SAGA are saved temporarily somewhere. Click on the raster and look in the options/metadata. In the QGIS Master version (1.9) there is also the option to save the raster via "save-as" if you rightclick on the rasterlayer. But you could also simply use the gdal-tools like this (without prior testing): -> ...


3

There is a plugin named Layers menu from project that lets you import layers from other project files incuding the styling. The only pitfall: Attention : the project must be configured to record absolute paths which is not the default for QGIS. But you can change it in the project properties.


3

It looks like you're kind of "over-checking" for matching spatial references, and you're if/else is a little off. Try this: # Get the spatial reference spatialRef = arcpy.Describe(template).spatialReference.name #Loop through shapfiles in folder and reproject for fc in fcList: fcspatialRef = arcpy.Describe(fc).spatialReference.name # the ...


3

Seems you're correct in thinking there is a problem with the 'calculate' variable. i believe you would want something like arcpy.CalculateField_management(layerforNewField, newfieldname, '"!{}!"'.format(oldfield), "PYTHON_9.3") otherwise, by setting calculate = '!oldfield!' the code is trying to insert values from the column 'oldfield', which i'm ...


3

The best way to save all of the settings of a layer (or multiple layers) in a map document, is to create a layer package. Select all of the layers you would like to save in the package Right-click one of the selected layers and click Create Layer Package Follow the Layer Package wizard, making sure to fill in all of the entries (such as summary and tags). ...


2

The MakeQueryTable tool will do what you need. I've used MakeQueryTable in a one-to-many join from Polygon data, producing stacked polygons. All your data must reside in the same Geodatabase. You must specify a Geometry field in the in_fields parameter. It takes some trial and error to get the results you want. The output is a Layer, so you must run ...


2

Create a feature layer with a selection, then use CopyFeatures: arcpy.management.MakeFeatureLayer("C:/CGDP.shp", "new_layer", ' "GDP_TOP10" = 1 ') arcpy.management.CopyFeatures("new_layer", "c:/new.shp") arcpy.management.Delete("new_layer")


2

Assuming that your features are non-complex, you will want to use an Insert Cursor (method 1). If your features are complex, you must use IFeature.Store() (method 2). See the following code from this link (It's in VBA, but shouldn't take long to translate over) Public Sub LoadFeatures() Dim pMxDoc As IMxDocument Dim pFeatureLayer As IFeatureLayer ...


2

There is no Geoprocessing tool to do this and as mentioned in the comments by @blah238 and @vince there is no case for one to be developed because you cannot "rely on the consistency of ObjectIDs for any purpose. Instead, you should have a persistent and unique ID in a separate column... [However, you could] calculate a new field based on the current ...


2

You don't want copy, you want Select. You'll select the layer you want from the Solve and carry on with that. The Solve output is a group of layers. After you select it out, I believe it's still a layer, as such you wont need to MakeFeatureLayer. You should just be able to do your SelectByLocation with it.


2

If you simply want to copy the rasters without changing format, compression, or building overviews then use standard filesystem copy (in the shutil module) instead of the CopyRaster tool as i.e. import shutil shutil.copy(inpath, outpath) You could also use the Copy tool arcpy.Copy_management(inpath, outpath) The advantage of the Copy tool is that it ...


2

The different methods of storing rasters in ArcMap are a little confusing. If you have a Raster Catalog, the actual raster data may be stored in a different folder, not directly in the geodatabase. Raster datasets can be managed within or as links on file system Given the very different file sizes in this case, this "link" storage is more likely. ...


2

If you want a new shapefile, containing just some of the existing parcels, but no others, simply query for, or select the ones you want, then right-click on the layer select Data, then Export Data. If you have an existing shapefile follow the advise of @Maksim


2

You need to be in an edit session and have the Editor Attributes window open (Editor dropdown > More Editing Windows > Attributes). The simplest solution is: In the Attributes window, right-click the feature you want to copy from and click Copy Attributes. Right-click the feature you want to paste into and click Paste Attributes. This replaces all ...


2

Depending on your precise requirements, I think layer files, rather than layer packages, may provide you with a better solution. If you right-click on any layer (or layer group) in the Table of Contents and Save as Layer File you have all the Properties of that layer (but NOT its data) stored in a small file that can be easily added to another map. If you ...


1

The above answer is missing a few crucial details that might frustrate people, as Dre pointed out. I've tried to work out why copy gets greyed out - I read it had something to do with some aspect of the feature class not agreeing with the data frame, but I couldn't resolve it. To duplicate annotation in an annotation feature class when "Copy" is greyed out: ...



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