Tag Info

Hot answers tagged

62

Update July 2015 It is time to bring this answer a bit more current as some elements of FileGDB support in QGIS have changed. I am now running QGIS 2.10.0 - Pisa. It was installed using the OSGeo4W installer. What has changed is that upon the basic install of QGIS, File GDB read-only access is enabled by default, using the Open FileGDB driver. Credit ...


41

At a high level the way I choose is based on whether users are inexperienced and need nothing more than points, lines and polygons. Shapefiles are ideal for this. If they need annotation, domains for pick lists and validation, raster, etc then use File Geodatabases which are easy to use, fast and can be massive in size. I would never use Personal ...


34

In the geospatial world a directory ending in .gdb is usually the Esri File Geodatabase Format, which has an open API which many 3rd party programs can read -- gdal/ogr, fme, and GlobalMapper to name the ones I'm familiar with. Gdal/ogr is open source and is included in many other applications like Quantum GIS and SAGA. Windows end users can most easily ...


21

If you have QGIS running and compiled against GDAL 1.11.0, it now has native FileGDB support via the OpenFileGDB driver. To open a geodatabase in QGIS, be sure to choose "Add vector layer", "Source Type = Directory" and source should be either "OpenFileGDB" or "ESRI FileGDB". Then just browse to the *.gdb folder of choice, press "Open" and the layers will ...


19

I am not aware of an ArcObjects way to get it, but you can enable the Size column in the Customize menu -> ArcCatalog Options -> Contents tab: This works on file geodatabases but not on SDE geodatabases (in that case you could use some DBMS-specific queries to determine it though). It does not work on personal geodatabases.


17

