38

You can use rgdal to access feature classes in Esri file geodatabases. require(rgdal) # The input file geodatabase fgdb <- "C:/path/to/your/filegeodatabase.gdb" # List all feature classes in a file geodatabase subset(ogrDrivers(), grepl("GDB", name)) fc_list <- ogrListLayers(fgdb) print(fc_list) # Read the feature class fc <- readOGR(dsn=fgdb,...


32

Vector data can have properties stored at two levels. File level or Layer level. For feature class (a type of vector data), file level information is stored in a geodatabase. This consists of properties like feature class geometry, attribute table, assigned subtypes and domains, a coordinate system, etc:. All these file level properties make up the actual ...


22

The easiest way to do this is to add a new integer field to the attribute table of the parcels layer. Then, run field calculator with the following expression: !Shape!.pointCount-!Shape!.partCount The !Shape!.pointCount returns the total number of vertices in the feature. However, the first vertex of each part is repeated at the end, in order to close the ...


14

The trick you're missing is making each gdb the active workspace before listing the contents: for item in workspaces: print item env.workspace = item fcs = arcpy.ListFeatureClasses() for fc in fcs: print '\t', fc Also note that this will miss an feature classes inside feature datasets, see Listing all feature classes in File ...


14

These terms specifically relate to the ESRI software and data schemas. A feature class is a set of common geographic features, for example roads, or parcels, or land use, as they are stored in a geodatabase or shapefile, or other storage format. Here is the help file on Feature Class Basics. A feature layer is the representation of a feature class after ...


13

Strings, even when marked as r"Raw strings", cannot end with a slash, it needs to be escaped. Should be: fullPath = WSpace + FDSName + "\\" + FCName Or better yet, use os.path.join: fullPath = os.path.join(WSpace, FDSName, FCName)


12

dmahr provided a good solution to count vertices. For a non-programmatic way to label each point with the XY coords, try the following workflow: Feature Vertices to Points Add two new fields (type: double) in the new point FC "X", "Y" Calculate geometry. Right click field > Calculate Geometry... > X Coordinate of Point (repeat for Y field) Add another ...


11

To expand a little on Vince's comment, those two fields are just the numeric area of each polygon (in square meters or whatever units the layer was in) and its perimeter. Whoever created that CSV may have had access to the geometry (the actual shapes) of the layer, but the CSV doesn't include it and therefore you can't recreate the layer from the CSV. You ...


10

In simple terms ... I try to think of a feature class being a spatial dataset, i.e. not much more than x,y coords and attributes on disk, while a layer applies symbology (and many other lesser known properties) to a spatial dataset. A layer does not store data, just symbology and a link to where the data is located on a disk somewhere. Feature classes ...


10

A "feature class" is an abstract name for source data for mapping. The origin of that data can be shapefile, file geodatabase, enterprise geodatabase, or any number of other sources (feature class factories). File and enterprise geodatabase sources are tables, with naming constraints that include: The initial character must be alphabetic The remaining ...


9

There are a couple of reasons why you want to reference Feature Layers in ModelBuilder, as opposed to Feature Classes. First it is helpful to understand the differences. "Feature Classes" as simply references to the raw data, in its entirety. One simple example of this where the FC is a shapefile on disk. "Feature Layers" are references to an ...


9

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


9

Here's code for the solution based on the accepted answer: #define the input table name tblIN = "LFA_WYKAZ" #define new feature class name fcOUT = "LFA" #define projection projection = "c:\Program Files\ArcGIS\Desktop10.0\Coordinate Systems\Projected Coordinate Systems\National Grids\Europe\ETRS 1989 Poland CS92.prj" #create empty polygon ...


9

You can access the feature extent of a feature class by using the Describe function import arcpy, os fc = r'C:\path\to\your.gdb\fc' desc = arcpy.Describe(fc) xmin = desc.extent.XMin xmax = desc.extent.XMax ymin = desc.extent.YMin ymax = desc.extent.YMax print "xmin: %s \nxmax: %s \nymin: %s \nymax: %s" % (xmin, xmax, ymin, ymax) You can change the ...


9

Instead of looking for the Create Fishnet (or any other) tool in ArcToolbox, I recommend using the Search window to search for and open it. If you are curious to know which toolset it is located in for the ArcGIS version that you are using then after searching for it you can click on the green link returned.


8

