You can use rgdal to access feature classes in Esri file geodatabases.
# 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)
# Read the feature class
fc <- readOGR(dsn=fgdb,...
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 ...
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:
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 ...
The trick you're missing is making each gdb the active workspace before listing the contents:
for item in workspaces:
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 ...
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 ...
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)
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 ...
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 ...
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 ...
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 ...
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 ...
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, ...
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"
projection = "c:\Program Files\ArcGIS\Desktop10.0\Coordinate Systems\Projected Coordinate Systems\National Grids\Europe\ETRS 1989 Poland CS92.prj"
#create empty polygon ...
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 ...
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.
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.
dir = r'D:\output'
arcpy.env.workspace = dir
gdbList = arcpy.ListWorkspaces('*','FileGDB')
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 ...
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)
what it means as conceptual, you can check out GIS Dictionary from ESRI, here.
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. ...
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.
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 ...
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,...
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. ...
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 ...
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, ...
You could give the GDAL/OGR utility ogr2ogr a try. It has to capability to convert between many formats of vector spatial data.
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\...
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 ...
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
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.
To read from different sources with a 'wildcard (*)' use 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:
return [[os.path.join(feat, ...
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.