Solved

How to read multiple ESRI Geodatabases from url?

  • 13 January 2023
  • 8 replies
  • 9 views

Userlevel 1
Badge +8

I need to read multiple geodatabases from url, where some geodatabases are at the root folder, and some in subfolders.

I tried to follow the article here, but already the initial schema reader fails. I set the source to https://arealdata-api.miljoeportal.dk/download/**/*.gdb.

 

The error message I get is: Unable to connect to the File Geodatabase at 'HTTPS:\\arealdata-api.miljoeportal.dk\\download\\**'. Make sure the correct filename was specified, and that the Geodatabase wasn't saved with a newer version of ArcGIS than the one installed locally. The error number from ArcObjects is: '-1'. The error message from ArcObjects is: {}

 

schema reader failure

icon

Best answer by ebygomm 16 January 2023, 15:01

View original

8 replies

Userlevel 1
Badge +21

I've seen this error previously when the unzipped temp file paths created were too long.

 

Although I'm also not sure whether you can actually use wildcards when reading from a URL either

Userlevel 1
Badge +8

I wonder if I have influence on the length of the unzipped temp files, but will see what I can do.

In case that I cannot use wildcards in an url, is there another way of reading sources where you as the 'end-user' do not have control over the data provided? It will be a great pain if I would have to create readers for each and every geodatabase provided, while having good chances that on the next visit the names have changed, or some data are not provided anymore...

Userlevel 1
Badge +21

I think from the URL you should be able to get the name of the each GDB, although it would require some looping to go through all the subfolders too. Once you have those values you can use that as the source in your reader

Userlevel 1
Badge +8

I think from the URL you should be able to get the name of the each GDB, although it would require some looping to go through all the subfolders too. Once you have those values you can use that as the source in your reader

Well, I do have to whole thing tumbling down the rabbit hole...

workflowand I was thinking to read all the geodatabases in FeatureReaders dynamically in, but that's exactly where my issue was... how do I set the FeatureReader up to read all the data? Finally I managed! I tell the FeatureReader the input is of type File GDB, and point at the url + gdb_name (Value(name))

FeatureReader settingsand repeat Value(name) here

Gernerating Output Ports dialogNow all data are read and the correct number of schemas returned by the FeatureReader.

Userlevel 1
Badge +21

You should be able to do something a bit more elegant to get the urls for the files,

e.g.

imageimage

Userlevel 1
Badge +8

You should be able to do something a bit more elegant to get the urls for the files,

e.g.

imageimage

I have one more question in relation to the reading of the files @ebygomm​ .

I connected a FeatureReader to the loop-output and configured the way seen in the screenshot below.

FeatureReader settingsHere the features to read are left at default settings: Schema and Data Features, and format is set to 'Esri Geodatabase (File Geodb)', while the output ports are set to 'One per Feature Type'. Due to the latter setting I am getting the following dialog. I tried to give it an arbitrary GDB file, since at this time also the File Geodatabase does not exist yet, and the 'Regenerate' checkbox is checked.

 Output Ports dialog 

The FeatureReader brings 'Schemas' as output as well.

 

When I try to write the features read via a dynamic FeatureWriter, the writing fails because of the following warning and error:

Cannot define schema for '' as the feature does not contain schema information, and schema source is set to 'Schema from Schema Feature'. Please verify writer feature type configuration

Esri Geodatabase Writer: Feature Type Definition '' was requested, but not defined. Please visit https://www.safe.com/support

 

The default settings for the dynamic schema definition is 'Schema From Schema Feature' and there is nothing else to set it to. The schema definition name defaults to the name of the feature class or table name and that's also where I left it.

 

How do I get the features from multiple databases written into their own database tables? At the moment it seems the link to schemas is simply not there.

Userlevel 1
Badge +8

You should be able to do something a bit more elegant to get the urls for the files,

e.g.

imageimage

Here is my workspace...

Userlevel 1
Badge +8

You should be able to do something a bit more elegant to get the urls for the files,

e.g.

imageimage

Okay, it seems like my latest attempt is fruitful, but I wonder if that's really the way to go...

writing features with proper schema

Reply