Skip to main content
Solved

Oracle to Shapefile-Field Length?

  • September 25, 2017
  • 3 replies
  • 8 views

Forum|alt.badge.img

Hi, I have geometry in one Oracle table and attribute information in another which I am merging using feature merger. This works fine, the problem I then have is that I need to write to shapefile and it truncates fields to 254. In one particular field there are 100+ attributes that are over 2000 characters in length. I know I can use substring extractor to extract various lengths but does anyone know how I could ‘automatically’ create x number of attributes (each less than 254 characters) so that I would have 10 attributes of 254 length etc. that would make up 2,540 characters? Thanks

Best answer by david_r

That is correct, shape files don't support text fields longer than 254 characters.

Also, you cannot have more than 255 fields in a single shapefile, see https://en.wikipedia.org/wiki/Shapefile#Data_storage, so splitting your 100+ attributes into 10 pieces each (grand total 1000+ attributes!) isn't going to work either.

Is it possible to use any other format, i.e. something more modern that supports large text fields?

You could also consider only including the primary key + geometry in the shape file, then writing all the text attributes to some other format (CSV?) with a foreign key that references the shape file contents.

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

3 replies

david_r
Celebrity
  • Best Answer
  • September 25, 2017

That is correct, shape files don't support text fields longer than 254 characters.

Also, you cannot have more than 255 fields in a single shapefile, see https://en.wikipedia.org/wiki/Shapefile#Data_storage, so splitting your 100+ attributes into 10 pieces each (grand total 1000+ attributes!) isn't going to work either.

Is it possible to use any other format, i.e. something more modern that supports large text fields?

You could also consider only including the primary key + geometry in the shape file, then writing all the text attributes to some other format (CSV?) with a foreign key that references the shape file contents.


jneujens
Forum|alt.badge.img
  • September 25, 2017

Another tip, you might use a 'Joiner' transformer instead of a feature merger. As your database will get larger, the Joiner appears to be faster than a FeatureMerger!


Forum|alt.badge.img
  • Author
  • September 25, 2017
jneujens wrote:

Another tip, you might use a 'Joiner' transformer instead of a feature merger. As your database will get larger, the Joiner appears to be faster than a FeatureMerger!

Thanks, I'll try that...

 

 


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