This script will deal with any existing feature datasets (at least in theory - I haven't tested it). Same general idea though, if there are feature datasets, you need to set your working directory to that dataset before listing the features within. import arcpy dir = r'D:\output' arcpy.env.workspace = dir gdbList = arcpy.ListWorkspaces('*','FileGDB') for ...


8

You might want to try dropping the column "Discard". I've only just started to figure out the solution to this myself but dropping columns that begin with a capital letter seems to be working for me so far. EDIT: I realise now that ArcCatalog will not consume quotation marks in a query layer. Seeing as Postgres works with columns in lower case and that ...


8

You make no mention that you have any problems reading your text file, so I am assuming that it is just how to get the coordinates into a feature class that has you stumped. There are a number of ways to do this so some suggestions to start looking at are: NumPyArrayToFeatureClass (arcpy.da) (with ExtendTable (arcpy.da)]2 for the attributes) InsertCursor (...


7

what it means as conceptual, you can check out GIS Dictionary from ESRI, here. Feature Class In ArcGIS, a collection of geographic features with the same geometry type (such as point, line, or polygon), the same attributes, and the same spatial reference. Feature classes can be stored in geodatabases, shapefiles, coverages, or other data formats. ...


7

Make sure the directory C:\tmp exists. If it does not, your third call will fail. I normally use unicode and double slashes for my workspaces. u"J:\\restored-20101025\\basemaps\\ALTA\\FileGeodatabase\\GEOBASE_GIS_DATA.gdb" But the big problem is that your logfile.close() is inside your for loop. That needs to be outside the for loop, or else you will close ...


7

If you have ArcGIS and if you have also installed the Data Interoperability Extension (ArcGIS-integrated version of FME by Safe Software), you can read simple GML and WFS data sources without a license for the extension (source). As long as your GML data sticks to the GML Simple Features profile, you do not need to enable the Data Interoperability Extension,...


7

Incorporating temporary layers into your models also decreases processing time. From a processing standpoint, it is much more efficient writing to memory compared to writing to disk. Similarly, you can write temporary data to in_memory workspace, which is also more computationally efficient. Many operations in ArcGIS require temporary layers as inputs. ...


7

The method for removing a feature depends on the cursor. If you are using a recycling cursor: pCur = pFeatClass.Search(null,true) do not call delete in any way, shape or form. Calling delete on a recycling cursor removes the buffer so there is nothing to load the next feature into which is why it's getting cranky when you call NextFeature() - you've already ...


7

To put it really simply, a shapefile is a feature class that is not stored within a geodatabase. So you can use a tool like Conversion > Feature Class To Feature Class (or arcpy.FeatureClassToFeatureClass_conversion) and convert a feature class or layer to a shapefile. Modifying the sample script from Feature Class to Feature Class Desktop Help slightly, ...


6

You could give the GDAL/OGR utility ogr2ogr a try. It has to capability to convert between many formats of vector spatial data. GDAL/OGR Downloads ogr2ogr Utility OGR GML Driver Documentation Depending on the flavor of your XML/GML it may be able to extract the spatial components straight away, and be as simple as: ogr2ogr -f "esri shapefile" path\to\...


6

In ArcMap use the Spatial Adjustment toolbar: Within the editing environment, the spatial adjustment tools provide interactive methods to align and integrate your data. Spatial adjustment supports a variety of adjustment methods and will adjust all editable data sources. It's often used when you've imported data from another source, such as a CAD ...


6

I think your first problem is that you're appending ".shp" to your output geodatabase featureclass. Remove this and your problem may be solved. ... .... shpFile = "file_%s" % number #--removed ".shp" ... ...the rest of your code here


6

I recommend starting and finishing all edits within an edit operation inside of a try block, where a catch block would call AbortOperation. Something I've always wondered about is whether it makes sense before starting an edit operation to check to see if there's already an operation underway, via IWorkspaceEdit2.IsInEditOperation.


6

To read from different sources with a 'wildcard (*)' use glob import glob gdbs = glob.glob("D:\\geodata\*\*.gdb") # looks for all .gdb's in sub- folders of geodata for gdb in gdbs: # do stuff... To get the names of the features in the gdb you better define a function based on this answer: def feat_in_gdb(name): return [[os.path.join(feat, ...


6

R0B0Donuts answer is not far off getting your job done. BUT you have to alter that last step from the example (XYeventLayer example.). You do not want to save the XYeventlayer to an layerfile but you do a FeatureClassToFeatureClass conversion (FC to FC conversion). That actually saves the XYeventLayer to a featurelayer. arcpy.MakeXYEventLayer_management(...


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