Skip to main content
Solved

after exporting shp to gdb features are missing from gdb


proteve
Contributor
Forum|alt.badge.img+2

I have manage to export shp in file geodatabase with datasets but now it seems that i have a strange problem (or bug).

every shp that i have exported is missing 1st entry in geodatabase. lets say a shp file has 10 points then i’ll get only 9 points in gdb and the one is missing is always the 1st pont in shp file. every shp file is missing that 1st entry.

the strange thing is that fme shows in information that it wrote all entries that the shp files has but somehow 1 is missing.

there is absolutly no error in logs. i get some info about some fields that i don’t export anyway. i really have no idea why this is happening.

the shps are also exported with FME from othe types of data.

for writer i use Esri Geodatabase (File Geodb Open API) with some schemas that i read from a template database with featurereader and join it on shps (no schema was readed).

so what im doing wrong?

why there is no error about the missing entries?

Best answer by nielsgerrits

What you need to change is you need to feed the Schema feature from FeatureReader_2 directlty in the reader, instead of merging it to the data features. Because you merged it, the reader is indeed using the first data feature to create the structure.

It is also important that the Schema Features reach the writer first, because the data can’t be written without a schema when dynamic. To force this, I use AttributeCreators just before the writer to create an attribute with the name “Order” and a value 1 in the schema feature stream, and a 2 in the data feature stream followed by a Sorter, which sorts on the value Order, numeric asc.

And I think the value of fme_feature_type in the data features need to be the same as the value fme_feature_type_name in the schema features, for the writer to understand which schema feature belongs to the data feature.

View original
Did this help you find an answer to your question?

9 replies

proteve
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • June 8, 2024

i think that the 1st entries in shp files are use to create tables and the data is discarded. i use sampler for 1st entry in parallel and i have no problem with the result of gdb but this definitely is not the right way to do it. i just use it for testing purpose.


proteve
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • June 11, 2024

i was wrong. it seems that this bug is present regardless of create/use existing/truncate tables. it just ignores the 1st entry in every shp files.


nielsgerrits
VIP
Forum|alt.badge.img+54

Not sure what you are experiencing, but I can’t relate to it.

Any warnings or errors in the log?

Can you printscreen your workflow or share your workspace?


proteve
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • June 11, 2024

here is a reduce workspace screenshot. it says 2 feature went intro writer but i get only 1 feature in dgb. if i have only 1 feature in shp file i have no entry in gdb.

and the log is like this

Warning - No readers were found to be part of the Multi-Reader, so no data will be read.

Error - BADNEWS: File C:\Program Files\FME\metafile\MULTI_WRITER.fmf could not be opened (tabrdr.cpp:161)


nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • June 11, 2024

What you need to change is you need to feed the Schema feature from FeatureReader_2 directlty in the reader, instead of merging it to the data features. Because you merged it, the reader is indeed using the first data feature to create the structure.

It is also important that the Schema Features reach the writer first, because the data can’t be written without a schema when dynamic. To force this, I use AttributeCreators just before the writer to create an attribute with the name “Order” and a value 1 in the schema feature stream, and a 2 in the data feature stream followed by a Sorter, which sorts on the value Order, numeric asc.

And I think the value of fme_feature_type in the data features need to be the same as the value fme_feature_type_name in the schema features, for the writer to understand which schema feature belongs to the data feature.


proteve
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • June 11, 2024

@nielsgerrits i’ve read in help files and forum that schema needs to be first. i’ve tried to add it separately to geodatabase directly but still lose the entries. i never thought of “sort” idea.

 

 

thank you


nielsgerrits
VIP
Forum|alt.badge.img+54

Cheers :) If you like these kind of workflows, the SchemaScanner is also a nice transformer, it generates a SchemaFeature from the data.


proteve
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • June 11, 2024

@nielsgerrits i have a hard time to understand exactly how schema works. but i will look more into it


nielsgerrits
VIP
Forum|alt.badge.img+54

The schema feature contains info about geometry type & attributes and their properties, in a list. This helps in workflows with ever changing sources and the need of flexibel, dynamic outputs. That’s about it I think :)


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings