Coder Social home page Coder Social logo

file-geodatabase-api's Introduction

FileGeodatabaseAPI

The File Geodatabase C++ API for Windows, MacOS and Linux. The API provides basic tools that allow the creation of file geodatbases, feature classes and tables. Simple features can be created and loaded. See the README included in each of the version directory for a complete list. .NET bindings are included.

Instructions

Download the operating system/compiler varient(s) of the API that you need and unzip it into a folder.

Resources

Licensing

Copyright 2017 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's License.txt

[](Esri Tags: FileGDB API C++) [](Esri Language: C++)​

file-geodatabase-api's People

Contributors

lshipman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

file-geodatabase-api's Issues

Not thread safe

We have found that the Esri File Geodatabase API isn't thread safe for reading.
I saw that #1 mentioned that multithreaded writing isn't supported, but it is quite a bit limitation that reading isn't thread safe.
Are there any plans to make the Esri File Geodatabase API thread safe?

Setting the FieldDef.Alias property does not work.

In the C# version of the API setting the FieldDef.Alias property does not work:

FieldDef f = new FieldDef;
f.Alias = "Some Text";

After setting it, it is reported as "" and the call has no effect on the table.
Concerns version 1.5.1 (FileGDB_API_1_5_1-VS2017.zip).
This works in C++ so there must be a small bug in the C# wrapper.

Error when trying to save FGDB - (The user does not have permission to execute the operation.)

Hello, when trying to save changes to the table, the following message appears: "Failed updating row (The user does not have permission to execute the operation.) "or if you try to save edits (in the case of dividing) in the geometry this message appears:" Failed at writing Row to Table in CreateFeature. (The user does not have permission to execute the operation.) ". This happens only when I try to edit layers that have a relationship (Talhoes, for example).
Does anyone know how I can solve this problem?

Note: I'm sorry for any mistakes, but I don't speak English.

FileGDB
J12__04_11_2013.gdb.zip

License Clarification

The license on the project is Apache 2, which is stated in all of the README files. However the C++ header files have this license:

/*
COPYRIGHT ? 2015 ESRI
TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
Unpublished material - all rights reserved under the
Copyright Laws of the United States and applicable international
laws, treaties, and conventions.

For additional information, contact:
Environmental Systems Research Institute, Inc.
Attn: Contracts and Legal Services Department
380 New York Street
Redlands, California, 92373
USA

email: [email protected]
*/

As I understand copyright (IANAL), the source file copyright would cover this file and not the Apache 2 license stated in the README. Was this just an oversight of releasing the source or is the intention that the header files are still ESRI Proprietary and Confidential, but usage of the compiled binaries is under the Apache 2 license?

Thanks.

The function Setup() can not set texture and materials

i am trying to create a multipatch with texture and materials,i wont to set the num and Dimension of texture through the function public void Setup(ShapeType shapeType, int numParts, int numPoints, int numTextures, int textureDimension, int numMaterials, ulong materialsLength),but i found after  the method is executed,it is still 0.

image

I thought it over,There are two possibilities.
one,the shapetype i seted dose not have any of the newer modifier bits,but i can not find any function to set th shapetype.
two,the set function maybe have some problem.

This problem has been bothering me for a long time, and I really hope you can help me solve it!

BUG-000088293 still not fixed

FGDB_API_Issues.zip
Hi,

In release notes for 1.5 is mentioned that BUG-000088293 was fixed, but it still doesn't work. I attached files which was send to ESRI support during BUG-000088293 registration, but use 1.5.1.253 file-geodatabase version instead and same errors appear. Also tried with 1.5 and x64 and x86 - not working.
Question: it was fixed or information in release notes is incorrect? When such bug will be fixed?

BUG-000088293 info: FileGDB API throws -2147217395 error when executing SQL query with SQL functions.

Shapefiles to GDB

I need a converter for shape files into the GDB format, especially important are the geometries. Is there a way with this API? I looked into it, and if not I want to try to write an own converter between another lib :)

vs2019(professional) in break mode, can't find geodatabase.cpp

Hi, Esri team.

we have met an serious issue for many days.
our develpment environment: OS: win10 64bit. WPF, c# ,.Net core 3.1, x64 output. (x86output has the same issue)
vs often goes into break mode and prompts: can't find geodatabase.cpp after we use Esri.FileGDBAPI.dll(1.5.1) to operate gdb file.

when we use netframework4.6.1,the issue is still there.

we close the Geodatabase at the last object after openning it.
there are other things we need to do to solve the issue?
thanks.

Crashed

When debugging and looking into the objects there are crashes, FieldDefs are null.

Generate release?

I'm interested in packaging this for the conda-forge, to improve the GDAL build we currently have. Would it be possible to generate a tarball release for this repo? Thanks!

Standard column SHAPE_Length and SHAPE_Area

I wonder, how I can create a Polygon-Featureclass with the two standard-columns SHAPE_Length and SHAPE_Area. Must I create and fill the two columns by my own, programmatical?

I'm using the FileGeodatabase API 1.5.2 in the GDAL-Environment.

Crash on `DeleteGeodatabase`

Version: filegdb-api-1.5.1-vs2017 (x64)
Toolchain: VS2017 (15.9.7) -- Windows SDK 8.1 -- Platform toolset v141
OS: Windows 10 (10.0.17134)

It seems calling DeleteGeodatabase causes a crash on my system. Here is the errorspit out by the debugger:

image

And here is the call stack:

 	msvcp140d.dll!00007ffb90aefb86()	Unknown
>	FileGDBAPID.dll!std::_Vector_const_iterator<class std::_Vector_val<struct std::_Simple_types<class FileGDBAPI::Geodatabase *> > >::operator++(void)	Unknown
 	FileGDBAPID.dll!std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class FileGDBAPI::Geodatabase *> > >::operator++(void)	Unknown
 	FileGDBAPID.dll!std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class FileGDBAPI::Geodatabase *> > >::operator++(int)	Unknown
 	FileGDBAPID.dll!CatalogRegistry::DeleteGDB(class FileGDBAPI::Geodatabase *,class Catalog *)	Unknown
 	FileGDBAPID.dll!FileGDBAPI::Geodatabase::DeleteGeodatabase(void)	Unknown
 	FileGDBAPID.dll!FileGDBAPI::DeleteGeodatabase(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)	Unknown

Example invocation:

const wchar_t* path = L"C:\\Users\\RALPHM~1\\AppData\\Local\\Temp\\test.gdb"
FileGDBAPI::DeleteGeodatabase(path);

Using a long path does not resolve the issue.

Segmentation fault in EnumRows::Next() when requesting a binary field on a CDF dataset

Coming from qgis/QGIS#45760

With the attached dataset COASTS.gdb.zip, FileGDB_API-RHEL7-64gcc83 crashes on the following test program (adapted from samples/Querying/Querying.cpp) during the second iteration on EnumRows::Next(), if Table::Search() requests the binary field SE_ANNO_CAD_DATA

test_fgdb.cpp:

#include <string>
#include <iostream>
#include <fstream>

#include <FileGDBAPI.h>

using namespace std;
using namespace FileGDBAPI;

int main()
{
  // Open the geodatabase.
  fgdbError   hr;
  wstring     errorText;
  Geodatabase geodatabase;
  if ((hr = OpenGeodatabase(L"COASTS.gdb", geodatabase)) != S_OK)
  {
    wcout << "An error occurred while opening the geodatabase." << endl;
    ErrorInfo::GetErrorDescription(hr, errorText);
    wcout << errorText << "(" << hr << ")." << endl;
    return -1;
  }

  // Open the COAST_PROTECTION_STRUCT_LINE table.
  Table table;
  if ((hr = geodatabase.OpenTable(L"COAST_PROTECTION_STRUCT_LINE", table)) != S_OK)
  {
    wcout << "An error occurred while opening the table." << endl;
    ErrorInfo::GetErrorDescription(hr, errorText);
    wcout << errorText << "(" << hr << ")." << endl;
    return -1;
  }

  // Query
  EnumRows attrQueryRows;

  // Will crash on Next() iterations
  // Crashes on second Next() iteration if requesting the binary field SE_ANNO_CAD_DATA:
  wstring columns = L"OBJECTID, ASSET_ID, SE_ANNO_CAD_DATA";

  // Works fine if not requesting SE_ANNO_CAD_DATA:
  // wstring columns = L"OBJECTID, ASSET_ID, STRUCTURE_TYPE, CONSTRUCTION, LAST_MODIFIED, Shape_Length";

  if ((hr = table.Search(columns, L"", true, attrQueryRows)) != S_OK)
  {
    wcout << "An error occurred while performing the attribute query." << endl;
    ErrorInfo::GetErrorDescription(hr, errorText);
    wcout << errorText << "(" << hr << ")." << endl;
    return -1;
  }

  // Iterate through the returned rows.
  Row              attrQueryRow;
  // First iteration works, crash on second
  while (attrQueryRows.Next(attrQueryRow) == S_OK)
  {
      int assetId;
      attrQueryRow.GetInteger(L"ASSET_ID", assetId);
      int objectId;
      attrQueryRow.GetOID(objectId);
      wcout << objectId << "," << assetId << endl;
  }
  attrQueryRows.Close(); // Close the EnumRows

  return 0;
}

compile and run:

$ g++ test_fgdb.cpp -I/home/even/FileGDB_API-RHEL7-64gcc83/include -o test_fgdb -L/home/even/FileGDB_API-RHEL7-64gcc83/lib -lFileGDBAPI && ./test_fgdb 
286,101535
Segmentation fault (core dumped)

gdb traceback:

Thread 1 "test_fgdb" received signal SIGSEGV, Segmentation fault.
0x00007ffff6ee39c0 in SqlSelectCommand::CreateObjects() () from /home/even/FileGDB_API-RHEL7-64gcc83/lib/libFileGDBAPI.so
(gdb) bt
#0  0x00007ffff6ee39c0 in SqlSelectCommand::CreateObjects() () from /home/even/FileGDB_API-RHEL7-64gcc83/lib/libFileGDBAPI.so
#1  0x00007ffff6ee3dd4 in SqlSelectCommand::Next() () from /home/even/FileGDB_API-RHEL7-64gcc83/lib/libFileGDBAPI.so
#2  0x00007ffff6da969d in FileGDBAPI::EnumRows::Next(FileGDBAPI::Row&) () from /home/even/FileGDB_API-RHEL7-64gcc83/lib/libFileGDBAPI.so
#3  0x00005555555568dd in main ()

Create FileGDB - when used with Safe Software's fgdb writer - is updating the Modified date field on the internal tables with a fixed date in the past

This issue is reproducible using FME Workbench 2021.0.x/2021.1.x or ArcGIS Data Interoperability (Pro build 2.8) using the v.1.5.1 version of the API, when creating the file GDB with the File GDB Writer.

Shown below some of the internal files of the FGDB have modified date that is earlier than created date.

fgdbapi

FME Workspace and sample GDB attached.

repro.zip

Feature Class Could Not Be found Due to Non-ASCII Character In Name

When trying to open a feature class that contains Ä in the name, the API is unable to find the table (error value -2147220655). I have attached a .gdb file that contains a feature class name containing the faulting character. When the character is removed from the name it is able to be opened. The feature class can be opened and displayed properly in ArcGIS Pro and ArcMap. I have also confirmed that the characters are stored as a wstring as UTF-16 bytes.

Code snippet:

std::vector<std::wstring> datasetVector;
fgdbError result = geodb.GetChildDatasets(L"\\", L"Feature Class", datasetVector); 
const std::wstring tableName = datasetVector[0];
const fgdbError result = geodb.OpenTable(tableName, currTable_);  // returns error value, could not find table

Edit: I have done all of the above on Windows 10 Version 10.0.19042 Build 19042 x64
Edit 2: After some more debugging, I have found that this issue only happens when beta UTF8 encoding is turned on.

repro.gdb.zip

Add multi-thread support

For 10 years now I've been dreaming of a multi-threaded FGDB. So many of our ETL processes have horrible performance because of this limitation.

Problem running gcc API for mac

I am getting an error when trying to run the makefile script (FileGDB_API_1_4_64_gcc.zip). This was esri tech-support case 01891003.

My goal is to be able to write a fileGDB using GDAL (and ogr2ogr from postgis). I assume I need to successfully run the make script in order to have the right libraries to copy.

I’m running El Capitan (Mac OSX 10.11.5 15F34; Kernel Darwin 15.5.0) on a mac that’s a few years old (i7 processor, model iMac14,2).

As described in the README file, I checked the gcc version, set the LD_LIBRARY_PATH, set CXX and then tried to ‘make’ but got an error; see below for the error from make and the response to ‘make –v’ (which seems to refer to a version of GNU that was built for a MUCH older kernel).

prompt> gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

prompt> LD_LIBRARY_PATH='/Users/steven/Desktop/FileGDB_API-64gcc'
prompt> echo $LD_LIBRARY_PATH
/Users/steven/Desktop/FileGDB_API-64gcc

prompt> CXX=g++
prompt> echo $CXX
g++
prompt> cd samples
prompt> make
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C Domains
c++ -fPIC -O3 -m64 -arch x86_64 -W -fexceptions -D_CONSOLE -DUNICODE -D_UNICODE -DUNIX -D_REENTRANT -DFILEGDB_API -D__USE_FILE_OFFSET64 -DUNIX_FILEGDB_API -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I../../include -I. -m64 -arch x86_64 -L"../../lib" -o ../bin/Domains ./Domains.o -lFileGDBAPI
Undefined symbols for architecture x86_64:
"FileGDBAPI::Geodatabase::AlterDomain(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)", referenced from:
_main in Domains.o
"FileGDBAPI::Geodatabase::CreateDomain(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)", referenced from:
_main in Domains.o
"FileGDBAPI::Geodatabase::DeleteDomain(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&)", referenced from:
_main in Domains.o
"FileGDBAPI::Geodatabase::OpenTable(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, FileGDBAPI::Table&)", referenced from:
_main in Domains.o
"FileGDBAPI::OpenGeodatabase(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, FileGDBAPI::Geodatabase&)", referenced from:
_main in Domains.o
"FileGDBAPI::Table::AlterField(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)", referenced from:
_main in Domains.o
"FileGDBAPI::ErrorInfo::GetErrorRecord(int, int&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&)", referenced from:
_main in Domains.o
"FileGDBAPI::ErrorInfo::GetErrorDescription(int, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&)", referenced from:
_main in Domains.o
"FileGDBAPI::Geodatabase::GetDomainDefinition(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&) const", referenced from:
_main in Domains.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [../bin/Domains] Error 1
make: *** [Domains] Error 2

prompt> samples steven$ make -v
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

Access Violation in EnumRows

Hello, anyone knows how to fix? It happens when I'm loading a certain GDB folder.

Hello, I'm encountering an access violation when calling EnumRows.Next. It happens when I'm loading the attachedn GDB folder. Any ideas?

Exception thrown at 0x00007FFE19D3BC60 (FileGDBAPID.dll) in Samples.exe: 0xC0000005: Access violation reading location 0x000001C48DFF1000.

wont run on server 2008

I developed on a Win 7 machine and all works well for testing. I made a setup and included the system*.dll files as well as the ESRI dll files.

Framework is installed and is the same version.

The app is a command line app
It immediately crashes. I have a console writeln at the very start and that doesnt come up either. I have tried x64 and x32 and different frameworks.

Any ideas?

Release for each specific version / platform?

Why not release this api for each specification like what ESRI do in https://github.com/Esri/arcgis-runtime-toolkit-qt ?

To download a specific version of a specific platform one need to download this:

https://github.com/Esri/file-geodatabase-api/blob/master/FileGDB_API_1.5/FileGDB_API_1_5_64clang.zip?raw=true

But when the project is correctly setup one can download it so:

https://github.com/ESRI/file-geodatabase-api/archive/v1.5_clang_x64.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.