Hot answers tagged

15

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 ...


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 ...


10

The Feature Class to Feature Class tool is a Conversion tool. The idea is to convert a feature class in one format (e.g. shapefile) to another (e.g. geodatabase). It also allows the user to control the Field Map - i.e. which fields will be copied over. The Copy Features tool simply creates an exact copy of the input features. Note - this tool can also be ...


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

The most basic difference is the level at which each of the functions are working. The Feature Class to Feature Class tool is working at the Layer level, meaning that regardless of the features selected, it treats them as a whole. A new feature class is going to be created. This means that you have control over the structure of the new featureclass, ...


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: ...


4

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). ...


4

Yes you can, simply change the output name from the box related to it. Subsequent processes that take your output, as an input will be automatically changed, but for example, if you are using the output name or part of it to name another output it might break the model. Change the name as needed and inspect the remaining chain to see if anything that is ...


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

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

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

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

Unfortunately, you've run into BUG-000088749, in which you can't copy and paste a data frame in ArcGIS 10.3.1. The suggested workaround is what @KFP said: copy and paste your layers into a new data frame. That won't copy any properties you may have set on the original data frame, so you'll have to set those manually.


3

If you have PostGIS installed, you will be able to read the database the same way as you would read an SDE-enabled/"Enterprise" geodatabase that uses ESRI's st_geometry libraries instead of PostGIS. Create a new database connection, specify the server name, database name, and the user credentials, and you should be good to go. You can create a new database ...


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

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

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

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 ...



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