Here is a Python script for ArcGIS 10 that basically does what you want, except that the output is a CSV file, not a geodatabase table. Feel free to modify and use as you like. Note that it is not well tested and not supported, so use at your own risk. """ This script looks through the specified geodatabase and reports the names of all data elements, their ...


16

GP cursors read date values as datetime objects, so you can use datetime.strftime() to format it as you like, or datetime.ctime() to format it as the default format (%a %b %d %H:%M:%S %Y). Here's an example using mm/dd/yyyy: import arcpy from datetime import datetime fc = r"C:\GISData\test.gdb\atlantic_hurricanes_2000" rows = arcpy.SearchCursor(fc) for row ...


16

As far as a file system is concerned, a file gdb is a directory - trying to copy one as a single file will not work. Try this out: import shutil, errno def copyanything(src, dst): try: shutil.copytree(src, dst) except OSError as exc: # python >2.5 if exc.errno == errno.ENOTDIR: shutil.copy(src, dst) else: ...


14

We have, on a large project, managed quite well to isolate ArcObjects code from our business logic. That is generally the way to go, I'd say, rather than attempting to mock it all out, even if it is possible using mocking frameworks to get some of the way. Ask yourself, Why it is you feel the need to mock. Typically, it is because of a missing abstraction. ...


12

I recommend that you try the Feature Class To Shapefile ( Conversion) tool instead: Copies the features from one or more feature classes or layers to a folder of shapefiles. This should enable you to convert feature classes within your file geodatabase to shapefiles.


11

No. .gdb is a proprietary format and ESRI isn't sharing the spec or providing an API. I believe that some people have been able to hack together something to pull the features out, but none of the relationships, topology, domains, etc. The best way to get the features out would be to dump the database to a shapefile or a ESRI personal database. The ...


10

Another option: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000051000000 import arcgisscripting gp = arcgisscripting.create() gp.Copy_management(r"C:\test.gdb", r"C:\test_COPY.gdb")


10

GDAL/OGR has python bindings and a FileGDB driver, but it requires the FileGDB API SDK from ESRI (not free, but AFAIK free of charge).


10

I try to avoid using shapefiles as you cannot store domains, relationships, aliases etc. but they are the most portable format when distributing data to other people who are using different GIS systems/tools. Whilst file geodatabases give better performance and are capable of storing huge datasets, everyone above is giving the humble personal geodatabase a ...


10

An automated way of doing this task is running a python function within Field Calculator (no selecting and reverse selecting required), see example below: Additionally, if you wanted to replace NULL with an empty string just add these two statements: elif value is None: return ''


9

You can use a Python script to do the heavy work for ya: Check this out and adapt it to your needs. Needless to say, this is not tested, and don't use it on production data WITHOUT MAKING A BACKUP FIRST. import arcgisscripting gp = arcgisscripting.create(9.3) gp.Workspace = "path_to_your_geodatabase" # you can use absolute path to this function ...


9

Very few contiguous cells in a detailed DEM will have identical values of both slope and aspect. Therefore, if the input features represent contiguous areas of common slope and common aspect, we should expect the result of this intersection procedure to have, on average, almost one feature per cell. There were originally 65,000 * 1000^2 = 6.5 E10 cells in ...


9

Right-click the feature class in ArcCatalog and go to the Properties. In the Feature Extent tab, click on Recalculate. And voilĂ ! I'm using ArcGIS 10.2.1


9

In this case you don't need to be using the arcpy libraries to copy the geodatabase. Instead you're looking at copying files across a ftp connection, which you can do with the ftplib retrbinary command. Also note that the file system treats geodatabases as folder objects with a set of files inside them. i.e. they're not a single binary file that can be ...


8

I think you are ok with to cut 'n' paste a file geodatabase folder within Windows file explorer but I would encourage you to use ArcCatalog as thats what it is there for, data management. This will guarantee any other associated files/Metadata are updated as ArcCatalog knows about such stuff whilst Windows file explorer just sees it as another file. It is a ...


8

Code If the layer is a shapefile, Layer.datasetName will return the file name. Please read the documentation in the following link to help you understand more about the datasetName parameter of the Layer object: dataSource (Read Only) : Returns the complete path for the layer's data source. It includes the workspacePath and the datasetName properties ...


8

File geodatabases don't store their data as a dbf, shapefiles do. FGDB's use their own internal storage method. ESRI's published an API, if use it to compile GDAL with file geodatabase support you might be able to use R's gdal plugins to get access to your data that way. However, the easiest solution is probably converting your data to shapefile, then ...


7

The next version of ogr will support reading file geodatabases. More info here: http://trac.osgeo.org/gdal/ticket/3332 Edit: In the meantime it is present in gdal/ogr: http://www.gdal.org/ogr/drv_filegdb.html


7

I asked Esri support this a couple of weeks ago...the response was "The File Geodatabase Open API is currently in development. We expect to have it available before the end of the year. It is a C++ API that will allow read/write access to File Geodatabase data." So they're saying end of the year. I'd take that with a grain of salt. Probably a lot of grains ...


7

I don't have an answer for everything, but will give this a shot...I work for a utility setting up a GIS system for land acquisition, maintenance and engineering. We have a whole system of checks and balances where the behind-the-scenes IT server information is not something that I maintain, but can give you a glimpse of what we've seen with our production ...


7

I would try the Describe Workspace release property http://resources.arcgis.com/en/help/main/10.1/index.html#/Workspace_properties/018v0000002v000000/


7

The Features tab of the Find tool will do this if you add every feature class in the File Geodatabase to a map. For example, if you are trying to find Afghanistan on a map of the world, you can enter Afghanistan or just Afgh in the Find tool, and you'll get a list of the features from layers in your map that contain that search string in any of ...


7

You can loop through the FC first and find them maximum value. Example: import arcpy nullvalues = ["", " ", None, 0] # Loop through and get Max value cur = arcpy.SearchCursor("Telecommunications Line") fac_id_values = [int(row.FACILITYID[-4:]) for row in cur if row.FACILITYID not in nullvalues] max_value = max(fac_id_values) # Loop through and Calculate ...


6

OK Let's see here is an article on an ESRI blog saying January for the FGDB API. Have a look. Update: Now available here.


6

Well, fresh news is that the File Geodatabase API should see the light in January, in a beta release. See Inside Geodatabase: File Geodatabase API Details blog post. The are some key limitations, though. If I were to name the most important ones, it would probably be that editing classes participating in relationships is not fully supported, as well as ...



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