25 votes

Reading feature class in file geodatabase using R?

As already posted in this answer, this now also works very nicely with sf: require(sf) fc <- sf::st_read("C:/path/to/your/filegeodatabase.gdb", layer = "some_featureclass") But writing into a ...
Ratnanil's user avatar
  • 983
21 votes

Accessing feature classes in file geodatabases using Python and GDAL

Much simpler and intuitive if you use fiona and geopandas import fiona import geopandas as gpd # Get all the layers from the .gdb file layers = fiona.listlayers(gdb_file) for layer in layers: ...
Solomon Vimal's user avatar
15 votes

Accessing feature classes in file geodatabases using Python and GDAL

I would like to add that "FileGDB" is a propriatary driver that might not be included with you GDAL package http://www.gdal.org/drv_filegdb.html. This results in GetDriverByName returning None. There ...
Alec's user avatar
  • 151
11 votes
Accepted

Create Shapefile/Feature Class with CSV that has Shape values?

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 ...
Dan C's user avatar
  • 12.2k
10 votes
Accepted

How do you compare all fields in multiple feature classes?

List the fields using set comprehension, compare the sets: import arcpy fc1 = r'C:\GIS\data\Bakgrundskartor_LMV\Oversiktskartan.gdb\ak_riks' fc2 = r'C:\GIS\data\Bakgrundskartor_LMV\Oversiktskartan....
BERA's user avatar
  • 72.6k
9 votes
Accepted

Create Fishnet option

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 ...
PolyGeo's user avatar
  • 65.2k
7 votes

Can a feature class be stored as a shapefile?

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....
Midavalo's user avatar
  • 29.7k
7 votes

Which is the faster way to copy data to another feature class: Feature Class to Feature Class or Insert Cursor

I created three sample random point datasets - 10 features, 100k features, 1m features - and tested the following options Copy (arcpy.Copy_management()) Insert Cursor (arcpy.da.InsertCursor()) ...
Midavalo's user avatar
  • 29.7k
7 votes
Accepted

How to load features into empty feature class using stand-alone arcpy script

I believe using Append geoprocessing tool would be the most robust approach to load data into the target feature class. The tool has field_mapping parameter which you can specify to map your input ...
Alex Tereshenkov's user avatar
6 votes
Accepted

How to use search cursor in a given extent

Create a Feature layer and then use Select Layer by location with a polygon of your extent. Example: import arcpy arcpy.env.workspace = r'D:\test.gdb' fc = r'Polygon' fcselectionpolygon = r'...
BERA's user avatar
  • 72.6k
6 votes
Accepted

Using arcpy AsShape on GeoJSON file?

It is pretty simple actually, you just need to iterate through the features of the geojson structure once you have got it in a dictionary format (like from the json.load() function). I don't work ...
crmackey's user avatar
  • 8,484
6 votes
Accepted

How to delete a single Feature Class from a geodatabase using FME

Initially, I hadn't read the question properly, and answered with a python solution. However, I see now that you can't use python, so I have a different solution for you. It requires that you use the ...
Fezter's user avatar
  • 21.9k
6 votes
Accepted

Shapefile not Z-enabled although the environment is Z-enabled in ArcPy

Raster to Point doesn't add Z information, it just creates an attribute in the output 2D feature class's attribute table. From the Raster To Point documentation: Converts a raster dataset to point ...
user2856's user avatar
  • 65.8k
5 votes

Can a feature class be stored as a shapefile?

I found a Spatial Times blog entitled Shapefile vs Feature Class by searching Google: A Shapefile is a Feature Class. Although the intended question probably wasn’t answered here. But let’s go a ...
PolyGeo's user avatar
  • 65.2k
5 votes
Accepted

List feature class returns nothing

You need to assign it to a variable: featureclasses = arcpy.ListFeatureClasses() Then you can access the variable: for fc in featureclasses: (do something)... Checkout the examples here:
Brian's user avatar
  • 772
5 votes
Accepted

Turning off Feature Classes in ArcGIS Pro using ArcPy?

ArcGIS Pro uses Python 3.x, as such, the print command is a function. It requires you to use it like a function print(lyrx.name) where as in Python 2 you could get away with doing print lyrx.name ...
KHibma's user avatar
  • 16.8k
5 votes
Accepted

List all MXDs that a feature class is in using arcpy

As mentioned in the comments, if you can get all the MXDs in a single location, you can run over each MXD and find each layer stored within. The below code will return a dictionary of layers' ...
mdholl6188's user avatar
5 votes
Accepted

Is there a way to identify empty feature classes in ArcMap without deleting them?

You can run the code below in the Python window within ArcMap. You will first have to copy the path to the directory containing all of your geodatabases and insert it into the script at the identified ...
reevesii's user avatar
  • 1,519
5 votes
Accepted

Make feature class Z and M aware with geoprocessing

It is not possible to enable m and z values for an existing feature class. You'll need to recreate it with m and z values enabled. Use the Feature Class to Feature Class conversion tool. Go into ...
jbalk's user avatar
  • 7,505
5 votes
Accepted

Finding highest value within a shapefile or feature class using ArcGIS Desktop?

If you have Spatial Analyst extension If you have access to the Spatial Analyst extension, you can use the Zonal tools to extract the value of the maximum fishing intensity value found within a given ...
umbe1987's user avatar
  • 3,785
5 votes

Converting geopackage to feature class (shapefile or geodatabase) using ArcGIS Pro

I think the most useful page from the documentation for this is the one titled Work with SQLite databases and GeoPackage files in ArcGIS Pro: You can connect to an SQLite database or GeoPackage file ...
PolyGeo's user avatar
  • 65.2k
5 votes

Finding common Intersection area of each pair of rectangles with circle buffers inside each one using ArcPy with ArcGIS Pro

This is the case when scripting is massive overkill, because: arcpy.Intersect_analysis("buffer #;fish_net #","in_memory/isect", "ONLY_FID") arcpy.Dissolve_management(&...
FelixIP's user avatar
  • 23k
5 votes
Accepted

ArcPy SearchCursor Error: "An expected Field was not found or could not be retrieved properly"

Your expression uses double quotes for the string values in the where clause. Use single quotes. I've swapped the outer string quotes so you don't need to escape embedded single quotes in the example ...
user2856's user avatar
  • 65.8k
5 votes
Accepted

Export a GDB feature class to a GPKG with OGR

-lco is a layer creation option. Just pass the featureclass name and ignore the feature dataset: ogr2ogr -f GPKG "C:\MyDir\MyGPKP.gpkg" "C:\MyDir\MyGDB.gdb" my_feature And if you ...
user2856's user avatar
  • 65.8k
4 votes

What is the format of these data files? CNT, LAB, PAL, etc

I'm not 100% sure, but it looks very much like an old-style Arc/Info Coverage. I clearly remember those having TIC, AAT and BND files. This format is somewhat similar to a file geodatabase, in that ...
Berend's user avatar
  • 4,737
4 votes
Accepted

Can a feature class be stored as a shapefile?

Yes, a shapefile is considered a Feature Class, which lends it several attributes. Esri provides this overview about the shapefile <updated link 200828 based on comment by @Rex below>...
whyzar's user avatar
  • 12.1k
4 votes
Accepted

Adding values from list to field in feature class using ArcPy?

You should be using UpdateCursor instead: print Final_Rank arcpy.AddField_management(fc, "RANK", "Double") pointer = 0 with arcpy.da.UpdateCursor(fc, 'RANK') as cursor: for row in cursor: ...
Delonix R.'s user avatar
4 votes
Accepted

Fastest way to write large numpy arrays to feature class: as rows, or as columns?

If you don't have any data already preserved in the output feature class, it might be faster to insert new rows instead of updating existing ones. For this, you would use da.InsertCursor. If you ...
Alex Tereshenkov's user avatar
4 votes

Create loop in ModelBuilder in ArcGIS?

You can use the Iterate Feature Classes tool within ModelBuilder. This will iterate through your feature classes as long as they are all within the same workspace. It is a ModelBuilder only tool ...
Stephen Ruhl's user avatar
4 votes
Accepted

Export arcpy.ListFeatureClasses to txt for later use

ListFeatureClasses returns a list of strings; there is no special FeatureClass class that would be required by Describe. Instead, the issue is that you need to include the full path to the feature ...
Tom's user avatar
  • 4,128

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